Vertical full page fine text scroller

Page 1/3
| 2 | 3

By ARTRAG

Enlighted (6240)

ARTRAG's picture

09-09-2008, 12:26

To whom may interest.

The text is encoded in the section "text:"

Note:
Chars from A to Z are mapped twice, in the odd numbers from 0 to 51 and in the even numbers in the same range.
To make the effect work, each text line of the the message has to be repeated in two adjacent lines,
first encoded in the even chars, than in the odd chars.
Look at the sample line to have a clearer view of how it works.

PS
Tile set courtesy of C-BIOS Wink

softscroll:

; it expects screen 1 or better screen 2 hybrid mode

            xor    a
            out    (99h),a
            ld     a,64+20h
            out    (99h),a
            ld      bc,0x98
            ld      a,0xf1
1:          out    (0x98),a
            djnz    1b
1:          out    (0x98),a            
            djnz    1b
            

            exx 
            ld      bc,0    ; text line counter
            ld      de,0    ; pixel line counter            
            exx

            halt
            call    one_line
            call    one_pixel            

            exx 
            ld      bc,32    ; text line counter
            ld      de,00    ; pixel line counter            
            exx

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; outer loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

            ld      b,46
1:          push    bc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; inner loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            ld      b,8
2:          push    bc

            exx 
            inc e
            ld  a,e
            and 7
            ld e,a
            exx

            halt

            call   one_pixel

            pop bc
            djnz   2b
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;            

            call   one_line
            
            exx
    	    ld     hl,32
            add    hl,bc
    	    ld     c,l
    	    ld     b,h
    	    exx

            pop    bc
            djnz   1b
            ret                 ; endtext

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;            

one_pixel:  xor    a
            out    (99h),a
            ld     a,64
            out    (99h),a

            exx
            push   de
            exx
            
            pop    hl
            ld     bc,ASCII
            add    hl,bc

            ld     bc,16*26*256+98h
            otir
            otir

            ret



one_line:   xor    a
            out    (99h),a
            ld     a,64+18h
            out    (99h),a

            exx
            push    bc
            exx

            pop     bc
            ld      hl,text
            add     hl,bc

            ld     bc,3*256*256+98h
            otir            
            otir            
            otir                                    

            ret



text:                   ; PUT YOUR TEXT HERE
            rept 22
             db    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
            endm
       
            rept 6
             db    00,02,04,06,08,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,0xff,0xff,0xff,0xff,0xff,0xff
             db    01,03,05,07,09,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,0xff,0xff,0xff,0xff,0xff,0xff
             
             db    0xff,0xff,0xff,0xff,0xff,0xff,18,50,48,46,44,42,40,38,36,34,32,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50
             db    0xff,0xff,0xff,0xff,0xff,0xff,19,51,49,47,45,43,41,39,37,35,33,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51
            endm

            rept 22
             db    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
            endm



ASCII:
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x88,0xF8,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xE0,0x90,0xE0,0x90,0x88,0xF0,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x80,0x80,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF0,0x48,0x48,0x48,0x48,0xF0,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x80,0xE0,0x80,0x80,0xF8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x80,0x80,0xE0,0x80,0x80,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x80,0xB8,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0xF8,0x88,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x20,0x20,0x20,0x20,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x38,0x08,0x08,0x08,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x90,0xA0,0xE0,0x90,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x80,0x80,0x80,0x80,0x80,0xF8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xD8,0xA8,0xA8,0x88,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xC8,0xA8,0xA8,0x98,0x98,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF0,0x88,0x88,0xF0,0x80,0x80,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x88,0xA8,0x90,0x68,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF0,0x88,0x88,0xF0,0xA0,0x98,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x80,0x70,0x08,0x08,0xF0,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x20,0x20,0x20,0x20,0x20,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0x88,0x88,0x88,0x78,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0x88,0x50,0x50,0x20,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0xA8,0xA8,0xA8,0xD8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x50,0x20,0x50,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0x70,0x20,0x20,0x20,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x10,0x20,0x40,0x80,0xF8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    

Big smile

Login or register to post comments

By Salamander2

Expert (124)

Salamander2's picture

09-09-2008, 14:57

this one...could be done in basic?

By ARTRAG

Enlighted (6240)

ARTRAG's picture

09-09-2008, 15:05

Sure!
it is only matter of how long you want to wait....
Tongue
maybe with msxkun (turbobasic) it could be bearable

By Salamander2

Expert (124)

Salamander2's picture

09-09-2008, 15:34

i had trouble doing something a long ago without msxkun. the msx kun still is a trouble maker that i'm still want to avoid...

By ARTRAG

Enlighted (6240)

ARTRAG's picture

10-09-2008, 12:41

Slightly better version, same ideas
(use your own _checkkbd or skip that part)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; It expects screen 1 or screen 2 "hybrid" mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

softscroll:

            xor    a                      ; Tile colors
            out    (99h),a
            ld     a,64+20h
            out    (99h),a
            ld      bc,0x98
            ld      a,0xf1

1:          out    (0x98),a
            djnz    1b
1:          out    (0x98),a
            djnz    1b

                                         ; D = text line counter
            ld      de,0                 ; E = pixel counter

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; outer loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2:
             exx
             ld	        e,08h
             call	_checkkbd
             bit	0,l
             exx
             ret z                       ; exit if user press space
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; inner loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

1:          halt

            call   one_pixel

            ld     a,e
            inc    a
            and    7
            ld     e,a

            dec    a
            jr     nz,1b                 ; move the text of 8 pixels

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

            call   one_line

            inc    d

            ld     a,-24+(end_text-text)/32+1
            cp     d
            jr     nz,2b

            ret                          ; no more text to scroll

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

one_pixel:  xor    a
            out    (99h),a
            ld     a,64
            out    (99h),a

            ld     h,0
            ld     l,e

            ld     bc,ASCII
            add    hl,bc

            ld     bc,16*26*256+98h

1:          call   _out
            jp     nz,1b
1:          call   _out
            jp     nz,1b

            ret

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

one_line:   xor    a
            out    (99h),a
            ld     a,64+18h
            out    (99h),a

            ld      h,0
            ld      l,d

            rept    5
             add     hl,hl
            endm

            ld      bc,text
            add     hl,bc

            ld      bc,3*256*256+98h

1:          call   _out
            jp     nz,1b
1:          call   _out
            jp     nz,1b
1:          call   _out
            jp     nz,1b

            ret

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_out:       rept 32
            outi
            endm
            ret


text:
            rept 24
            rept 32
             db    255
            endm
            endm

            rept 6
             db    00,02,04,06,08,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,0xff,0xff,0xff,0xff,0xff,0xff
             db    01,03,05,07,09,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,0xff,0xff,0xff,0xff,0xff,0xff

             db    0xff,0xff,0xff,0xff,0xff,0xff,18,50,48,46,44,42,40,38,36,34,32,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50
             db    0xff,0xff,0xff,0xff,0xff,0xff,19,51,49,47,45,43,41,39,37,35,33,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51
            endm

            rept 24
            rept 32
             db    255
            endm
            endm
end_text:


ASCII:
;A
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x88,0xF8,0x88,0x88,0x00,0x00
;B
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xE0,0x90,0xE0,0x90,0x88,0xF0,0x00,0x00
;C
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x80,0x80,0x88,0x70,0x00,0x00
;etc.
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF0,0x48,0x48,0x48,0x48,0xF0,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x80,0xE0,0x80,0x80,0xF8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x80,0x80,0xE0,0x80,0x80,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x80,0xB8,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0xF8,0x88,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x20,0x20,0x20,0x20,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x38,0x08,0x08,0x08,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x90,0xA0,0xE0,0x90,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x80,0x80,0x80,0x80,0x80,0xF8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xD8,0xA8,0xA8,0x88,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xC8,0xA8,0xA8,0x98,0x98,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF0,0x88,0x88,0xF0,0x80,0x80,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x88,0x88,0xA8,0x90,0x68,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF0,0x88,0x88,0xF0,0xA0,0x98,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x70,0x80,0x70,0x08,0x08,0xF0,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x20,0x20,0x20,0x20,0x20,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0x88,0x88,0x88,0x78,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0x88,0x50,0x50,0x20,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0xA8,0xA8,0xA8,0xD8,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x50,0x20,0x50,0x88,0x88,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0x88,0x88,0x70,0x20,0x20,0x20,0x00,0x00
	db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	db 0xF8,0x10,0x20,0x40,0x80,0xF8,0x00,0x00

By Sdw

Resident (50)

Sdw's picture

16-10-2008, 13:42

Argh! I hadn't seen this post before, I thought I had a new cool invention with my smooth upscroller that is going to be featured in my forthcoming MSX demo! Tongue

Our implementations differs quite a bit though, but the idea with using every second line is the same.

By ARTRAG

Enlighted (6240)

ARTRAG's picture

16-10-2008, 19:10

Do not worry. Reinventing the wheel is quite common on msx.
It happens to me very often...

By Salamander2

Expert (124)

Salamander2's picture

17-10-2008, 11:03

wait this is for the msx1.

i'm looking for basic things using vdp(24) command.
msx1 is not my target.

By ARTRAG

Enlighted (6240)

ARTRAG's picture

17-10-2008, 12:34

SDW look here also
http://msxgamesbox.com/karoshi/index.php?topic=1145.msg15494#new
I improved the code a bit IIRC

By ARTRAG

Enlighted (6240)

ARTRAG's picture

17-10-2008, 12:35

wait this is for the msx1.

i'm looking for basic things using vdp(24) command.
msx1 is not my target.

Just pace the text on the page and use vdp(24).....
no other things to do

By Hrothgar

Champion (479)

Hrothgar's picture

17-10-2008, 12:43

Artrag, in how far is this approach different from e.g. what Maze of Galious intro does? It's basically the same technique right?

Page 1/3
| 2 | 3