
;--- DEFINE VARIABLES ---
CH=57344
SCR=160*256
LEN=32
;-------------------
        Org 32768
START:
;JSR $6000
        LDA <TEXT
        STA 203
        LDA >TEXT
        STA 204
        JMP PROG
RET1:
        INC COUNT
        LDA COUNT
        CMP #LINES
        BNE PROG
        NOP
        NOP
        WaitKey
;-------------------
PROG:   LDA #LEN
        STA 209
        LDA <SCR
        STA 207
        STA DUM
        LDA >SCR
        STA 208
        STA DUM+1
        LDA <DLIST
        STA 560
        LDA >DLIST
        STA 561
;-----------------
GTEXT:  LDA <CH
        STA 205
        LDA >CH
        STA 206
        LDA #0
        STA RO
        LDY #0 ;GET CHAR
        LDA (203),Y
;        ASL A
;        ASL A
;        ASL A
        ROL RO
        ADC 205
        STA 205
        LDA 206
        LSR RO
        ADC #0
        STA 206
        INC 203
        BNE MAIN
        INC 204
;-------------------
MAIN:   LDY #0
        LDA (205),Y
        STA NUM
        JSR DECBIN
        INC 205
        BNE L50
        INC 206
L50:    JSR MOVE
        JSR WRITE
        DEC CNT2
        BNE MAIN
        LDA #8
        STA CNT2
        JSR RES
        DEC 209
        BNE GTEXT
        JMP SCROLL
;---------------------
WRITE:
        LDX #4
L51:    LDY #0
L52:    LDA NUM2,Y
        STA (207),Y
        INY
        CPY #8
        BNE L52
        INC 208
        DEX
        BNE L51
        RTS
;----------------------
MOVE:
        LDX #0
        LDY #0
L53:    LDA BYTES,X
        STA BYTES2,Y
        STA BYTES2+1,Y
        STA BYTES2+2,Y
        STA BYTES2+3,Y
        INX
        INY
        INY
        INY
        INY
        CPX #8
        BNE L53
; MOVING ROUTINE
        LDX #0
        LDY #0
L54:    LDA BYTES2,X
        STA BYTES3,Y
        INX
        INY
        INY
        CPX #32
        BNE L54
; MOVING ROUTINE
        LDX #0
L55:    LDY #0
L56:    LDA BYTES3,X
        STA BYTES,Y
        INX
        INY
        CPY #8
        BNE L56
        STX XDUM
        JSR BINDEC
        LDY CNT
        LDA NUM
        STA NUM2,Y
        INC CNT
        LDX XDUM
        CPX #64
        BNE L55
        LDA #0
        STA CNT
        RTS
;-----------------
DECBIN:
        LDX #0
L57:    LDA #0
        ASL NUM
        ADC #0
        STA BYTES,X
        INX
        CPX #8
        BNE L57
        RTS
;---------------------
BINDEC:
        LDX #0
L58:    LDA BYTES,X
;        LSR A
        ROL NUM
        INX
        CPX #8
        BNE L58
        RTS
;---------------------
RES:    LDA DUM
        CLC
        ADC #8
        STA DUM
        STA 207
        LDA DUM+1
        ADC #0
        STA DUM+1
        STA 208
        RTS
;---------------------
TEXT:    DB '  SHALOM TO EVERY ATARI FREAK,  '
 DB '  IS THIS A BIG SCROLL OR WHAT!  '
 DB '  IT WAS WRITTEN IN ISRAEL BY:  '
 DB '  THE ISRAEL ATARI CRAZY TEAM.  '
 DB '  ITS VERY TIREING TO READ IT,  '
 DB '  SO THIS TEXT WILL BE SHORT!.  '
 DB '  BIG SCROLLER WAS WRITTEN BY:  '
 DB '      EMLYN    AND   .......    '
 DB '  AND NOW FOR THE GREETNIX!:    '
 DB '    JOHN E.     ADRIAN GROVES   '
 DB '    RAY ROBERTSON    LUCIFER    '
 DB '   SPIKE    REDWING    RICKY    '
 DB '    BILL JACKSON     CARLOS     '
 DB '  ARNOLD BONTESMA    MORIS OZ   '
 DB '    GILL BUSIN    YARON PEER    '
 DB '  ALEX ZELENSKI ..............  '
 DB '  AND TO ALL WHO KNOW ME!!!     '
 DB '       BYE NOW....              '
LINES=18
BYTES:    DB '!!!!!!!!' ;!!!!!!!! SPECIAL CHARS !!!!!!!!
BYTES2:   DB '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' ;!!!!!!!! SPECIAL CHARS !!!!!!
BYTES3:   DB '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
NUM: DB 0
NUM2: DB 0,0,0,0,0,0,0,0
CNT: DB 0
CNT2: DB 8
XDUM: DB 0
DUM: DB 0,0
SC: DB 15
RO: DB 0
COUNT: DB 0
;SCROLL ROUTINE
SCROLL:
        LDA #7
        LDY <VBI
        LDX >VBI
        JSR $E45C
LI:     JMP LI
VBI:    DEC SC
        DEC SC
        DEC SC
        DEC SC
        DEC SC
        LDA SC
        STA $D404
        BPL L42
        JMP L41
L42:    JMP EXITVBI
L41:    LDA #10
        STA SC
        STA $D404
        INC LO1
        INC LO2
        INC LO3
        INC LO4
        INC LO5
        INC LO6
        INC LO7
        INC LO8
        INC LO9
        INC LO10
        INC LO11
        INC LO12
        INC LO13
        INC LO14
        INC LO15
        INC LO16
        INC LO17
        INC LO18
        INC LO19
        INC LO20
        INC LO21
        INC LO22
        INC LO23
        INC LO24
        INC LO25
        INC LO26
        INC LO27
        INC LO28
        INC LO29
        LDA LO29
        BNE EXITVBI
        LDA $07
        LDY $62
        LDX $E4
        JSR $E45C
        JMP RET1
EXITVBI: JMP $E462 ;exit VBI
;------------------
DLIST:
     DB 112,112
     DB 88
LO1:  DB 0
HI1:  DB 163
     DB 88
LO2: DB 0
HI2: DB 164
     DB 88
LO3: DB 0
HI3: DB 165
     DB 88
LO4: DB 0
HI4: DB 166
     DB 88
LO5: DB 0
HI5: DB 167
     DB 88
LO6: DB 0
HI6: DB 168
     DB 88
LO7: DB 0
HI7: DB 169
     DB 88
LO8: DB 0
HI8: DB 170
     DB 88
LO9: DB 0
HI9: DB 171
     DB 88
LO10: DB 0
HI10: DB 172
     DB 88
LO11: DB 0
HI11: DB 173
     DB 88
LO12: DB 0
HI12: DB 174
     DB 88
LO13: DB 0
HI13: DB 175
     DB 88
LO14: DB 0
HI14: DB 176
     DB 88
LO15: DB 0
HI15: DB 177
     DB 88
LO16: DB 0
HI16: DB 178
     DB 88
LO17: DB 0
HI17: DB 179
     DB 88
LO18: DB 0
HI18: DB 180
     DB 88
LO19: DB 0
HI19: DB 181
     DB 88
LO20: DB 0
HI20: DB 182
     DB 88
LO21: DB 0
HI21: DB 183
     DB 88
LO22: DB 0
HI22: DB 184
     DB 88
LO23: DB 0
HI23: DB 185
     DB 88
LO24: DB 0
HI24: DB 186
     DB 88
LO25: DB 0
HI25: DB 187
     DB 88
LO26: DB 0
HI26: DB 188
     DB 88
LO27: DB 0
HI27: DB 189
     DB 88
LO28:  DB 0
HI28:  DB 190
     DB 88
LO29: DB 0
HI29: DB 191
     DB 65
     DB A(DLIST)
    Org $02E2 	;INIT ADDRESS
     DB 0,128
