Page 2 of 8

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sun Dec 13, 2020 3:19 pm
by kokkiklhs
Well, last night I was thinking about what I asked and I decided to experiment a little by myself...
I ripped the 8k ROM file out of the emulator's TAP and replaced it with the fast ROM from zsolt...
Purple border after loading and the Spectrum (I used Spectaculator on the PC for the experiment, not a real machine) hanged...

Then I fired up a HEX editor and noticed that the ROM used in your emulator had a couple of altered bytes here and there (especially at the beginning), compared to the original Sinclair ROM and to zsolt's ROM. I changed these bytes to zsolt's ROM, according to the modifications that I found in your emulator's ROM but then I saw that there were also the particular mods made to some bytes by zsolt for speeding up, compared to the original ROM and the emulator's ROM... Not very easy for me, who didn't know where exactly to look and what to do.... :mrgreen:

At a certain point I managed to have a proper boot of the emulated Zeddy inside the Spectrum. Hooraaaay!!! (I thought so)... The simultaneous pressing of 1 and 0 keys gave me the menu, but... the Zeddy itself had no functioning keypresses at all, only the cursor was waiting at the bottom left of the screen and there I gave up, as my next try gave again a hanging screen with garbaged cursor...
Partial success, partial failure...
Anyway, I will be waiting for you to get your magic hands on it whenever you can... But I'd like to share this interesting experience of mine, even though it led to a non-working Zeddy, it was fun!!
:lol:

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sun Dec 13, 2020 7:15 pm
by dr beep
Problem is the intruptserviceroutine that is placed over part of the ROM, I need to check all changes.

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Tue Feb 02, 2021 3:48 pm
by dr beep
kokkiklhs wrote: Sat Dec 12, 2020 8:55 am Hmmm, I was recently reading this:
viewtopic.php?f=5&t=2986
Great improvements by zsolt here, excellent work...

My crazy thought to propose to dr.beep:
Could it be possible to build a separate version of your amazing SP-2-ZX81 emulator using this ROM? An original/improved ROM switching option to the already built emulator would consume another 8k of the precious 48k RAM, so it's most probably out of question...
I suspect that you may have already thought about it, or even tried to do it, but what would the result be, running on a REAL speccy?
:roll:
I have decided NOT to make a version with the altered ZX81 ROM.

The mainreason is that most optimizations in the ROM are found in speeding up routines.
My emulator must emulate all routines and the gain would be marginal.
To get speed in my emulator most used routines are translated to work in rewritten code on the ZX Spectrum.
Speed is gained from those rewritten routines. Small changes won't add more than I have now.

A part of my already translated routine:

Code: Select all

; -------------------------
; THE 'POINTERS' SUBROUTINE
; -------------------------
L09AD:  PUSH    AF              ;
        PUSH    HL              ;
        LD      HL,$400C        ; sv D_FILE_lo
        LD      A,$09           ;

;; NEXT-PTR
L09B4:  set 7,h
	LD      E,(HL)          ;
        INC     HL              ;
        LD      D,(HL)          ;
	res 7,h


I will however take a look on the ZX80-emulator since this is a whole new computer.

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sat Feb 06, 2021 12:53 pm
by kokkiklhs
dr beep wrote: Tue Feb 02, 2021 3:48 pm
I have decided NOT to make a version with the altered ZX81 ROM.

The mainreason is that most optimizations in the ROM are found in speeding up routines.
My emulator must emulate all routines and the gain would be marginal.
To get speed in my emulator most used routines are translated to work in rewritten code on the ZX Spectrum.
Speed is gained from those rewritten routines. Small changes won't add more than I have now.

I will however take a look on the ZX80-emulator since this is a whole new computer.
Well, this is quite reasonable, thanks for your time checking such an option! The ZX80 emulator will be gorgeous, that's for sure!!!

8-)

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sun Feb 28, 2021 11:46 am
by dr beep
Loading my latest game into my emulator reveilled a bug in opcode #31 : LD SP.NNNN

Now solved in v2.01

http://www.mediafire.com/file/dbox3vu1s ... 1.tap/file


P.S. The bugged screen on start is expected in the emulation on the ZX Spectrum.

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Tue Aug 10, 2021 8:56 am
by dr beep
Small bug fixed in v202

My games that use JP (HL) to end a screen had 1 moment where that didn't work. Now fixed.

Also added SHOGUN1K with a stackpointer fix for the emulator. The game will still run on a 1K ZX81 but on a larger ZX81 the SP is moved.

https://www.mediafire.com/file/h31z7slu ... 2.zip/file

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Wed Aug 11, 2021 11:26 pm
by Spinnetti
Cool stuff - you are definitely a Sinclair master!

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sun Apr 03, 2022 3:56 pm
by dr beep
New version 2.11 available.

2.10
added saving.

2.11
Better check on reading keyboard. Simplified reading returned false input when ZXPAND or KEMPSTON was read.
Now both interfaces are disabled. Only reading keyboard is allowed ( IN #nnFE ), check on #FE added
This fix allows 2PAXMAN to be played on the emulator (Screen update to 4 is best)

TAP-file as ZIP for this site
sp2zx-211.zip
(13.76 KiB) Downloaded 233 times

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sun Apr 24, 2022 7:12 pm
by dr beep
The memory is almost full but I was able to add IX-intrupt.

My game CALCULUS MAZXIMUS is using IX to do some lowres intrupts.
I was able to add this support in the v2.13 version.

I also altered the game itself and added a line where you can see which key matches the operands.
I also added 2 bytes which in the emulator will clear the screen when needed but on a zeddy or other emulator will have no effect. With perfect emulation the speed of my emulator would go done.
sp-2-zx81-v213-c.zip
(130.43 KiB) Downloaded 241 times
EDIT: corrected version for ZX81 keyboard display.

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

Posted: Sun Apr 24, 2022 7:56 pm
by dr beep
The demo sprite basic is working too.
You must skip the poking and running in 8k-16k.