; Multi Scroll V2.1 ; 9/6/95 ; Now handles proportional fonts scrtab: equ 46080-512 screen: equ 16384 org 40000 call finit ld ix,flp1da call scrint call ploter end1: halt ld a,(ix+7) ld (flags),a call erase inc (ix+9) call ploter call scroll call 654 ld a,e cp 32 ret z jp end1 finit: ld hl,15616 ld de,42000 ld (font),de ld b,96 finit1: push bc ld a,255 ld (de),a inc de ld a,0 ld (de),a inc de ld bc,8 ldir ld a,0 ld (de),a inc de ld a,255 ld (de),a inc de pop bc djnz finit1 ret scrint: ld hl,scrtab ld de,16384 ld b,192 scrin1: ld (hl),e inc h ld (hl),d dec h inc l call drow djnz scrin1 ld (ix+0),1 ld l,(ix+3) ld h,(ix+4) ld (ix+1),l ld (ix+2),h ret ;Flags bit 0=normal/FLP (FSLP) ; bit 1=FLP/FSLP ; bit 2=clear/take from bak ; bit 3=inverse/not ; bit 4=normal/or ; (reset/set) flp1da: db 1 ;bit dw text1 ;text count dw text1 ;text reset db 1 ;speed db 0 ;pause time db 00001101b ;flags db 30 ;width db 0 ;sine lb db 180 ;sine hb db 8 ;x posn db 96 ;y posn dw backst ;store add db 1 ;step db 0 ;screen pat db 12 ;height ds 31*12,0 backst: ds 31*12,0 scrini: ld a,(ix+3) ld (ix+1),a ld a,(ix+4) ld (ix+2),a ld a,1 ld (ix+0),a ret scroll: ld a,(ix+6) and a jp z,scroin dec (ix+6) ret scroin: ld b,(ix+5) scro1: push bc call scro pop bc djnz scro1 ld a,(flags) ld (ix+7),a ret scro: dec (ix+0) jp nz,scrin cher1: ld h,(ix+2) ld l,(ix+1) cherbk: inc hl cher2: ld (ix+1),l ld (ix+2),h ld a,(hl) cp 123 jp c,ischar cp 255 jp z,eoftex sub 123 add a,a ex de,hl ld l,a ld h,0 ld bc,sjtab add hl,bc ld a,(hl) inc hl ld h,(hl) ld l,a call cjump ex de,hl jp cherbk cjump: jp (hl) sjtab: dw speed,pause,flagst dw yposn ;Speed Control speed: inc de ld a,(de) sub 48 ld (ix+5),a ret ;Pause Time pause: inc de ld a,(de) sub 49 ld l,a ld h,0 ld bc,ptab add hl,bc ld a,(hl) ld (ix+6),a ret ptab: db 50,100,150,200,250 ;Change Flags flagst: inc de ld a,(de) sub 49 add a,a ld l,a ld h,0 ld bc,ftab add hl,bc ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(flags) call cjump ld (flags),a ret ftab: dw flag1,flag2,flag3 dw flag4,flag5,flag6 dw flag7,flag8 flag1: res 0,a ret flag2: set 1,a ret flag3: res 1,a ret flag4: set 1,a ret flag5: res 2,a ret flag6: set 2,a ret flag7: res 3,a ret flag8: set 3,a ret ;Y Position yposn: inc de ld a,(de) sub 64 sla a sla a sla a ld (ix+12),a ret eoftex: ld l,(ix+3) ld h,(ix+4) jp cher2 ;Got a valid character, now get ;width... ischar: ld l,a ld h,0 ld de,propta add hl,de ld l,(hl) ld (ix+0),l db 221 ld c,l db 221 ld b,h ld hl,18+30 add hl,bc ex de,hl ld c,(ix+17) ld b,0 ld h,b ld l,b sub 32 ischa1: and a jp z,ischa2 add hl,bc dec a jp ischa1 ischa2: ld bc,(font) add hl,bc ex de,hl ld bc,31 ld a,(ix+17) scrch: ex af,af' ex de,hl ld a,(flags) bit 3,a ld a,(hl) jp nz,scrch2 cpl scrch2: ex de,hl ld (hl),a inc de add hl,bc ex af,af' dec a jp nz,scrch scrin: db 221 ld c,l db 221 ld b,h ld hl,18+30 add hl,bc ld de,61 ld b,(ix+17) rot1: rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) add hl,de djnz rot1 ret ;Get scroll type ;Exit: de=screen addr ; a=value for (tempch) gettyp: ld a,(flags) ld c,a rra jp c,isflp ld l,(ix+12) call plopos ld a,l ret isflp: rra jp c,isfslp call getlin ld a,l ret isfslp: call getlin ld a,(ix+9) ret ;Plot routine ploter: call gettyp ld (tempch),a ld a,c ex af,af' db 221 ld c,l db 221 ld b,h ;bc=ix ld l,(ix+13) ld h,(ix+14) ld (store1+1),hl ld hl,18 add hl,bc ;de=screen address ;hl=addr of source data ld b,(ix+17) plot1: push bc push hl ex af,af' bit 2,a jp nz,store stobak: bit 4,a jp nz,oprint ex af,af' ;Normal print ld c,(ix+8) ld b,0 ldir oprbak: ld a,(tempch) ex af,af' ld b,a rra jp nc,cdrow rra jp nc,cdrow ;FSLP next line ld a,b ex af,af' sub (ix+15) ld (tempch),a ld l,a ld h,(ix+10) ld a,(hl) plobak: ld l,a call plopos plot3: pop hl ld bc,31 add hl,bc pop bc djnz plot1 ret ;Normal scroll/FLP next line cdrow: ld a,b ex af,af' add (ix+15) ld (tempch),a jp plobak oprint: ex af,af' ld b,(ix+8) srl b oprin1: ld a,(de) or (hl) ld (de),a inc hl inc de ld a,(de) or (hl) ld (de),a inc hl inc de djnz oprin1 jp oprbak ;Store the whats on screen in a ;back store store: push hl push de push bc store1: ld hl,0 ex de,hl ld c,(ix+8) ld b,0 ldir ld hl,(store1+1) ld bc,31 add hl,bc ld (store1+1),hl pop bc pop de pop hl jp stobak ;Erase routine erase: ld l,(ix+13) ld h,(ix+14) ld (repera+1),hl call gettyp ld (tempch),a ;de=screen address ld a,c ex af,af' ld b,(ix+17) erase1: push bc ex af,af' bit 2,a jp nz,repera ;Normal erase di ld (erassp+1),sp ld l,(ix+8) ld h,0 add hl,de ld sp,hl ld b,(ix+8) srl b ld d,(ix+16) ld e,d erase2: push de djnz erase2 erassp: ld sp,0 ei erebak: ex af,af' ld a,(tempch) ex af,af' ld b,a rra jp nc,edrow rra jp nc,edrow ;FSLP next line ld a,b ex af,af' sub (ix+15) ld (tempch),a ld l,a ld h,(ix+10) ld a,(hl) erabak: ld l,a call plopos pop bc djnz erase1 ret ;Normal scroll/FLP next line edrow: ld a,b ex af,af' add (ix+15) ld (tempch),a jp erabak ;Replace screen erase repera: ld hl,0 ld c,(ix+8) ld b,0 ldir ld hl,(repera+1) ld bc,31 add hl,bc ld (repera+1),hl jp erebak ;Find screen posn ;Entry: calc=FLP/FSLP ; plopos=for normal ; (l=y posn) getlin: ld l,(ix+9) ld h,(ix+10) ld l,(hl) plopos: ld h,1+(scrtab/256) ld d,(hl) dec h ld a,(ix+11) srl a srl a srl a add (hl) ld e,a ret drow: inc d ld a,7 and d ret nz ld a,e add 32 ld e,a ret c ld a,d sub 8 ld d,a ret tempch: db 0 flags: db 0 font: dw 15616 propta: ds 31,0 db 3 ds 14,3 ds 10,6 db 3,3,6,6,6,6,6 ds 26,7 db 4,5,4,4,7,7 ds 26,6 db 4,4,4,5,7 text1: db 'This is a test' db '{5 Speed=3' db 'This is seriously' db ' fast dont you ' db 'think?' db '{1 Speed=1 ' db 'This is pretty slo' db 'w!! ' db '}7 INVERSE' db '}8 NOT INVERSE ' db 'PAUSING FOR 2 SECS' db '|2' db ' ' db 255