Enhanced ZX Speccy Emulator

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
User avatar
1024MAK
Bugaboo
Posts: 3180
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Enhanced ZX Speccy (Alike system?)

Post by 1024MAK »

+3code wrote: Sun May 26, 2024 8:48 pm I would give a vote for the ulaplus too, but that's all. Seems it would have been made with the technology of the time with a somehow double sized and more expensive ula, but it's simply a palette changer, retains the loved 2 colors limitation for each 8x8 cell, so not really legit but I fell it very "Spectrum taste".
The ULAs as used in the QL show that it was possible to have a improved screen display using ULA technology of the time.

As ever with any improved display, you do need more RAM... And then more processor time to process the screen display for animation or whatever. That’s the real problem.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer being good this year.
User avatar
Lethargeek
Manic Miner
Posts: 763
Joined: Wed Dec 11, 2019 6:47 am

Re: Enhanced ZX Speccy (Alike system?)

Post by Lethargeek »

1024MAK wrote: Mon May 27, 2024 7:31 am The ULAs as used in the QL show that it was possible to have a improved screen display using ULA technology of the time.

As ever with any improved display, you do need more RAM... And then more processor time to process the screen display for animation or whatever. That’s the real problem.

Mark
not any - as i said somehere before, it was possible to have either 8x8x2c or low-res 4x8x4c per attribute tile (good for many games with atari-style gfx) for the same amount of RAM and ULA timings; and better screen memory layout to lower its processing time

but of course sir Clive hated video games and wouldn't do anything to improve gaming capabilities
User avatar
stupidget
Dynamite Dan
Posts: 1681
Joined: Wed Jan 24, 2018 2:09 pm
Location: Sunny Wolverhampton

Re: Enhanced ZX Speccy (Alike system?)

Post by stupidget »

Ralf wrote: Sat May 04, 2024 12:05 pm If I understand correctly, you'd like to have an "emulator" of some unexisting machine which you call "enhanced Zx Spectrum". Yet it has modern graphic resolution, colour depth and is probably free of attribute limitations……
Doesn’t that pretty much sum up the NEXT?
Ralf
Rick Dangerous
Posts: 2331
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Enhanced ZX Speccy (Alike system?)

Post by Ralf »

stupidget wrote: Mon May 27, 2024 10:46 am Doesn’t that pretty much sum up the NEXT?

I would say that Next is something at the same level as Amiga, not modern computers which was suggested by the original poster.

He said for example:
Display - 1920x1080x16 bit
I have a very limited knowledge of Next but it seems to be beyond its capabilities.
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy (Alike system?)

Post by Dobsa007 »

@ +3 code
your ideas for it were great, release your files, ppl will take it forward :)
User avatar
+3code
Manic Miner
Posts: 486
Joined: Sat Mar 19, 2022 7:40 am

Re: Enhanced ZX Speccy (Alike system?)

Post by +3code »

Dobsa007 wrote: Tue May 28, 2024 8:45 pm @ +3 code
your ideas for it were great, release your files, ppl will take it forward :)
What ideas? Are you a bot?
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy (Alike system?)

Post by Dobsa007 »

What ideas? Are you a bot?

I thought eZXSpeccy was yours ? 8-)
Mcoder2
Drutt
Posts: 15
Joined: Tue Feb 27, 2024 11:42 am

Re: Enhanced ZX Speccy Emulator

Post by Mcoder2 »

The emulator "fuse" uses SDL for graphics and is written in C. So it's already pretty close to my idea above. It implements Z80-emulation though, so it works in a different way. But as you wanted PC-speed anyway, why not skip Z80-emulation?

Just have a BASIC interpreter written in C (with added commands for sprite graphics and sound) that pipes its screen output in a Spectrum-style to SDL. That's what I suggested above.

Actually, the Youtuber "Gary explains" has already written such a BASIC interpreter in C, which could be used. He asked himself "What should I do with it?", and one of his options was:
Gary wrote:Develop it for games, use SDL, add sprites etc

Unfortunately, it seems he hasn't elaborated that idea yet. But the interpreter core would already be there - for the C experts, which I'm still not.
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy (Alike system?)

Post by Dobsa007 »

Good stuff there mate, I'm thinking similar
:)
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

Mcoder2 wrote: Wed May 29, 2024 7:55 pm The emulator "fuse" uses SDL for graphics and is written in C. So it's already pretty close to my idea above. It implements Z80-emulation though, so it works in a different way. But as you wanted PC-speed anyway, why not skip Z80-emulation?

Just have a BASIC interpreter written in C (with added commands for sprite graphics and sound) that pipes its screen output in a Spectrum-style to SDL. That's what I suggested above.

Mate that's what I thought, PC runs at 3.5 GHz, Win or Linux, If the programming language on the enhanced mode
is enhanced Basic, it will fly
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

System Specs ?

SDL2 Running the core, everything
Fixed res at 1600x900x8 bit
We use Specbas as system language, It's enhanced Speccy Basic
with sprite stuff, Specbas is s a bit obscure to code, but could be made better,
I'm sure the author would allow that ? No Offence :)
Of course the prog is an all systems Speccy emulator,
This is the last item on boot list 'Enhanced mode'
Experimental :D
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

Some thoughts
There's no point having all zx machines emulation,
The emulators out there do it so well
So ours is just Enhanced Speccy emulator mode
Using SpecBas, as system language, Enhanced Speccy Basic
We're running an SDL2 window on Win/Linux, running Specbas :D ?
We have outdone ourselves, Just run Specbas.exe and enjoy :D
The program has outcoded itself :)
User avatar
ZXDunny
Manic Miner
Posts: 509
Joined: Tue Nov 14, 2017 3:45 pm

Re: Enhanced ZX Speccy Emulator

Post by ZXDunny »

SpecBAS pretty much fits the bill. It's 100% open source so anyone that wants to port it to the platform of their choice can have at it. There is literally only one source file that has Windows dependent code in it.

And it's written in Delphi, so FPC/Lazarus would likely handle it just fine.

You can see what it can do here: https://www.youtube.com/@ZXDunny/videos

Any volunteers to port it?
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

@zx dunny
I like SpecBAS, the idea of it, Enhanced Speccy basic, screen size, colours, at PC speed
What's not to like !
Well, In the manual each command definition is so vague
PRINT [[colour-item|expr|location-item]print-sep...]
The bit I don't get is [colour-item], It's never shown in the manual,
No code snippets are there in the definition, give a basic understanding, of a commands uses
The syntax is not explained anywhere
I've tried guessing, this 3 line code is syntax correct, according to manual
but doesn't work

10 GRAPHIC NEW Br01 load "bobright01.bmp"
20 print at 20,20; Br01
25 rem try PLOT ? if print not working
30 plot Br01;20,20

Result is the number 6 printed at 20,20
It's not actually usable, Sorry Paul
User avatar
ZXDunny
Manic Miner
Posts: 509
Joined: Tue Nov 14, 2017 3:45 pm

Re: Enhanced ZX Speccy Emulator

Post by ZXDunny »

Goodness me, unusable? How rude.

Tell me you haven't read the manual without actually telling me you haven't read the manual :D

It's Sinclair BASIC. Colour items in PRINT are the same as they are on a speccy. It literally says what they are in the paragraph that follows the PRINT syntax specification in that manual you didn't read.

Similarly for the GRAPHIC NEW command:
Dunny, in The Fine Manual, wrote: These commands all create a new graphic bank in memory, and assign the index number of that graphic to the numeric variable supplied.
The variable you supply - br01 in this case - is assigned the index number of the new graphic. You use that number when you draw the graphic with say, a variant of the PUT command as detailed a little further down the manual. PRINT is for text, as I am sure you're aware. You cannot PRINT a graphic. Your attempt to PRINT AT 20,20;br01 literally displays the number held in the variable "br01" which is precisely what anyone would expect Sinclair BASIC to do.

SpecBAS is an advanced version of Sinclair BASIC from the Spectrum. I suggest you learn how to use that before you try SpecBAS - you'll not understand this advanced version until you understand the original.

Or you could read the manual. I know the manual is literally a list of commands and their syntax - and yes, the syntax for PRINT is outlined perfectly clearly -and I apologise that it's not as comprehensive as the Sinclair 48k Manual. But you could also read that manual and apply it to SpecBAS, for the most part.

Demos have always been at https://github.com/ZXDunny/SpecBAS-Demos so go have a look, or browse my youtube to see it in action: https://www.youtube.com/@ZXDunny/videos
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

We are talking bout Your free software and any, there's no business crunch here
Why the aggresive attitude from you ?
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

Calm Yourself :)
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

So PLOT br01 doesn't work ?
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

Paul - "Tell me you haven't read the manual without actually telling me you haven't read the manual :D"

Your manual is a collection of esoteric statements, No actual syntax examples, too dense to get

By the way I wrote Speccy basic big time, went to Z80 ASM, totally nailed, I do know programming
Dobsa007
Drutt
Posts: 24
Joined: Fri May 03, 2024 8:58 pm

Re: Enhanced ZX Speccy Emulator

Post by Dobsa007 »

Printing a bitmap ?, How would I know the syntax, Yes there is nothing like that in Speccy Basic, how would I know the syntax in Specbas, It's a myriad of confusing snippets of obtuse writings
User avatar
ZXDunny
Manic Miner
Posts: 509
Joined: Tue Nov 14, 2017 3:45 pm

Re: Enhanced ZX Speccy Emulator

Post by ZXDunny »

Why on earth would you think that you can "PLOT br01" - where in the manual does it say you can do that?

Here's the entry for PLOT:

PLOT [colour-item;...] {x,y|array()} [;...]

I mean, that's pretty clear. You can insert colour items - the same as you can for the speccy - then you use a separator (";") and then either x,y - the same as the speccy - or an array variable followed by ()s. You can then use a ";" and repeat it.

Where did you get the idea that "PLOT numvar" would be ... at all accepted? Can you explain that, at least?

I'd have thought that anyone who is as advanced with Sinclair BASIC and z80 asm would have a pretty good handle on this sort of thing.
Mcoder2
Drutt
Posts: 15
Joined: Tue Feb 27, 2024 11:42 am

Re: Enhanced ZX Speccy Emulator

Post by Mcoder2 »

ZXDunny wrote: Tue Jun 04, 2024 11:43 pmAnd it's written in Delphi, so FPC/Lazarus would likely handle it just fine.

You can see what it can do here: https://www.youtube.com/@ZXDunny/videos
The boing ball and "Shadow of the Beast": Absolutely amazing!
So you can write state-of-the-art Amiga-style games in BASIC with this!

(Pascal and Windows are a bit of a drawback for me, though. But good job!)
Last edited by Mcoder2 on Fri Jun 07, 2024 12:04 am, edited 1 time in total.
User avatar
ZXDunny
Manic Miner
Posts: 509
Joined: Tue Nov 14, 2017 3:45 pm

Re: Enhanced ZX Speccy Emulator

Post by ZXDunny »

Mcoder2 wrote: Fri Jun 07, 2024 12:01 am The boing ball and "Shadow of the Beast": Absolutely amazing!
So you can write Amiga-style games in BASIC with this!

(Pascal and Windows are a bit of a drawback for me, though. But good job!)
Thanks :)

It's just Sinclair BASIC with bells on, is all. The fact that it's running on a 2-3GHz CPU is what makes it possible - the simple mandelbrot demo takes 9 hours on the Spectrum, on SpecBAS it's literally seconds. iirc someone did a test and it came out to the equivalent of a 9GHz speccy :)
catmeows
Manic Miner
Posts: 721
Joined: Tue May 28, 2019 12:02 pm
Location: Prague

Re: Enhanced ZX Speccy (Alike system?)

Post by catmeows »

ParadigmShifter wrote: Sun May 26, 2024 9:02 pm If you up the CPU speed you may as well improve the CPU too though really.

Z80 is the nicest (and easiest IMO) 8-bit CPU to code for in ASM though I think, but Z80 has some issues.

* Non orthogonal instruction set i.e. you can't do same with all registers. You'd want an ADD B, C instead of only being able to add to A.
* Wants a barrel shifter so you can shift and roll more than 1 bit at a time so SRL B, 2 to shift B down by 2. Also you want 16 bit shifts and rolls.
* You may as well throw in 8 and 16 bit multiply (probably have to make those non orthogonal of course since not many registers). And then you may as well add in a DIV as well as a MUL
* I know Ketmar wants EX SP, SP' which makes sense too
* I'd want PowerPC style instructions where you don't have to set the flags if you don't want
* Register autoincrement and decrement option (don't really need SP then either, can use any register as a stack), like 68000 had. Don't need LDI either then. Handle LDIR with a REPT prefix code like x86 maybe?
* Ability to load flags register with whatever you want to help out with stack abuse 16 bit reads/writes
* Hardware breakpoint instruction
* Obviously the default interrupt vector should be writable too (like on Amstrad I think?) so you aren't stuck with the ROM default IRQ.
* Multiple PUSH/POP maybe like ARM does? ARM allows you to push/pop several registers at once with one instruction.
* Atomic exchange any 8 or 16 bit register with another.
6809 has half of that and 68HC16 has probably everything. 6309 is somewhere between. Really, if you look on "modern" designs with 8bit data bus there is little if anything to improve.
The only exercise left is to either cut down features to minimize transistor count to be around 10K (Z80 has 8K, 6502 has 6K) to make your cpu feel little bit authentic and organize ISA to squeeze maximum from narrow data path (as modern beefed designs really don't care as they are supposed to use fast static rams).

Same issue is with graphic system, if you want something in fashion of home computer you will not get anything better than CPC has because of memory bandwitdth. All early consoles like NES or Sega Master system had to use sideway RAM for graphics because video would consume all memory bandwidth otherwise (even C64 cheats little bit with VIC II using 12bit wide data bus and 4bit wide color ram). You can introduce something like display list with color pallete and memory pointer per pixel line as you can read few bytes during horizontal blanking but that it is. And you can easily read few more bytes for playback of samples but that it is. Any graphics of at least Atari ST quality really needs 16 bit data path or separate memory for video data.

And then you may as well add in an FPU stack too for floating point (it would probably want to be 32 bit floats rather than 40 bit floats Speccy uses though). If you are very bold allow floating point and integer instructions to be interleaved so it can do 2 instructions simultaneously if you do one of each (Pentium did that).
Well, while designing a simple 8 bit CPU can be funny way how to kill half year or so, designing coprocessor seems like next level. Though FP arithemtic would hugely benefit from barrel shift and 32 bit operations already.
Add some cache memory that is faster to access than normal memory either with a global page register (256 bytes of 256 byte aligned memory anywhere) or like what 6502 does with its zero page addressing.
These zero pages are just simplified index registers, add fast indexed addressing mode and you really don't need them.
One thing I really like on 6809 are its indexing regs. It can index X,Y,U and S(tack) with modes like [R] , [R+5 signed bits], [R+8 bits], [R+16bits], [R post increment], [R post increment by 2], [R predecrement], [R predecrement by two], [R+8bit acumulator] and [R+16bit acumulator]. You don't really need more (well, 68HC16 has [R postincrement/predecrement by 3 bit value] ).
And three index registers seems to be enough for most of time.
And yes, 6809 has direct page (256 bytes) selected by DP register anywhere in 64K (To be honest, it has to, because it has just two 8 bit acummulators that act also like one 16 bit acumulator. IMHO, design with separate 8 bit acc and separate 16 bit acc would be better).

On other side, what I really like on Z80 is that it allows artificially concate its registers to form 32 bits registers - ADD IX,BC; ADC HL,DE to add 32 bits, rotate B,C,D,E to shift 32 bits.
Proud owner of Didaktik M
User avatar
arjun
Microbot
Posts: 170
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: Enhanced ZX Speccy Emulator

Post by arjun »

Dobsa007 wrote: Thu Jun 06, 2024 9:39 pm Calm Yourself :)
Proceeds to post 5 aggressive posts, back to back, with some absolute drivel. An absolute master like you at BASIC or Z80 ASM should have been able to figure out some of the stuff from the examples that Dunny posted, if the manual wasn't working for you.

Remember, this is one guy writing all this stuff from his bedroom (figuratively speaking) out of love for the speccy and coding. Show some respect and drop the attitude.
Post Reply