News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Spectrum emulator

Started by baggey, August 18, 2012, 12:47:16 PM

Previous topic - Next topic

baggey

Heres one of the first images of the playbasic spectrum emulator

Written by Lee chatt with lots of help learning the PLAYBASIC language, from the GURU himself "kevin picone"



Jesus was only famous because of his dad

buggage

I really like what I see (and the whole idea), but the ZX Spectrum could only display two colours in any given 8x8character cell. What are we actually seeing in this image?

BlinkOk

nice one lee. i look forward to giving it a try

kevin

#3
 
 It's a pretty 'out there' sort of usage really, so kudos for setting such an ambitious task.   The UI stuff seems to be coming along pretty well, can't help wondering just how the 'core' is progressing though.



baggey

Quote from: buggage on August 18, 2012, 04:00:32 PM
I really like what I see (and the whole idea), but the ZX Spectrum could only display two colours in any given 8x8character cell. What are we actually seeing in this image?

The speccy does only display 2 colours! this is just a start up screen, were all 49152 pixels are being plotted.

Baggey
Jesus was only famous because of his dad

baggey

Quote from: kevin on August 19, 2012, 01:07:02 AM

  It's pretty 'out there' usage really, so kudos for setting such an ambitious task.   The UI stuff seems to be coming along pretty well, can't help wondering just how the 'core' is progressing though.




Hi kevin,

There's still some work to do on the display yet!

Most of all the code for registers, addressed registers, flags and index registers are setup thou!

Its going to be a long process typing in the menomics thou! As will have the 255 instructions to setup and then there will be the ones were will index to more menomics!
Ill use the gosub idea seeming its quicker than case statements! to select them.

The blank areas will display the op'codes etc as the program is running!
The top area will display the Registers and Flags at the present program counter position!

Soon im going to learn how to load in a ".scr" file and display it! might use this as a feature were you scroll through the ".scr's". Where you can load the game!
Im also going to need to learn how to load in a "snapshot" and pull the relevant header code to set everything up and then fill the emulated memory bank!
This can then start the z80 emulation progress etc!

Im a fair way, away yet!

Oh what does "kudos" mean!?

Baggey
Jesus was only famous because of his dad

micky4fun

Hi all

very interesting project , way over my head ,but good luck with this and look forward to it when up and running
kudos "acclaim or praise for exceptional achievement"

mick :)

buggage

QuoteSoon im going to learn how to load in a ".scr" file and display it! might use this as a feature were you scroll through the ".scr's". Where you can load the game!
...
...
This can then start the z80 emulation progress etc!
Cool. Can't wait to see this in action :)


kevin

 
Quote
Its going to be a long process typing in the menomics thou! As will have the 255 instructions to setup and then there will be the ones were will index to more menomics!

  You probably won't need all 256, as not all of them will be executable instructions.  I wouldn't be too surprised if you couldn't set up a table and then generate the entire instruction 'decoder' source code from the data sheet.  Much the same way the pixel plotter routine worked the other day.   
     
Quote
The blank areas will display the op'codes etc as the program is running!
The top area will display the Registers and Flags at the present program counter position!

   Writing monitor/disassembler is essential, but not sure why you want to try and render the code from the current program count.  If you do this every instruction that's a massive overhead.   It make sense to have a 'pause' or step mode to check the state, even some type of break point mode, for debugging when programs won't run.



Quote
Soon im going to learn how to load in a ".scr" file and display it! might use this as a feature were you scroll through the ".scr's". Where you can load the game!
Im also going to need to learn how to load in a "snapshot" and pull the relevant header code to set everything up and then fill the emulated memory bank!
This can then start the z80 emulation progress etc!

    Seriously,  I'd be focusing purely on the z80 emulation.   One approach i've used in the past, is to use a cross assembler to generate some absolute addressed executable code, then try executing on the my core and the real hardware / emulator.  Which is pretty tedious, but a good way to isolate issues on a one to one basis.   Trying to run a complete game upfront, just isn't going to happen.     





     

LemonWizard

Interesting project!!!!!! KUDOS FOR SURE I hope you keep working on this.

I"m actually developing an interest in writing emulators myself and seeing one work in playbasic is great... it gives me hope hehe. For playbasic to be even better (and more useful)

Now all we need to do is write an snes assembly reader/runner (A very basic one) and instead of completely re coding the dkc2 game engine I can use parts of the original through snes core emulation (that'd be... so tedious) hehe Just wishful thinking.
AND if you know your stuff you'd know that the zx80 (I think that's what you're trying to recode) Would actually be the same as the modified gameboy chip (the original)

The nintendo gameboy had a slightly modified z80 chip in it.

And if it isn't a z80, then  the zx spectrum emulator core could be changed/ported into a z80 core. AND THEN slightly modified to allow the running of a gameboy emulator.

baggey

Here's a second screenshot for my Speccy emulator! Which as you can see is progressing along nicely!

loading scr's is proving a little difficult as im trying to build 5 images rotating to be selected if you wish to play particular game.
When this is successful, i will upload an exe of the working progress so far!




Jesus was only famous because of his dad

baggey

Well here we go with another update  :D

Loading the scr's has proved more difficult than i thought. If anyone remembers how the spectrum screen was loaded?

That was strange enough!
So after much trial and error with the calc's for screen buffer replication, attribute replication and not to mention some of the look up tables etc, etc needed.

Here is a loaded scr of the very first game i owned!



Jesus was only famous because of his dad

ATLUS


baggey

Thanks!

Its going to be a few weeks before anymore as im going on holiday!  :D

Heres another for now.

Jesus was only famous because of his dad

kevin

#14
 
 It's looking pretty good, but what is actually running ?  I ask, as there seems to be a some mock up in the pictures.  So you've started the Z80 core ?


QuoteLoading the scr's has proved more difficult than i thought. If anyone remembers how the spectrum screen was loaded?

  So I take it spectrum programs (for emulation) are is stored in some type of hunk based data image where there's a screen shot in it ?    Got a link to some examples ?


 Spectrum,

  TAP- and BLK tape format

  TZX FORMAT

  SPECCY EMULATOR FILE FORMATS