SuperNova

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

SuperNova

Post by sirmorris »

Hiya

I'm thinking of a modified display routine that shows a 32 column view onto an arbitrarily wide memory buffer. I'd like to be able to scroll the display across the buffer horizontally at no processing cost.

The actual application I'm thinking of would be a continually scrolling game, in the scramble vein. If the display buffer was 120 columns wide then you'd specify (120-32) as the row modulo - a value which would be added to the base d-file pointer at the end of each line. So like this:

X = base d-file pointer
N = 120

0..........X----------------------+............................................N
N+1..........|----------------------|............................................2N

...etc.

None of the updated display routines I've seen do this - I'm wondering if there's a reason why?

Oh and while I'm at it I'd remove the dependency on the IY register :D

While I'm thinking about this - is there any information about the display routine that QS defender uses?
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: SuperNova

Post by Moggy »

Hi Sir Morris

You could I suppose wade through defenders code and see the relevence of the pokes on the inlay card that alter the display. A bit of "back coding" so to speak. I'm afraid I don't have the latin for it being one of lifes thickies!!!

The p file and inlay is here if you don't have it already.

Regards Moggy


http://www.zx81stuff.org.uk/zx81/genera ... nfo/q.html
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: SuperNova : simple scrolling asm code....

Post by XavSnap »

Hi.

Something like that ...

Code: Select all

;************************
;*    WILD-SCROLLING    *
;*      BY XAVSNAP      *
;************************

@DFILE=+16396
@KEYLOW=+16421
@KEYHI=+16422
@EXTERR=005B

; Picture REM Offset.
@PICOFF=412F

ORG +16514

@START
; 40h= 64 columns (+32 last screen display)
LD BC,0040
LD HL,PICOFF
LD (407B),HL

; RIGHT SCROLLING
; Save all register alternate registers (Af',DE',HL' ...)
EXX
LD DE,(DFILE); GET D-FILE
DEC DE
LD HL,(407B)
; Retrieve all old values
EXX

@SCRRET0
INC B
EXX
; Move HL screen to DE (Dfile) screen.
CALL DISP1

LD HL,(407B)
INC HL
LD (407B),HL
LD DE,(DFILE)
DEC DE
EXX
LD A,B
CP C
JR NZ SCRRET0

; LEFT SCROLLING
LD BC,0040

EXX

LD DE,(DFILE); GET D-FILE
DEC DE
 
LD HL,(407B)
EXX

@SCRRET3
INC B
EXX
CALL DISP1

LD HL,(407B)
DEC HL
LD (407B),HL
LD DE,(DFILE)
DEC DE
EXX
LD A,B
CP C
JR NZ SCRRET3

; Loop to start.
JR START

; Break the basic prg. and jump to the next line.
JP EXTERR

; Main display copy screen. HL to DE
; 24 lines x 32 characters.
@DISP1
LD A,18 
@SCRRET1
; if line 4 : display "Have Fun"
; to avoid blinkings. 
CP +15
CALL Z FUN2
INC DE 
INC DE
LD BC,001F 
; Copy HL to DE offset (31 characters)
LDIR

LD BC,+65
ADD HL,BC

DEC A 
JR NZ SCRRET1
; Test keyboard vvv ; if not = exit to basic.
LD A,(KEYHI)
CP FF
JP NZ EXTERR
RET

@FUN2
EXX
PUSH BC
LD HL,(DFILE)
LD BC,4B
ADD HL,BC
LD (HL),"h"
INC HL
INC HL
LD (HL),"A"
INC HL
INC HL
LD (HL),"V"
INC HL
INC HL
LD (HL),"E"
INC HL
INC HL
INC HL
INC HL
LD (HL),"f"
INC HL
INC HL
LD (HL),"U"
INC HL
INC HL      
LD (HL),"N"
POP BC
EXX
RET
Problems, the rem is heavy ... (only 32x3= 92columnsx24raws =2208 bytes)

You can also rewrite the Iy jump and display interupt, but it will slower and not easy to code/debug.

Have ...
Xav.
Attachments
Wild-Scroll.zip
Asm, res. and Basic.
(2.5 KiB) Downloaded 335 times
Wild-scr.p
My ASM demo using buffered scrolling...
(3.38 KiB) Downloaded 314 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: SuperNova

Post by sirmorris »

Moggy wrote:A bit of "back coding" so to speak.
Reverse engineering?

Or is that what you do in the supermarket car-park when you're not taking notice of the bollards? :lol:
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: SuperNova : simple scrolling asm code....

Post by sirmorris »

XavSnap wrote:Something like that ...
Hmm quite possibly! ;)

I'll have a closer look at this. Thanks Xav.
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: SuperNova

Post by XavSnap »

Hi,

I'm sorry!
A "Wild" cat isn't a "Wide" cat...

It's a WIDE scrolling !

ArrrFFF tsssss !

Have Fun !
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
wilf_zx
Posts: 18
Joined: Tue Jun 24, 2008 9:12 pm

Re: SuperNova

Post by wilf_zx »

For those not familiar with the NOVA variable display routine, NOVA displays the contents of a 34 columns wide by 240 rows high (typical) basic variable string array called the VFILE. The contents are displayed just like DFILE by using JP(HL) to the start character of the current VFILE, echo'd above 32K, and "executing" the CHR$ data in VFILE while forcing NOPs. The difference between DFILE and VFILE displays is that VFILE shows 34 characters per row, with 1 to 24 rows of characters on the screen and no N/L or other control characters are embedded in the VFILE.

Depending on the selection of the number of characters rows to be displayed, the program execution is up to 5x faster compared to the SLOW mode(pseudoFAST). Because VFILE is a string array, the most execellent Sinclair BASIC string variables functions can operate directly on the display file.

NOVA has no problem with scrolling vertically up/down the tall VFILE. Vertical scrolling occurs when multiples of 34 are added to or subtracted from the "start of VFILE" pointer which is used by JP(HL). A form of horizontal left/right character scrolling is available by incrementing or decrementing the start of VFILE pointer value The effect is similar to scrolling text by inserting or deleting characters at the beginning and end of the display.

True horizontal character scrolling is another matter.

It "may" be possible to write a NOVA type variable display routine that slides horizontally through a 256 columns wide (typical) x 24 rows high array of CHR$ codes by adjusting the origin of the JP(HL) along the top row of this extra wide DFILE. The Sinclair normal video, NOVA and most pseudo hires routines use INT Mode 1. The INT service routine adjust the JP(HL) pointer to jump back to the start of the same row (for 8 scan lines) or to the start of the next row. It must be rewritten so that it points the it uses INT Mode 2. In this Mode a INT generated at the end of the scan line calls the INT service routine using a vector pointed to by the I register (MSB) and FEh (LSB). If the I register is set to 40h, the IM2 service routine would be called via a vector stored at location 40FEh. The MSB of 40FEh is pointed to by I REG but the LSB is generated by the data bus pull up resistors with bit0 interpreted as always LOW. The value of the I register will need to be swapped back to 1Eh before the JP(HL) to fetch the video patterns from the ROM table. Just how that can be done is not yet clear to me. The method would be similar to that used by the very clever Xtricator HRG video routine.

Enjoy,

wilf
Last edited by wilf_zx on Tue Jul 29, 2008 5:04 am, edited 1 time in total.
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: SuperNova

Post by XavSnap »

Thanks Wilf !
... the Hrg G007... Memotech also use a mirrored Dfile...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply