giga screen scroll with an headache

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
C.Born
Manic Miner
Posts: 231
Joined: Sat Dec 09, 2017 4:09 pm

giga screen scroll with an headache

Post by C.Born »

Hi

does some one has a STEADY horizontal pixel scroll?
mine works BUT line1-7 seems build before line 0 and that three times!
i dont have a cloud yet, here is the WIP listing for a double-screen right ward pixel scroll
with an headache and epileptic warning !! its a "depth" thing

Code: Select all

; giga screen 2 pixel for one scroll
; two screen$ rotate pixel by pixel simultanious
; needs a giga viewer for correct view

; rotaline038
; pasmo -d --tap --name rotalin037 rotaline038.asm rotal038.tap rotal038.symbol


mbank	    equ 23388        ; rambank configuration byte
ramPage     equ 32765        ; port to set switch with

            org 33000

            call setpage7    ;17t+tpage
   
scr0        ld hl,0          ;10t
            ld de,16384      ;10t
            ld bc,6144       ;10t
            ldir             ; 24*6144 -5

scr1        ld hl,0          ;10t
            ld de,49152      ;10t
            ld bc,6144       ;10t
            ldir             ; 24*6144 -5








            ld de,0x0808     ;10t
line_x      ld bc,0x1f       ;10t

setline     ld hl,0x4000     ;10t SCR0

            res 7,h          ; 8t scr0
            add hl,bc        ;11t end of pixel line
            ld a,(hl)        ; 7t last byte first line scr0
            and a            ; 4t reset flags
            sbc hl,bc        ;15t back to 16384

            ex af,af'        ; 4t scr1
            set 7,h          ; 8t SCR1  49152
            add hl,bc        ;11t end of pixel line
            ld a,(hl)        ; 7t last byte first line scr1
            and a            ; 4t reset flags
            sbc hl,bc        ;15t  back to 49152
            ex af,af'        ; 4t scr0
            ld b,0x20        ; 7t b=32
                             ;    hl=16384, de=49512
                             ;    a=scr0  , a'=scr1
rota0:      rra              ; 4t set scr0 start bit %7654321c >c
            ex af,af'        ; 4t go scr1
            rra              ; 4t set scr1 start bit %7654321c >c
rota_b:     ex af,af'        ; 4t back to scr0
            res 7,h          ; 8t go scr0
            rr (hl)          ;15t rotate scr0

            ex af,af'        ; 4t go scr1
            set 7,h          ; 8t go scr1
            rr (hl)          ;15t rotate scr1

            inc l            ; 4t
            djnz rota_b      ;13t rotate 32 bytes on 2 screens AT once



            ld hl,setline+2  ;10t
            inc (hl)         ; 7t
            dec e            ; 4t
            jr nz,dd0        ; 7t
            ret nz           ; 5t delay
deb0 equ 10+7+4+7+5

            ld e,8           ; 7t
hl2         ld (hl),0x40     ; 7t  7+7
            ld a,(setline+1) ;13t
            add a,0x20       ; 7t
            ld (setline+1),a ;13t
            dec d            ; 4t
            jr nz,dd1        ; 7t  13+7+13+4+12
            ret nz           ; 5t delay
deb1 equ 7+7+13+7+13+4+7+5


            ld d,8           ; 7t
            ld a,(hl2+1)     ;13t
            add a,d          ; 4t
            ld (hl2+1),a     ;13t
            cp 0x58          ; 7t
            jr c,dd2         ; 7t
            ret c            ; 5t delay
deb2 equ  7+13+4+13+7+7+5

            ld a,0x40        ; 7t
            ld (hl2+1),a     ;13t
            jr keys          ;12t
deb3    equ 7+13+12

bub3    equ deb3+deb2+deb1+deb0
bub2    equ      deb2+deb1+deb0
bub1    equ           deb1+deb0
bub0    equ                deb0

dubdel0 equ bub3-bub0           ;= delay 00097H  ; 151-88=63
dubdel1 equ bub3-bub1           ;= delay 00058H  ;  88-32=56
dubdel2 equ bub3-bub2           ;= delay 00020H  ;        32


dd0         res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            ld a,(hl)      ; 7t DELAY (8*7)+7=63

dd1         res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY 8*7=56

dd2         res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY
            res 0,a        ; 8t DELAY 8*4=32

keys        in a,(254)       ;11t
            cpl              ; 4t
            and 0x1f         ; 7t

key         jp z,line_x      ;10t
            ei               ; 4t

;-+-=-+-=_=-+-=-+-_-+
setpage0        ld hl,0xF000     ;10t h=11111000 l=00000000
                jr setpage       ;12t

setpage7        ld hl,0xF007     ;10t h=11110000 l=00001111
                jr setpage       ;12t delay

setpage         ld bc,ramPage    ;10t bc = 32765, port 0x7FFD
                ld de,mbank      ;10t de = 23388, sysvar

                LD   A,R         ; 9t P/V flag=Interrupt status  (Toni Baker et all)
                PUSH AF          ;11t Stack interrupt status.

                di               ; 4t
                ld a,(de)        ; 7t
                and h            ; 4t	set rambank 0  SCREEN 0
                or  l            ; 4t     set rambank 7
                ld (de),a        ; 7t
                out (c),a        ;12t     port 0x7FFD

                POP  de          ; 10t P/V flag=Former interrupt status.  (Toni Baker et all)
                bit 2,e          ;  8t FLAGregister = %SZ-H-PNC  po/pe =bit2
                                 ;    https://learn.cemetech.net/index.php/Z80:Flags_and_Bit-Level_Instructions#F_Register
                                 ;    https://clrhome.org/table/#jp
;                JP   PO,NONEI    ;10t Jump if interrupts were previously disabled.
                jr nz,NONEI      ;  7t
                ret nz           ;  5t delay
 
                EI               ;} 4t Re-enable interrupts.
                jr doei          ;} 12t

                                 ;] +5 jump
NONEI:          nop              ;] 4t    
                jr doei          ;]12t

doei            ret              ; 10t

tpage   equ 10+10 +9+11 +4 +7+4+4+7 +12+10+8 +(7+5) +(4+12) +10  ;=134

tsetp   equ 10+12+tpage          ;=152


;------------------------------------------------------------------------------
; 16384 = 0x4000h %01000000.00000000   , first pixel byte adres
; 22527 = 0x57ffh %01010111.11111111   ,  last pixel byte adres
;The display layout is easy to understand at the binary level:
;1. 16-bit Screen Memory Address in binary
;     010B BSSS LLLC CCCC (pixels)
;     BB = block (0-2) indicates top third, middle third or bottom third of screen
;     SSS = scan line (0-7) indicates the vertical pixel row within a character
;     LLL = vertical character line (0-7) within a block
;     CCCCC = horizontal character coordinate (0-31)
;2. 8-bit Pixel Coordinates
;     (0,0) top left corner of screen, Maarten down left corner
;     X : CCCC CTTT (0-255) >  CCCCCxxx  xxxxxTTT
;     Y : BBLL LSSS (0-191) >  BBxxxxxx  xxLLLxxx  xxxxxSSS
;     TTT is 0-7 and indicates the pixel position within a byte. 0=bit 7, most left pixel position %01234567 
;3. 8-bit Character Coordinates
;     X : 000C CCCC (0-31)
;     Y : 000B BLLL (0-23)
;4. 16-bit Attribute Address
;     0101 10BB LLLC CCCC
;------------------------------------------------------------------------------
User avatar
Bedazzle
Manic Miner
Posts: 305
Joined: Sun Mar 24, 2019 9:03 am

Re: giga screen scroll with an headache

Post by Bedazzle »

Maybe instead of

Code: Select all

scr1      ld hl,0          ;10t , 3 bytes
            ld de,49152  ;10t
            ld bc,6144    ;10t
            ldir             ; 24*6144 -5
try

Code: Select all

scr1      ld h,l          ;4t , 1 byte
            ld d,192      ;7t , 2 bytes
            ld b,24       ;7t , 2 bytes
            ldir             ; 24*6144 -5
Wall_Axe
Manic Miner
Posts: 500
Joined: Mon Nov 13, 2017 11:13 pm

Re: giga screen scroll with an headache

Post by Wall_Axe »

What is a giga viewer? Something on the spectrum next?
User avatar
PeterJ
Site Admin
Posts: 6879
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: giga screen scroll with an headache

Post by PeterJ »

@Wall_Axe,

Take a look under the interlace section:

https://en.m.wikipedia.org/wiki/ZX_Spec ... phic_modes
Wall_Axe
Manic Miner
Posts: 500
Joined: Mon Nov 13, 2017 11:13 pm

Re: giga screen scroll with an headache

Post by Wall_Axe »

Oh I see alternating the shadow screen,nice
C.Born
Manic Miner
Posts: 231
Joined: Sat Dec 09, 2017 4:09 pm

Re: giga screen scroll with an headache

Post by C.Born »

Wall_Axe wrote: Fri Oct 20, 2023 2:37 pm What is a giga viewer? Something on the spectrum next?
actualy its a hardware feature off the Timex and i made a simulator for it, its very cpu consuming so it wont be an emulator ever.
my version is a 193 scanflips per frame to reach the max blending. the idear it self is simple you just have to be tstate exact

my last version, which should be JR as much as possible
viewtopic.php?p=126897#p126897

my earlier version where i actualy do to much and its JP which is steady by it self


I solved part off the headache , its not IM2 at all, next step is fetching that codeblock i need for the gigascroll and place it inside "somewere"
probably 1 scanline per frame, very slow

this is just a horizontal scroll which i want to build in

Code: Select all

; giga screen 2 pixel for one scroll
; two screen$ rotate pixel by pixel simultanious
; needs a giga viewer for correct view

; rotaline050b
; pasmo -d --tap --name rotal050b rotaline050b.asm rotal050b.tap rotal050b.symbol


mbank	    equ 23388           ; rambank configuration byte
ramPage     equ 32765           ; port to set switch with

        org 33000

            call setpage7       ;17t+tpage

scr0        ld hl,0             ;10t
            ld de,16384         ;10t
            ld bc,6144          ;10t
            ldir                ; 24*6144 -5

scr1        ld hl,0             ;10t
            ld de,49152         ;10t
            ld bc,6144          ;10t
            ldir                ; 24*6144 -5


            ld de,0x0808        ;10t
line_x      ld bc,0x1f          ;10t

setline     ld hl,0x4000        ;10t SCR0

            add hl,bc           ;11t end of pixel line
            ld a,(hl)           ; 7t last byte first line scr0
            ex af,af'           ; 4t scr1
            set 7,h             ; 8t SCR1  49152
            ld a,(hl)           ; 7t last byte first line scr1
            ex af,af'           ; 4t go scr0
            res 7,h             ; 8t go scr0
            and a               ; 4t reset flags
            sbc hl,bc           ;15t back to 16384

            ld b,0x20           ; 7t b=32      d=8 e=8
                                ;    hl=16384
                                ;    a=scr0  , a'=scr1
rota0:      rra                 ; 4t set scr0 start bit %7654321c >c
            ex af,af'           ; 4t go scr1
            rra                 ; 4t set scr1 start bit %7654321c >c
rota_b:     ex af,af'           ; 4t back to scr0
            res 7,h             ; 8t go scr0
            rr (hl)             ;15t rotate scr0

            ex af,af'           ; 4t go scr1
            set 7,h             ; 8t go scr1
            rr (hl)             ;15t rotate scr1

            inc l               ; 4t
            djnz rota_b         ;13t rotate 32 bytes on 2 screens AT once

            ld hl,setline+2     ;10t
            inc (hl)            ; 7t
            dec e               ; 4t
            jr nz,dd0           ; 7t
            ret nz              ; 5t delay
deb0 equ 10+7+4+7+5

            ld e,8              ; 7t set counter
            ld a,(hl)           ; 7t
            sub e               ; 4t
hl2         ld (hl),a           ; 7t

            ld hl,setline+1     ;10t
            ld a,0x20           ; 7t
            add a,(hl)          ; 7t
            ld (hl),a           ; 7t  7b+31t

            dec d               ; 4t
            jr nz,dd1           ; 7t  13+7+13+4+12
            ret nz              ; 5t delay
deb1 equ 7+7 +10+7+7+7 +4+7+5

docounter   ld d,8              ; 7t set counter
;jr keys
            ld hl,setline+2     ;10t
            ld a,0x08           ; 7t
            add a,(hl)          ; 7t
            ld (hl),a           ; 7t  7b+31t

            cp 0x58             ; 7t
            jr c,dd2            ; 7t
            ret c               ; 5t delay
deb2 equ 7 +10+7+7+7+7+7+5

            ld (hl),0x40        ;10t
            jr keys             ;12t
deb3 equ 10+12

bub3    equ deb3+deb2+deb1+deb0  ;bub3 EQU 000B8H  ; 173
bub2    equ      deb2+deb1+deb0  ;bub2 EQU 00098H  ; 151
bub1    equ           deb1+deb0  ;bub1 EQU 00060H  ; 94
bub0    equ                deb0  ;bub0 EQU 00021H  ; 33


dubdel0 equ bub3-bub0            ;= delay 00097H  ; 140-79=61
dubdel1 equ bub3-bub1            ;= delay 00058H  ;  79-22=57
dubdel2 equ bub3-bub2            ;= delay 00020H  ;        22

;dubdel0		EQU 0008CH  ; 140
;dubdel1		EQU 0004FH  ; 79
;dubdel2		EQU 00016H  ; 22


dd0             res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                ld a,(hl)        ; 7t DELAY
                ld a,(hl)        ; 7t DELAY
                ld a,(hl)        ; 7t DELAY 5*8+3*7=61

dd1             res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                res 0,a          ; 8t DELAY
                ld a,r           ; 9t DELAY 8*6 + 9 =57

dd2             res 0,a          ; 8t DELAY
                ld a,(hl)        ; 7t DELAY
                ld a,(hl)        ; 7t DELAY 8 + 2*7 =22

keys            in a,(254)       ;11t
                cpl              ; 4t
                and 0x1f         ; 7t

key             jp z,line_x      ;10t
                ei               ; 4t

;-+-=-+-=_=-+-=-+-_-+
setpage0        ld hl,0xF000     ;10t h=11110000 l=00000000
                jr setpage       ;12t

setpage7        ld hl,0xF007     ;10t h=11110000 l=00001111
                jr setpage       ;12t delay

setpage         ld bc,ramPage    ;10t bc = 32765, port 0x7FFD
                ld de,mbank      ;10t de = 23388, sysvar

                LD   A,R         ; 9t P/V flag=Interrupt status  (Toni Baker et all)
                PUSH AF          ;11t Stack interrupt status.

                di               ; 4t
                ld a,(de)        ; 7t
                and h            ; 4t	set rambank 0  SCREEN 0
                or  l            ; 4t     set rambank 7
                ld (de),a        ; 7t
                out (c),a        ;12t     port 0x7FFD

                POP  de          ; 10t P/V flag=Former interrupt status.  (Toni Baker et all)
                bit 2,e          ;  8t FLAGregister = %SZ-H-PNC  po/pe =bit2
                                 ;    https://learn.cemetech.net/index.php/Z80:Flags_and_Bit-Level_Instructions#F_Register
                                 ;    https://clrhome.org/table/#jp
;                JP   PO,NONEI    ;10t Jump if interrupts were previously disabled.
                jr nz,NONEI      ;  7t

                ret nz           ;  5t delay
                EI               ;} 4t Re-enable interrupts.
                jr doei          ;} 12t

                                 ;] +5 jump
NONEI:          nop              ;] 4t delay against ei
                jr doei          ;]12t delay

doei            ret              ; 10t

tpage   equ 10+10 +9+11 +4 +7+4+4+7 +12+10+8 +(7+5) +(4+12) +10  ;=134

tsetp   equ 10+12+tpage          ;=152


;------------------------------------------------------------------------------
; 16384 = 0x4000h %01000000.00000000   , first pixel byte adres
; 22527 = 0x57ffh %01010111.11111111   ,  last pixel byte adres
;The display layout is easy to understand at the binary level:
;1. 16-bit Screen Memory Address in binary

;     010B BSSS LLLC CCCC (pixels)

;     BB = block (0-2) indicates top third, middle third or bottom third of screen
;     SSS = scan line (0-7) indicates the vertical pixel row within a character
;     LLL = vertical character line (0-7) within a block
;     CCCCC = horizontal character coordinate (0-31)
;2. 8-bit Pixel Coordinates
;     (0,0) top left corner of screen, Maarten down left corner
;     X : CCCC CTTT (0-255) >  CCCCCxxx  xxxxxTTT
;     Y : BBLL LSSS (0-191) >  BBxxxxxx  xxLLLxxx  xxxxxSSS
;     TTT is 0-7 and indicates the pixel position within a byte. 0=bit 7, most left pixel position %01234567 
;3. 8-bit Character Coordinates
;     X : 000C CCCC (0-31)
;     Y : 000B BLLL (0-23)
;4. 16-bit Attribute Address

;     0101 10BB LLLC CCCC

;------------------------------------------------------------------------------
Last edited by C.Born on Tue Oct 24, 2023 1:32 am, edited 1 time in total.
C.Born
Manic Miner
Posts: 231
Joined: Sat Dec 09, 2017 4:09 pm

Re: giga screen scroll with an headache

Post by C.Born »

PeterJ wrote: Fri Oct 20, 2023 2:40 pm @Wall_Axe,

Take a look under the interlace section:

https://en.m.wikipedia.org/wiki/ZX_Spec ... phic_modes
do you now where i can find that parrot ??
User avatar
PeterJ
Site Admin
Posts: 6879
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: giga screen scroll with an headache

Post by PeterJ »

I know @4thRock did some work on some related Wikipedia pages. Maybe he can help.
User avatar
HEXdidnt
Manic Miner
Posts: 224
Joined: Thu Mar 09, 2023 2:40 pm
Location: Harrow, London, UK
Contact:

Re: giga screen scroll with an headache

Post by HEXdidnt »

C.Born wrote: Tue Oct 24, 2023 1:29 am do you now where i can find that parrot ??
Pretty sure that image was part of a software package back in the 1990s, as I remember seeing it at work around that time, and it's used to present examples of colour depth all over the place these days.

Found this one via Reddit
...Dropping litter in the zen garden of your mind

The Hub of all things HEXdidn't... | HEXdidn't... on YouTube ...on ZXArt ...on deviantart
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: giga screen scroll with an headache

Post by 4thRock »

C.Born wrote: Tue Oct 24, 2023 1:29 am do you now where i can find that parrot ??
The original parrot is this one:
https://commons.wikimedia.org/wiki/File ... 750pix.jpg
C.Born
Manic Miner
Posts: 231
Joined: Sat Dec 09, 2017 4:09 pm

Re: giga screen scroll with an headache

Post by C.Born »

THANK YOU
wat een schoonheid

Image
Post Reply