Page 4 of 7

Re: ZX81X2.ROM - and the big bang

Posted: Thu Nov 08, 2018 9:55 am
by siggi
I have now installed that new rom (a little bit "patched" for LOAD/SAVE using MEFISDOS drives) in 4 of my Zeddies. Even my C programs, compiled using Z88DK, now run much faster, because they also call the new and fast rom CLS routine :mrgreen:

Thanks for that great rom
Siggi

Re: ZX81X2.ROM - and the big bang

Posted: Thu Nov 08, 2018 5:00 pm
by zsolt
Hi,

I have made some changes in the 'series generator' routine.

In the 1st round of the generator loop the operands (and the results too) were zeros.
The improved version skips this 1st round, so saves some times:

Code: Select all

;
; The initialization phase.
;
	.db $3A		;;mul-by-2		2*x

	DEFB $C0	;;st-mem-0		2*x
	DEFB $02	;;delete		.
	DEFB $A0	;;stk-zero		0

;;-	DEFB $C2	;;st-mem-2		0

	.db $C1		;;st-mem-1		0

	.db $2D		;;duplicate		0,0.

	.db $2F		;;jump
	.db G_LOOP1-$	;;to G-LOOP1	- skip the 1st round
;
; a loop is now entered to perform the algebraic calculation for each of
; the numbers in the series
;
G_LOOP
	DEFB $2D	;;duplicate		v,v.			(old round 1: 0,0)
	DEFB $E0	;;get-mem-0		v,v,2*x			(old round 1: 0,0,2x)
	DEFB $04	;;multiply		v,v*2*x			(old round 1: 0,0)
	DEFB $E2	;;get-mem-2		v,v*2*x,v		(old round 1: 0,0,0)
	DEFB $C1	;;st-mem-1		v,v*2*x,v		(old round 1: 0,0,0)
	DEFB $03	;;subtract		v,v*2*x-v		(old round 1: 0,0)
G_LOOP1
	DEFB $34	;;end-calc
;
; the previous pointer is fetched from the machine stack to H'L' where it
; addresses one of the numbers of the series following the series literal.
;
	CALL stk_data		; routine STK-DATA is called directly to
				; push a value and advance H'L'.

	CALL GEN_ENT2		; routine GEN-ENT-2 recursively re-enters
				; the calculator without disturbing
				; system variable BREG
				; H'L' value goes on the machine stack and is
				; then loaded as usual with the next address.

	DEFB $0F	;;addition
	DEFB $01	;;exchange
	DEFB $C2	;;st-mem-2
	DEFB $02	;;delete

	DEFB $31	;;dec-jr-nz
	DEFB G_LOOP-$	;;back to G-LOOP
;
zx81x2b_test.png
You can find the renewed ROM image (and the source) at the end of the first post of this topic.
Regards,
Zsolt

Re: ZX81X2.ROM - and the big bang: compatibility problem?

Posted: Tue May 14, 2019 10:20 am
by siggi
Hi
there seems to be a problem: this file contains in variable A$ the source code for an assembler file (for ASDIS). The basic program contains only REM.
If the program is loaded e. g. by EO and ZX81.rom and I press RETURN, the listing is written to screen and the Zeddy is alive.
If the program is loaded by EO and ZX81x2.rom and I press RETURN, the listing is written very very slowly to screen, additional blank lines are written to screen and the Zeddy freezes.

Any ideas what goes wrong?

Siggi
M64KP1B.P
(11.88 KiB) Downloaded 560 times

Re: ZX81X2.ROM - and the big bang

Posted: Tue May 14, 2019 8:24 pm
by Joachim
Hi Zsolt!
I have the same problems as siggi. I can add the following informations:
The first line stays allways on top. Even a CLS-command cann't clean it. The second line is also currupted. Please the pictures.
P1090259.JPG
P1090258.JPG

On the first photograph you can see how the lines are wrong placed. On the second the second line is normaly filled. Now in the third line is the contend of the second line and so on.

Re: ZX81X2.ROM - and the big bang

Posted: Tue May 14, 2019 9:26 pm
by zsolt
Dear Siggi and Joachim,

Did you know that the d-file of your program is longer than should be? :o
It contains 32 extra bytes after the latest N/L character in front of the beginning of the variables.

Sysvar D_FILE ($400C) points $40F3, and the VARS ($4010) points $442C.
The difference is $0339 (825 dec) instead of $0319 (793 dec)
It causes the problem. :cry:

Regards,
Zsolt

Re: ZX81X2.ROM - and the big bang

Posted: Wed May 15, 2019 10:32 pm
by Joachim
Thanks a lot for the informations, Zsolt.
This means, ASDIS - our assemblerprogram - could have a bug. Do You have an explanation, why this phenomenon dont't show up with the original ZX81-ROM?
Best regards!
Joachim

Re: ZX81X2.ROM - and the big bang

Posted: Wed May 22, 2019 4:26 pm
by zsolt
Sorry for this long silence - I was on a (very) long weekend in Barcelona. :D

The original CLS (more exactly the LOC-ADDR) routine uses the sv. VARS as a pointer, from which it is searching and counting backward the N/L characters (24+1) to get exact line address. So it skips those 32 extra bytes.
Then it prints 24x32 (768) "space" characters to clear the screen using routine PRINT-SP.

The renewed routine assumes that VARS points to the first byte after the D-File. :|

HTH,
Zsolt

Re: ZX81X2.ROM - and the big bang

Posted: Fri Feb 14, 2020 7:36 pm
by Shaun_B
Technical question, is there any way that this could be included to run with the ZX81 emulator on the ZX Spectrum Next?

It looked like I could just switch one ROM image for another but on the ZX Next SD Card the ROM image is 32K.

Regards,

Shaun

Re: ZX81X2.ROM - and the big bang

Posted: Sat Feb 15, 2020 3:51 pm
by 1024MAK
Shaun_B wrote: Fri Feb 14, 2020 7:36 pm Technical question, is there any way that this could be included to run with the ZX81 emulator on the ZX Spectrum Next?

It looked like I could just switch one ROM image for another but on the ZX Next SD Card the ROM image is 32K.
I could maybe see why the Next may have a 16K byte ROM image (that’s the size of the ROM in the memory map), but not a 32K byte ROM image. Unless the ROM file is ZX Spectrum 128K / +2 sized. These machines use bank switching to swap between the top ‘half’ and the ‘bottom’ half of a physical 32K byte ROM chip.

Mark

Re: ZX81X2.ROM - and the big bang

Posted: Thu Mar 05, 2020 12:54 pm
by Shaun_B
1024MAK wrote: Sat Feb 15, 2020 3:51 pm I could maybe see why the Next may have a 16K byte ROM image (that’s the size of the ROM in the memory map), but not a 32K byte ROM image. Unless the ROM file is ZX Spectrum 128K / +2 sized. These machines use bank switching to swap between the top ‘half’ and the ‘bottom’ half of a physical 32K byte ROM chip.

Mark
The "Emulator ROM" might contain emulator code in there, that's my thinking.

Regards,

Shaun.