Page 6 of 11
Re: SPeccy ON the ZeddY
Posted: Mon Jan 16, 2012 2:21 pm
by sirmorris
OK so here are the changes needed to run SPONZY on ZXpand.
1. solder jumper, wire or otherwise make a connection between pin 26 of the RAM and ROM chips.
2. change the memory controller GAL code to reflect the new memory map.
3. change the PIC firmware to make the ROMBK line an input rather than an output.
Sponzy should then run happily. If access to the SD card hardware were needed then some patches would have to be implemented in the ROM. There may be other changes required, e.g to the refsh/rd signalling, but all the above is easy.
I may well give this a try at some point though it won't be high on my to-do list because It's already super long.
C
Re: SPeccy ON the ZeddY
Posted: Sun Jan 22, 2012 10:56 am
by siggi
Hi Zsolt
today I installed the SPONZY8a ROM on my ZX81 Laptop and now all characters are displayed correctly (no missing pixel lines)
But it still flickers on the LCD display of my laptop (especially inverted characters). So the display timing is still a little bit different compared to the ZX81 rom.
Siggi
PS: We could perhaps use the Carry bit to indicate EOF: the readMMCbyte could set CY if the end of file is reached and the writeMMCbyte could be called with CY set to indicate to close the written file.
Edit: Here is the assembler source of the hires routine used by z88dk, which does not flicker. It is derived from Wilf Rigter's hires (WRX) and would probalby also work in SPONZY.
The original WRX (the at least the DEMO30 program) also flickers on my Laptop LCD, so the z88dk hires is better ...
Re: SPeccy ON the ZeddY
Posted: Sun Feb 05, 2012 12:52 pm
by zsolt
Hi Siggi,
siggi wrote:...the display timing is still a little bit different compared to the ZX81 rom.
Yes, it had 3 main difference: the top/bottom margins, scanlines/frame and the length of the VSYNC.
Code: Select all
ZX81 ROM SPONZY
margins bottom=top bottom=top+2
scanlines/frame 309 314
VSYNC in TS 1233 1410 (measured with EO)
I modded a litle bit: now the 2 margins are same.
I built 3 versions of SPONZY: with 314 scanlines (SPONZY default), with 312 scanlines (PAL standard) and a 310 scanlines/frame variant (nearest to original ZX81).
I tried to reduce also the longer VSYNC time, but no measurable results - don't forget: during this time in Speccy the keyboard is completly decoded (with repeat and delay), and sysvar. LAST-K holds the code of newly pressed key.
(if your display driver is sensitive to this longer VSYNC, we are in trouble )
In the attachment you find also the source code of the display routines.
Zsolt
EDIT: the attachment was removed. Here is the final version of SPONZY
Re: SPeccy ON the ZeddY
Posted: Sun Feb 05, 2012 3:41 pm
by siggi
Hi ZSOLT
I testet the versions with 310 and 312 lines and both versions still flicker and some lines (see character "E")are missing:
310 lines:
- 310_640x480.JPG (93.52 KiB) Viewed 4680 times
312 lines:
- 312_640x480.jpg (94.41 KiB) Viewed 4680 times
The flickering problem with Z88DK was solved, after some additional PUSH/POPS/LD after label "L023E:" were removed (the 3 ";"-prefixed statements around the call to keyboard scan routine "call $2BB").
AFAIK that IS during the sync pulse, which starts during keyboard scan and is stopped with the last line "OUT ($FF),a"
Z88DK display routine:
Code: Select all
;; DISPLAY-2
L023E:
; push ix ; Siggi - No point to preserve iy here !!
; ld ix,16384
CALL $2BB ; routine KEYBOARD
; pop ix
LD BC,($4025) ; sv LAST_K
LD ($4025),HL ; sv LAST_K
LD A,B ;
ADD A,$02 ;
SBC HL,BC ;
LD A,($4027) ; sv DEBOUNCE
OR H ;
OR L ;
LD E,B ;
LD B,$0B ;
LD HL,$403B ; system variable CDFLAG
RES 0,(HL) ;
JR NZ,L0264 ; to NO-KEY
BIT 7,(HL) ;
SET 0,(HL) ;
RET Z ;
DEC B ;
NOP ;
SCF ; Set Carry Flag
;; NO-KEY
L0264: LD HL,$4027 ; sv DEBOUNCE
CCF ; Complement Carry Flag
RL B ;
;; LOOP-B
L026A: DJNZ L026A ; to LOOP-B
LD B,(HL) ;
LD A,E ;
CP $FE ;
SBC A,A ;
LD B,$1F ;
OR (HL) ;
AND B ;
RRA ;
LD (HL),A ;
OUT ($FF),A ;
Siggi
Re: SPeccy ON the ZeddY
Posted: Mon Feb 06, 2012 10:31 am
by siggi
zsolt wrote:
(if your display driver is sensitive to this longer VSYNC, we are in trouble )
Hi ZSOLT,
just an idea: perhaps you could move some of the addinional code (making the VSYNC pulse longer) behind the "out ($FF)" terminating the sync pulse?
That code would than be executed after VSYNC (within the upper border and NMI enabled), but the sync pulse would have its original duration ...
Siggi
Re: SPeccy ON the ZeddY
Posted: Tue Feb 07, 2012 12:04 pm
by zsolt
siggi wrote:The flickering problem with Z88DK was solved, after some additional PUSH/POPS/LD after label "L023E:" were removed
I recalculated the the timings of your code and understand now what you mean. Removing these commands the VSYNC now starts before the HSYNC.
Previously it was reverse: the VSYNC started directly after the HSYNC and this caused the flickering display.
siggi wrote:just an idea: perhaps you could move some of the addinional code (making the VSYNC pulse longer) behind the "out ($FF)" terminating the sync pulse?
I will try.
Regards
Zsolt
Re: SPeccy ON the ZeddY
Posted: Sun Feb 12, 2012 10:40 am
by zsolt
Hi Siggi,
Here is the next mod. The VSYNC starts during the last HSYNC (if my calculations are correct) and the length of VSYNC is also decreased (saving ~70TS). Try it pls,
Zsolt
EDIT: the attachment was removed. Here is the final version of SPONZY
Re: SPeccy ON the ZeddY
Posted: Sun Feb 12, 2012 7:10 pm
by siggi
Hi ZSOLT
I testet the 310 and 312 line versions. Both show simlilar effects:
Flickering: much much better that ever. Nearly perfect (only a little bit jitter is visible)
Both versions show a dark (not black, more grey) line at the bottom.
And there are again some pixel lines missing (see character E and F).
310 lines:
- 310_640x480.JPG (97.66 KiB) Viewed 4528 times
312 lines
- 312_640x480.JPG (103.68 KiB) Viewed 4528 times
(the old Sponzy8a version did show all characters correctly).
Siggi
Re: SPeccy ON the ZeddY
Posted: Sun Feb 12, 2012 7:55 pm
by siggi
I also tested the 314 lines: same as above, but the missing pixel lines are now at character "G" (not E or F).
And the display jitters a little bit more ..
Siggi
Re: SPeccy ON the ZeddY
Posted: Sun Feb 12, 2012 9:29 pm
by zsolt