head     56.3;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.3
date     93.01.27.13.36.25;  author jwh;  state Exp;
branches ;
next     56.2;

56.2
date     93.01.27.12.12.16;  author jwh;  state Exp;
branches ;
next     56.1;

56.1
date     91.11.05.09.41.53;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.20.09;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.24.57;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.26.10;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.10.07;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.16.09.33;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.24.33;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.08.49;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.14.50;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.56.08;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.43.19;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.50.47;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.22.08.18;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.13.59.37;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.44.04;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.27.09;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.49.12;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.33.48;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.25.03;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.37.54;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.16.28;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.30.07;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.16.05.17;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.38.24;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.45.51;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.18.07.06;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.44.36;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.29.09;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.10.57.04;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.26.52;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.13.08.18;  author bayes;  state Exp;
branches ;
next     25.2;

25.2
date     88.06.08.10.37.21;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.24.45;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.09.43.55;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.10.20.47;  author bayes;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.11.05.49;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.13.49.17;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.11.02.28;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.08.18.18;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.15.14.28;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.10.29.20;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.42.01;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.09.15.33;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.15.18.31;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.18.27.52;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.13.18.00;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.09.44.08;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.10.51.40;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.14.30.19;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.11.49.05;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.13.38.59;  author hal;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.17.48.55;  author paws;  state Exp;
branches ;
next     5.2;

5.2
date     86.10.29.15.22.53;  author geli;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.16.37.25;  author hal;  state Exp;
branches ;
next     4.1;

4.1
date     86.09.30.19.40.39;  author hal;  state Exp;
branches ;
next     3.1;

3.1
date     86.09.01.11.51.26;  author hal;  state Exp;
branches ;
next     2.1;

2.1
date     86.07.30.14.37.05;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.06.30.14.41.59;  author danm;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.3
log
@
pws2rcs automatic delta on Wed Jan 27 13:14:25 MST 1993
@
text
@	     page
*
*   BOBCAT family bit-mapped alpha driver
*
*     Pascal 3.1 version by J. Schmidt
*
	 def     cscrollup,cscrolldown,cupdatecursor,cchar,cclear
	 def     cbuildtable,cshiftleft,cshiftright
	 def     cexchange,cscrollwindow,cursoron,cursoroff
	 def     cscrollwinddn,cdbscrolll,cdbscrollr,cclearall
	 rorg.l 0
	 refa    crtbc,sysdevs,delay_timer
	 lmode   delay_timer
	 nosyms
	 sprint

lowresfont  equ  $64000   400*1024
fontoff1    equ  $3C00    15*1024
fontoff2    equ  $7800    30*1024
fontoff3    equ  $B400    45*1024



fontwidth   equ  crtbc-2
fontht      equ  crtbc-4
maxx        equ  crtbc-10
maxy        equ  crtbc-12
highlight   equ  crtbc-18
planemask   equ  crtbc-20
lowres      equ  crtbc-21
hascolor    equ  crtbc-22
holdcursor  equ  crtbc-38       {SFB 9/22/86}
cursoraddr  equ  crtbc-42       {SFB 9/22/86}
softcursor  equ  crtbc-43       {SFB 9/22/86}
controladdr equ  sysdevs-86
screen      equ  sysdevs-90

* TOPCAT status registers (bitslice)

vblank      equ  $4040      vertical retrace status
busy        equ  $4044      window mover busy
intv        equ  $4048      requesting vert. blank interrupt
intb        equ  $404C      requesting not busy interrupt

* TOPCAT control registers (bit slice)

nblank      equ  $4080       enable display
ensync      equ  $4084       turn on sync
tcwen       equ  $4088       TOPCAT write enable
tcren       equ  $408C       TOPCAT read enable
fben        equ  $4090       frame buffer write enable
intenv      equ  $4094       enable int. on vert. blanking
intenb      equ  $4098       enable int. on not busy
wmove       equ  $409C       window move trigger
blink       equ  $40A0       blink enable
onecas      equ  $40A4
altframe    equ  $40A8
curon       equ  $40AC       cursor enable

* TOPCAT control registers (word wide)

prr         equ  $40EA       pixel replacement rule
wrr         equ  $40EE       window move replacement rule
sox         equ  $40F2       src window origin x
soy         equ  $40F6       src window origin y
dox         equ  $40FA       dest. window origin x
doy         equ  $40FE       dest. window origin y
ww          equ  $4102       window width
wh          equ  $4106       window height
cax         equ  $410A       cursor x position
cay         equ  $410E       cursor y position
cul         equ  $4112       cursor length

* NEREID color map registers

cmapbusy equ     $6003      color map busy
cmapptr  equ     $60B8      color map ptr reg  (word)
cmapmask equ     $60BA      plane mask
cmapred  equ     $61B2      color map red (word)
cmapgrn  equ     $61B4      color map green (word)
cmapblu  equ     $61B6      color map blue  (word)
cmapwrt  equ     $60F0      color map write trigger (word)



width        equ     1024
initoffset   equ      $23            offset to initialization offset
fontoffset   equ      $3B            offset to font info offset
frameoffset  equ      $5D            offset to frame buffer reg. offset
cmapaddr     equ      $33            addr of color map (0 = monochrome)
cmapidoff    equ      $57            offset to color map id offset
cmapinitoff  equ      $3F            offset to cmap 0 init region offset
framecnt     equ      $5B            offset of number of frames
nonsquare    equ      $17            flag for non-square pixels (low res)
fbwidth      equ      $5             width of frame buffer
fbht         equ      $9             height of frame buffer
dispht       equ      $11            height of displayed frame buffer
*
*   cbuildtable
*
cbuildtable movea.l  controladdr(a5),a0    get pointer to ROM start
	    movep    initoffset(a0),d1     form pointer to init block
	    movea.l  a0,a1                  make copy of ROM start addr
	    adda     d1,a1                  a1 points to init info now
	    jsr      ginitblock             call the initializatiion routine
	    clr.b    hascolor(a5)
	    movep    cmapaddr(a0),d0        get color map addr
	    tst      d0
	    beq.s    cnocolor               if 0 then no color init

	    moveq    #0,d1
	    movep    cmapidoff(a0),d0       get ptr to color map id reg
	    tst      d0                     if ptr=0, then use init region 0
	    beq.s    cinitclr
	    move.b   0(a0,d0),d1            get cmap id into d1
cinitclr    and      #3,d1                  look at least sig bits
	    lsl      #2,d1
	    move.b   cmapinitoff(a0,d1.w),d2  form cmap init block addr
	    lsl      #8,d2
	    move.b   cmapinitoff+2(a0,d1.w),d2
	    movea.l  a0,a1
	    adda     d2,a1                  a1 points to cmap init block
	    jsr      ginitblock
	    st       hascolor(a5)           set color boolean
cnocolor    clr.l    screen(a5)             clear space for frame buffer addr
	    movep.w  frameoffset(a0),d0     get offset of frame buffer loc.
	    move.b   0(a0,d0),screen+1(a5)  form frame buffer addr

	    moveq    #-1,d1                 set all 1's in d1
	    moveq    #0,d0                  clear d0

	    move     d1,ensync(a0)          enable sync on all planes
	    move     d1,tcwen(a0)           enable writes to all TOPCATS
	    move     d1,fben(a0)            enable writes to all planes
	    move.b   #1,tcren(a0)           read from plane 0 TOPCAT
	    move     d0,intenv(a0)          disable interrupts
	    move     d0,intenb(a0)
	    move     d0,blink(a0)           turn off blinking

	    move.b   framecnt(a0),d0      d0=# of planes in system
	    beq.s    cnumplanes           if zero then read planes
	    moveq    #8,d1                else make the mask up
	    moveq    #$FF,d2
	    sub      d0,d1                d1 has shift count
	    lsr.b    d1,d2                after shift d2 has mask
	    bra.s    csetplanes           go setup planemask

cnumplanes  moveq   #0,d2
	    movea.l screen(a5),a1         addr of fb in a1
	    move.b  #$FF,(a1)             write all 1's
	    move.b  (a1),d2               get plane mask in d2
csetplanes  move.b  d2,nblank(a0)           blank nonexistent planes
	    move.b  d2,planemask(a5)       save as plane mask
	    tst.b   hascolor(a5)           monochrome ?
	    beq.s   cnocolor2                if so then skip color map init
	    move    d2,cmapmask(a0)        set color map mask
	    jsr     loadcmap               load the color map
	    st       hascolor(a5)          set color boolean


cnocolor2   moveq    #0,d0
	    move     d0,wrr(a0)             setup to clear frame buffer
	    move     d0,dox(a0)             dest is 0,0
	    move     d0,doy(a0)
	    move     d0,sox(a0)
	    move     d0,soy(a0)
	    movep.w  fbwidth(a0),d2         get width from ROM
	    move     d2,ww(a0)              set as window width
	    movep.w  fbht(a0),d2            get height from ROM
	    subq     #4,d2                  don't touch last 4 lines
	    move     d2,wh(a0)              set as window height
	    move.b   planemask(a5),wmove(a0)  trigger the move


cclrtst     move.b   wmove(a0),d2           check for move done
	    and.b    planemask(a5),d2
	    beq.s    cfbclrdone
	    moveq    #50,d2                 kill time
	    dbra     d2,*
	    bra      cclrtst
cfbclrdone  move     #$300,prr(a0)          setup pixel repl rule

	    move.l  d0,d1
	    move.l  d0,d2
	    movep   fontoffset(a0),d1     get font info offset
	    lea     2(a0,d1.w),a1         point to font id code
	    moveq   #2,d7                 count number of font found with d7
	    btst    #0,nonsquare(a0)      find 2 for high res, 1 for low res
	    beq.s   fontidchk
	    moveq   #1,d7
fontidchk   movep   2(a1),d2              get offset of font info
	    lea      0(a0,d2.l),a3        a3 points to font info
	    move.b  (a3),d0               d0 = font height
	    moveq   #0,d1
	    move.b  2(a3),d1              d1 = font width
	    move    d0,fontht(a5)
	    move    d1,fontwidth(a5)
	    adda    #10,a3                a3 now points to first char
	    cmpi.b  #1,(a1)               is font = roman8 ?
	    bne.s   kanachk
	    bsr     unpkroman             if so go unpack it

kanachk     btst    #0,nonsquare(a0)      is this low res???
	    bne.s   nextfont              if so then skip kana for now


	    cmpi.b  #2,(a1)               is font = kana8 upper half?
	    bne.s   nextfont
	    bsr     unpkkana              if so go unpack it
nextfont    addq    #6,a1                 point to next font id
	    tst     d7                    have we found both fonts?
	    bne     fontidchk             if not look at this one
	    btst    #0,nonsquare(a0)      is this low res?
	    beq.s   curset                if not then skip
	    jsr     lowreskanafix         else do kana unpack

curset      move    #0,cax(a0)            set cursor to 0,0
	    move    #0,cay(a0)
	    move    fontwidth(a5),cul(a0) set cursor length
	    move.b  planemask(a5),curon(a0)   enable cursor on all planes
	    move.l  screen(a5),cursoraddr(a5) save init cursoraddr for 98549A
	    bra     cursoron             turn on 98549A soft cursor SFB 9/24/86
*           rts
*
*   misc utilities for initialization
*
*
loadcmap    lea     cmaptable,a1          initialize the color map
	    moveq   #0,d1                 clear some registers
	    move.l  d1,d2
	    move.l  d1,d3
	    move.l  d1,d4
cmaploop1   move.b  (a1)+,d2              get rgb values in d2-d4
	    move.b  (a1)+,d3
	    move.b  (a1)+,d4
	    bsr     cmapenter             stuff the color map entry
	    addq    #1,d1                 bump cmap pointer value
	    cmp     #16,d1                have we done 16 yet?
	    bne     cmaploop1             if not then continue
	    moveq   #-1,d2                set entries 16-255 to white
	    move.l  d2,d3
	    move.l  d2,d4
cmaploop2   bsr     cmapenter
	    addq    #1,d1
	    cmp     #256,d1                done with cmap init?
	    bne     cmaploop2
cmaploop3   btst    #2,cmapbusy(a0)   wait for not busy
	    bne     cmaploop3
	    moveq   #0,d2
	    move    d2,cmapred(a0)        zero the rgb regs
	    move    0,d1                  force DIO uncached read for delay SFB
	    move    d2,cmapgrn(a0)
	    move    0,d1                  force DIO uncached read for delay SFB
	    move    d2,cmapblu(a0)
	    rts

cmapenter   btst    #2,cmapbusy(a0)       check for color map busy
	    bne     cmapenter             loop till bit is clear
	    move    d1,d5
	    not     d5                    kludge for NEREID
	    move    d5,cmapptr(a0)        set pointer register
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d2,cmapred(a0)        stuff the rgb regs
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d3,cmapgrn(a0)
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d4,cmapblu(a0)
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d1,cmapwrt(a0)        hit the write trigger
	    move    0,d5                  force DIO uncached read for delay SFB
*           nop                           kludge for NERIED - replaced w/move SFB
	    rts                           done with cmap entry write
*
*
*
unpkroman   subq    #1,d7                 count a found font
	    btst    #0,nonsquare(a0)      check for low-res
	    beq.s   unpkromanhr           if not unpack hi-res
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont,a2
	    bsr.s   unpackit
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont+fontoff1,a2
	    bsr.s   unpackit
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont+fontoff2,a2
	    bsr.s   unpackit
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont+fontoff3,a2
	    bra.s   unpackit


unpkromanhr moveq   #127,d3               #chars to unpack-1
	    movea.l #$C0000,a2            start at beginning of font storage
	    bsr.s   unpackit
	    moveq   #127,d3               now unpack second half of font
	    movea.l #$C4000,a2
	    bra.s   unpackit

unpkkana    subq    #1,d7
	    moveq   #127,d3               kana8 upper half has 128 chars
	    movea.l #$C8000,a2            store at font storage + 256*128

unpackit    adda.l  screen(a5),a2
	    movea.l a2,a4                 a4 points to font char start addr
	    suba    fontwidth(a5),a4
unpackchar  move    d0,d5                unpack d0 rows/char
	    subq    #1,d5
	    adda    fontwidth(a5),a4      point to char storage start
	    movea.l a4,a2                 make the working copy
unpackrow   moveq   #7,d4                 we need to look at 8 bits/byte
unpackrow2  btst    d4,(a3)               is bit set in font?
	    sne     (a2)+                 set frame buffer byte accordingly
	    dbra    d4,unpackrow2         loop till all 8 bits done
	    addq    #2,a3                 look at next font byte
	    btst    #0,nonsquare(a0)      is this low-res?
	    beq.s   nextrow               if not then do next row
	    moveq   #7,d4                 else do last part of font row
	    moveq   #3,d6
unpackrow3  btst    d4,(a3)
	    sne     (a2)+
	    subq    #1,d4
	    dbra    d6,unpackrow3
	    addq    #2,a3                 point to next font byte
nextrow     adda    #width,a2           adjust storage pointer
	    suba    fontwidth(a5),a2
	    dbra    d5,unpackrow          and loop till rows in char done
	    dbra    d3,unpackchar         loop till all chars done
	    rts                           go look at next font



ginitblock  moveq    #0,d1                  clear some regs
	    moveq    #0,d0
	    move.b   2(a1),d0               get word count to initialize
	    movep    4(a1),d1               form destination offset
	    add.l    a0,d1                  d1 points to dest addr
	    lea      8(a1),a2               a2 points to first data byte
	    movea.l  d1,a3                  a3 points to destination
	    btst     #0,(a1)                is this a bit test block?
	    bne.s    ginitbtst              if so go handle it
ginitloop   movep    0(a2),d1                form a data word in d1
	    move.w   d1,(a3)+               move data to the destination addr
	    btst     #6,(a1)                increment data pointer
	    bne.s    ginit1                 based on control byte
	    addq     #4,a2
ginit1      dbra     d0,ginitloop           loop till word count exhausted
	    btst     #7,(a1)                was this last block?
	    bne.s    ginitdone              yes -- go return
	    btst     #6,(a1)                adjust data pointer
	    beq.s    ginit2                 to point to next init block
ginit3      addq     #4,a2
ginit2      movea.l  a2,a1                  a1 points to new init block
	    bra      ginitblock             do the initialize
ginitdone   rts

ginitbtst   moveq    #0,d2                  handle bit test blocks here
	    move.b   2(a2),d2               d2 = bit # to test
ginittst2   move     (a3),d3                d3 = data word to test
	    btst     #0,(a2)                check for sense of test
	    bne.s    ginittst3              comp if waiting for 0
	    not      d3
ginittst3   btst     d2,d3                  check the bit
	    beq      ginittst2              if not 1 then loop
	    btst     #7,(a1)                was this last block?
	    bne      ginitdone              if so then return
	    bra      ginit3                 else do next block
*
*
cmaptable   equ      *                      initial color map contents (r,g,b)
	    dc.b     0,0,0                  0
	    dc.b     255,255,255            1
	    dc.b     255,0,0                2
	    dc.b     255,255,0              3
	    dc.b     0,255,0                4
	    dc.b     0,255,255              5
	    dc.b     0,0,255                6
	    dc.b     255,0,255              7
	    dc.b     0,0,0                  8
	    dc.b     204,187,51             9
	    dc.b     51,170,119             10
	    dc.b     136,102,170            11
	    dc.b     204,68,102             12
	    dc.b     255,102,51             13
	    dc.b     255,119,0              14
	    dc.b     221,136,68             15

first_blk_offset   equ $73000+396      460*1024+(33 chars)
first_blk_width    equ 23     24 words (31 chars + junk)
second_blk_offset  equ $73000+fontoff1
second_blk_width   equ 47     48 words (64 chars)
*
lowreskanafix equ *
	    movep    dispht(a0),d0         move roman font over kana area
	    add      #30,d0
	    move     d0,soy(a0)
	    add      #30,d0
	    move     d0,doy(a0)
	    moveq    #0,d0
	    move     d0,sox(a0)
	    move     d0,dox(a0)
	    move     #width,ww(a0)
	    move     #30,wh(a0)
	    move     #3,wrr(a0)
	    move.b   planemask(a5),wmove(a0)  trigger the move
	    jsr      waitforready
*      move first block
	    lea      block1,a1
	    movea.l  screen(a5),a2
	    adda.l   #first_blk_offset,a2
	    move     #first_blk_width,d4
	    bsr.s    unpk_kana_blk
*      move second block
	    lea      block2,a1
	    movea.l  screen(a5),a2
	    adda.l   #second_blk_offset,a2
	    move     #second_blk_width,d4
*  unpack kana font block
unpk_kana_blk equ *
	    move     #14,d0   setup to move 15 rows
upb0        movea.l  a2,a3    a2=line start, a3=current
	    move     d4,d1    pre-adjusted word count
upb1        moveq    #15,d2   bit pointer
	    move     (a1)+,d3  get data word
upb2        btst     d2,d3    test a bit
	    sne      (a3)+    set byte in font space
	    dbra     d2,upb2   count bits
	    dbra     d1,upb1   count words in row
	    adda     #width,a2  point to next row
	    dbra     d0,upb0   count rows
	    rts

block1  equ    *    KANA CHARS 161-191
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$0001F801
	dc.l    $80000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000606,$00000180,$C0060000,$18000019,$80000001
	dc.l    $80000000,$00018001,$80000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000C06,$00000180,$C0060000
	dc.l    $18000019,$80000001,$80000000,$00018001,$80000007
	dc.l    $FE000000,$00000000,$00000000,$00000000,$7FC0187F
	dc.l    $E3FC7FE7,$FE3FC1FE,$1FE3F87F,$E3C07FC7,$FC60E000
	dc.l    $00018001,$80000000,$0600000C,$06000003,$01800000
	dc.l    $00000000,$00603860,$60600380,$C6060306,$31800C19
	dc.l    $80000061,$86346000,$00018001,$80000E03,$FE3FC030
	dc.l    $3FC0007F,$C7FC1F83,$FC6C67FC,$0660D860,$60600780
	dc.l    $C67FE606,$61800C19,$87860061,$8C186000,$00018001
	dc.l    $80000E00,$0C00C0E0,$30C3FC07,$018C0180,$0C366000
	dc.l    $07871800,$60600D80,$C606000C,$01800C01,$80060181
	dc.l    $80006000,$00018001,$80000000,$18078760,$00C0600F
	dc.l    $01980301,$FC00C000,$06001800,$C0601981,$86060018
	dc.l    $01800C01,$800C0601,$8000C000,$0E018001,$80E00000
	dc.l    $60060060,$0180601B,$01800600,$0C018000,$06001801
	dc.l    $80606181,$86060060,$03000C03,$03181981,$86018000
	dc.l    $0E01801F,$80E00003,$80180060,$0E03FC63,$01807FE7
	dc.l    $FC0E0000,$3800180E,$07FE0183,$1C060380,$1C07FC1C
	dc.l    $03E06060,$FC0E0000,$00000000,$00600000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00C00000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000


block2  equ    *    KANA CHARS 192-255
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $003301E0,$7C07C07C,$07C07C07,$C07C07C0,$7C07C07C
	dc.l    $07C07C07,$C07C07C0,$7C07C07C,$07C07C07,$C07C07C0
	dc.l    $7C07C07C,$07C07C07,$C07C03FC,$00000000,$00001800
	dc.l    $30000000,$06000000,$03000000,$00060000,$00000000
	dc.l    $00001800,$00000000,$00000000,$00000000,$00330330
	dc.l    $40040040,$04004004,$00400400,$40040040,$04004004
	dc.l    $00400400,$40040040,$04004004,$00400400,$40040040
	dc.l    $04004004,$004007FE,$00001C00,$00001800,$30000000
	dc.l    $06000003,$03000000,$00060000,$00003000,$60001800
	dc.l    $00000000,$31800000,$00000000,$00330330,$78078078
	dc.l    $07807807,$80780780,$78078078,$07807807,$80780780
	dc.l    $78078078,$07807807,$80780780,$78078078,$07807807
	dc.l    $807804F2,$1FE3F066,$63FC1807,$FE3FC7FC,$7FC03C01
	dc.l    $83FC7FE1,$E07FE7FC,$3F806000,$63FC7FE3,$F03FC3FC
	dc.l    $31833030,$03F87FE7,$800001E0,$40040040,$04004004
	dc.l    $00400400,$40040040,$04004004,$00400400,$40040040
	dc.l    $04004004,$00400400,$40040040,$04004004,$004004E6
	dc.l    $30603033,$60001F80,$30000006,$01800C18,$C3000063
	dc.l    $30060006,$0040C030,$C0C01860,$18006000,$31833030
	dc.l    $060C6060,$0C000000,$7C07C07C,$07C07C07,$C07C07C0
	dc.l    $7C07C07C,$07C07C07,$C07C07C0,$40040040,$04004004
	dc.l    $00400400,$40040040,$04004004,$004004CE,$6067FE00
	dc.l    $67FE18E0,$30000306,$06000C18,$C3000066,$1806000C
	dc.l    $1F01800D,$87FE18C0,$180067FE,$01833030,$C60C6060
	dc.l    $0C000000,$01C00801,$C03C0240,$3C01C03E,$01C01C01
	dc.l    $C03C01E0,$3C03E03E,$01C00801,$C03C0240,$3C01C03E
	dc.l    $01C01C01,$C03C01E0,$3C03E41E,$06C03000,$60301800
	dc.l    $300000CC,$1F801818,$630000C0,$0C36C018,$00830003
	dc.l    $00C01800,$301FE006,$01833630,$C60C0060,$0C000000
	dc.l    $02201802,$20020240,$20020002,$02202202,$20220200
	dc.l    $22020020,$02201802,$20020240,$20020002,$02202202
	dc.l    $20220200,$220204CE,$01803000,$C0301800,$30000030
	dc.l    $66603030,$63000180,$0C36C3B0,$00060C06,$C0C01800
	dc.l    $3000600C,$01833631,$860C00C0,$18000000,$02A00800
	dc.l    $C00C03E0,$3C03C004,$01C01E03,$E03C0200,$2203C03C
	dc.l    $02A00800,$C00C03E0,$3C03C004,$01C01E03,$E03C0200
	dc.l    $2203C4E6,$06606001,$80601800,$600000CC,$0600C030
	dc.l    $630C0600,$0636C060,$7FC60618,$60C61800,$60006018
	dc.l    $03033633,$060C0186,$30000000,$02200801,$00220040
	dc.l    $02022008,$02200202,$20220200,$22020020,$02200801
	dc.l    $00220040,$02022008,$02200202,$20220200,$220204F2
	dc.l    $3803800E,$03801803,$807FE306,$06070060,$61F83800
	dc.l    $06666018,$0023FC60,$007C1807,$FE7FE0E0,$1C063C3C
	dc.l    $07FC0E07,$C0000000,$01C01C03,$E01C0040,$3C01C010
	dc.l    $01C01C02,$203C01E0,$3C03E020,$01C01C03,$E01C0040
	dc.l    $3C01C010,$01C01C02,$203C01E0,$3C03E7FE,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$000003FC,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
*
*
*  waitforready:  wait till window mover done
*
*
waitforready equ *
	   move      d0,-(sp)               save a register
	   movea.l   controladdr(a5),a0     get control address base


wait1      move.b    wmove(a0),d0
	   and.b     planemask(a5),d0       mask out unused planes
	   beq.s     waitdone               if clear then we're done
	   move.l    #50,-(sp)              else wait 50 us
	   jsr       delay_timer
	   bra       wait1                  and look again
waitdone   move      (sp)+,d0               restore d0
	   rts
*
*
* savestate: preserve window mover  state
*
*       Uses   a0,a2
*              a0 set to controladdr(a5)
*

savestate   equ *
	    jsr     waitforready
	    movea.l (sp)+,a2     save return addr
	    move    ww(a0),-(sp)
	    move    wh(a0),-(sp)
	    move    sox(a0),-(sp)
	    move    soy(a0),-(sp)
	    move    dox(a0),-(sp)
	    move    doy(a0),-(sp)
	    move    wrr(a0),-(sp)
	    jmp    (a2)
*
* restorestate: restores window mover control regs
*
*           Uses:  a0,a2
*
restorestate  equ *
	    jsr     waitforready
	    movea.l (sp)+,a2    save ret addr
	    move    (sp)+,wrr(a0)
	    move    (sp)+,doy(a0)
	    move    (sp)+,dox(a0)
	    move    (sp)+,soy(a0)
	    move    (sp)+,sox(a0)
	    move    (sp)+,wh(a0)
	    move    (sp)+,ww(a0)
	    jmp     (a2)

*
*
*  procedure cclearall: clears all of visible area
*
cclearall   jsr     savestate
	    bsr     cursoroff   {SFB 9/29/86}
	    moveq   #0,d0
	    move    d0,sox(a0)    setup x,y
	    move    d0,soy(a0)
	    move    d0,dox(a0)
	    move    d0,doy(a0)
	    move    #width,ww(a0) set width
	    movep   dispht(a0),d1 and height
	    move    d1,wh(a0)
	    move    d0,wrr(a0)    set repl rule
	    move.b  planemask(a5),wmove(a0)  do the move
	    jsr     restorestate
	    bsr     cursoron    {SFB 9/29/86}
	    rts
*
*
*   procedure cchar(ord(char),x,y:shortint);
*
cchar    movea.l (sp)+,a4
	 move    (sp)+,d0         d0 =  dest y char offset
	 mulu    fontht(a5),d0    d0 = pixel row offset
	 move    (sp)+,d5         d5 = x char offset
	 mulu    fontwidth(a5),d5   d5 = pixel column offset
	 tst.b   lowres(a5)       check if low res display
	 beq.s   cchar2           if not then no offset
	 add     #32,d5           else need offset to center
	 add     #10,d0           also adjust y offset
cchar2   moveq   #0,d1            d1 will have src y
	 movea.l controladdr(a5),a0
	 movep.w dispht(a0),d1
	 move    (sp)+,d2         d2 = character
	 moveq   #0,d3
	 moveq   #0,d4
	 tst.b   lowres(a5)
	 beq.s   cchres
	 moveq   #6,d7            low res shift count
	 moveq   #$3F,d6          low res mask
	 bra.s   cchfindxy        go find the char in font space
cchres   moveq   #7,d7            hi res shift count
	 moveq   #$7F,d6          hi res mask
cchfindxy equ    *
	 move    d2,d3            copy the character
	 move    d2,d4            to d3 and d4
	 lsr     d7,d3            d3 = src y row number
	 and     d6,d4            d4 = src x offset in chars
	 mulu    fontht(a5),d3    d3 = y pixel location
	 mulu    fontwidth(a5),d4  d4 = x pixel location
	 add     d1,d3            add in y offset
	 jsr     savestate        preserve window mover state
	 move    d3,soy(a0)
	 move    d4,sox(a0)       set up src location
	 move    d0,doy(a0)       and dest location
	 move    d5,dox(a0)
	 move    fontht(a5),wh(a0)  set up window size
	 move    fontwidth(a5),ww(a0)
	 move    #0,wrr(a0)       first clear the destination
	 moveq   #0,d3
	 move.b  highlight(a5),d3   get highlight byte
	 lsr     #4,d3              shift to get color mask
	 and     #7,d3
	 addq    #1,d3              get actual pen number
	 not     d3                 set all unused planes to 0
	 move.b  d3,wmove(a0)       trigger the move
	 jsr     waitforready
	 move    #3,wrr(a0)         setup rule to replace
	 btst    #0,highlight(a5)   inverse video?
	 beq.s   ccharb             if not, skip next instruction
	 move    #12,wrr(a0)        else set repl rule to invert
ccharb   not     d3                   get actual pen number
	 move.b  d3,wmove(a0)        make this the frames to move
	 btst    #2,highlight(a5)     underline?
	 beq.s   cchar1               no, skip next part
	 jsr     waitforready
	 add     fontht(a5),d0
	 subq    #1,d0                get y pos for underline
	 mulu    #width,d0            convert to address
	 add.l   d5,d0                add in x offset
	 movea.l screen(a5),a1        get frame buffer start
	 adda.l  d0,a1                point a1 to underline row
*        bsr     cursoroff
	 move    fontwidth(a5),d1     setup count for underline
	 subq    #1,d1
	 move    prr(a0),-(sp)        save the prr
	 move    #$600,prr(a0)          set up xor repl rule
cchrul   move.b  d3,(a1)+             place a pixel
	 dbra    d1,cchrul            loop till done
	 move    (sp)+,prr(a0)        restore prr
*        bsr     cursoron

cchar1   bsr     restorestate        restore window state
	 jmp     (a4)
*
*
*   cscrollup;
*
*   scrolls the screen up one line of alpha text
*
cscrollup jsr     savestate      save window mover state
	  bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	  movea.l controladdr(a5),a0
	  move    #0,dox(a0)     set up dest. loc
	  move    #0,doy(a0)
	  move    #0,sox(a0)     set up src loc
	  move    fontht(a5),soy(a0)  start one line width down
	  move    maxy(a5),d2    get lines in screen to move
	  mulu    fontht(a5),d2  get # pixel lines to move
	  move    d2,wh(a0)      set up window size
	  move    #width,ww(a0)
	  move    #3,wrr(a0)     repl rule to replace
	  tst.b   lowres(a5)     check for low res display
	  beq.s   cscroll2       if not then skip
	  addi    #10,soy(a0)    else adjust y offset
	  addi    #10,doy(a0)
cscroll2  move.b  planemask(a5),wmove(a0)  move all planes
*
* Clear bottom line on screen
*
	  jsr     waitforready
	  move    maxy(a5),d2
	  mulu    fontht(a5),d2   d2 = y offset of bottom line
	  move    d2,doy(a0)
	  move    fontht(a5),wh(a0) clear one char line ht
	  move    #0,wrr(a0)        repl rule to clear
	  tst.b   lowres(a5)       check for low res
	  beq.s   cscroll3         if not then skip
	  addi    #10,doy(a0)      else adjust y offset
cscroll3  move.b  planemask(a5),wmove(a0)  clear all planes
	  jsr     restorestate
	  bra     cursoron             turn on 98549A soft cursor SFB 9/24/86
*         rts

*
*    cscrolldown
*
*    scrolls the screen down one text line
*
cscrolldown jsr     savestate
	    bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	    moveq   #0,d0
	    movea.l controladdr(a5),a0
	    move    d0,sox(a0)      set up src origin
	    move    d0,soy(a0)
	    move    d0,dox(a0)      setup dest. origin
	    move    fontht(a5),doy(a0)
	    move    #width,ww(a0)   setup window size
	    move    maxy(a5),d2
	    mulu    fontht(a5),d2
	    move    d2,wh(a0)
	    move    #3,wrr(a0)      setup repl rule
	    tst.b   lowres(a5)      is this low-res display?
	    beq.s   cscroll4        if not then skip
	    addi    #10,doy(a0)     else adjust y offsets
	    addi    #10,soy(a0)
cscroll4    move.b  planemask(a5),wmove(a0) move all planes
	    jsr     waitforready
	    move    soy(a0),doy(a0)
	    move    fontht(a5),wh(a0)
	    move    d0,wrr(a0)
	    move.b  planemask(a5),wmove(a0)
	    jsr     restorestate
	    bra     cursoron             turn on 98549A soft cursor SFB 9/24/86
*           rts

*
* cupdatecursor(x,y:shortint);
*

cupdatecursor equ *
	      movea.l (sp)+,a4     a4 = return addr
	      move    (sp)+,d5     d5 = y in chars
	      move    (sp)+,d4     d4 = x in chars
	      movea.l controladdr(a5),a0
	      mulu    fontht(a5),d5  d5 = y in pixels
	      add     fontht(a5),d5
	      subq    #1,d5        d5 is last line of char
	      mulu    fontwidth(a5),d4  d4 = x in pixels
	      tst.b   lowres(a5)    check if low res
	      beq.s   cupdate2      if not then skip
	      add     #32,d4        else offset x
	      add     #10,d5        and y
cupdate2      move    d5,cay(a0)    do the cursor move
	      move    d4,cax(a0)

	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      subq    #1,d5          d5 is second last line of char
	      mulu    #width,d5      compute memory address
	      add     d4,d5
	      add.l   screen(a5),d5
	      move.l  d5,cursoraddr(a5)
	      bsr     cursoron      turn on 98549A soft cursor SFB 9/24/86

	      jmp     (a4)

*
*  cclear(xpos,ypos,nchars:shortint);
*    -- clears nchars starting at xpos, ypos
*    -- nchars + xpos must not exceed 128
*       no range checking is done
*

cclear        equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      movea.l (sp)+,a4     a4 = return address
	      move    (sp)+,d1     d4 = number of characters to clear
	      move    (sp)+,d3     d3 = y to begin at
	      move    (sp)+,d5     d5 = x
	      move.l  a4,-(sp)     stack return address
	      jsr     savestate    save window mover state
	      mulu    fontht(a5),d3   d3 = y in pixels
	      move    d3,doy(a0)
	      mulu    fontwidth(a5),d5  d5 = x in pixels
	      tst.b   lowres(a5)    check for low res
	      beq.s   cclear2       if not then skip
	      add     #32,d5        else offset x
	      addi    #10,doy(a0)   and y
cclear2       move    d5,dox(a0)    setup dest. x reg
	      move    fontht(a5),wh(a0) setup window size
	      mulu    fontwidth(a5),d1
	      move    d1,ww(a0)
	      moveq   #0,d0
	      move    d0,wrr(a0)    repl rule to clear
	      move    d0,sox(a0)
	      move    d0,soy(a0)
	      move.b  planemask(a5),wmove(a0) use all planes
	      jsr     restorestate
*             bra     cursoron      turn on 98549A soft cursor SFB 9/24/86
*             rts


cursoron      equ     *               enable cursor
	      tst.b   softcursor(a5)
	      bne.s   softon
	      movea.l controladdr(a5),a0
	      move.b  planemask(a5),curon(a0)
	      rts
softon        equ     *
	      movea.l cursoraddr(a5),a0
	      movem.l (a0),d0-d1
	      movem.l d0-d1,holdcursor(a5)
	      movem.l width(a0),d0-d1
	      movem.l d0-d1,holdcursor+8(a5)
	      moveq   #-1,d0
	      move.l  d0,d1
	      movem.l d0-d1,(a0)
	      movem.l d0-d1,width(a0)
	      rts


cursoroff     equ     *               disable cursor
	      tst.b   softcursor(a5)
	      bne.s   softoff
	      movea.l controladdr(a5),a0
	      move.b  #0,curon(a0)
	      rts
softoff       equ     *
	      movea.l cursoraddr(a5),a0
	      movem.l holdcursor(a5),d0-d1
	      movem.l d0-d1,(a0)
	      movem.l holdcursor+8(a5),d0-d1
	      movem.l d0-d1,width(a0)
	      rts

cshiftleft    equ     *
	      jsr     savestate       save window mover state
	      moveq   #0,d1             d1 = dest x location
	      move    fontwidth(a5),d2  d2 = src x location
cshift1       moveq   #1,d0        get pointer to last line of screen
	      add     maxy(a5),d0
	      mulu    fontht(a5),d0   d0 = y origin of typeahead
	      tst.b   lowres(a5)        check if lowres
	      beq.s   cshlhres          if not then skip
	      add     #32,d1            else offset x
	      add     #32,d2            locations
	      add     #10,d0            and y locations

cshlhres      move    d1,dox(a0)
	      move    d2,sox(a0)
	      move    d0,doy(a0)      setup destination and src loc
	      move    d0,soy(a0)
	      moveq   #-8,d1       get # chars in length to move
	      add     maxx(a5),d1  d1 now has # chars to move
	      mulu    fontwidth(a5),d1  d1 now has width in pixels
	      move    d1,ww(a0)
	      move    fontht(a5),wh(a0)  height is one char row
	      move    #3,wrr(a0)         setup replacement rule
	      move.b  planemask(a5),wmove(a0)    do all planes
	      bsr     restorestate   fix replacement rule reg and return
	      rts

cshiftright   equ     *
	      jsr     savestate
	      moveq   #0,d2           src x location
	      move    fontwidth(a5),d1  dest x location
	      bra     cshift1      now do same stuff as shift left


*  procedure cexchange(savearea: windowp; ymin, ymax, xmin, width: shortint);

cexchange     movea.l (sp)+,a4     a4 = return addr
	      move    (sp)+,d0     width of window in pixels in d0
	      lsr     #2,d0        d0=window width in long integers
	      subq    #1,d0        setup for later looping
	      move    (sp)+,d4     d4 = x offset in chars
	      mulu    fontwidth(a5),d4      d4 = x offset in pixels
	      move    (sp)+,d5     d5 = ymax
	      move    (sp)+,d1     d1 = ymin
	      movea.l (sp)+,a1     a1 = ptr to save area
	      sub     d1,d5
	      addq    #1,d5        d5 has # of char rows to move
	      mulu    fontht(a5),d5  now has # of pixel rows to move
	      subq    #1,d5       setup for outer loop
	      mulu    fontht(a5),d1    d1 = y offset in pixels
	      mulu    #width,d1        d1 = y address offset
	      bsr     savestate
*             bsr     cursoroff
	      move    prr(a0),-(sp)
	      move    #$300,prr(a0)  setup pixel repl rule
	      movea.l screen(a5),a0 a0 points to frame buffer start
	      adda.l  d1,a0         now points to correct row
	      adda    d4,a0         do x offset into row
	      tst.b   lowres(a5)    is this low res?
	      beq.s   cexchg2       if not then skip
	      adda    #32,a0        else adjust x offset
	      adda    #10240,a0     and y offset
cexchg2       movea.l a0,a2         make a working copy
	      move    d0,d7         initialize inner loop
cexchg3       move.l  (a2),d6       screen to temp
	      move.l  (a1),(a2)+    save area to screen
	      move.l  d6,(a1)+      temp to save area
	      dbra    d7,cexchg3    inner loop (pixel row move)
	      adda.l  #width,a0     bump row pointer
	      dbra    d5,cexchg2    outer loop (row count)
	      movea.l controladdr(a5),a0
	      move    (sp)+,prr(a0)
*             bsr     cursoron
	      bsr     restorestate  restore control regs
	      jmp     (a4)          done


* procedure cscrollwindow( ymin, ymax, xmin, width: shortint);

cscrollwindow equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #0,d6          set upscroll flag in d6
cscrollwindc  movea.l (sp)+,a4       a4 = return addr
	      move    (sp)+,d1       d1 = width in chars
	      mulu    fontwidth(a5),d1     d1 = width in pixels
	      move    (sp)+,d0       d0 = x offset of window in chars
	      mulu    fontwidth(a5),d0      d0 = x offset in pixels (bytes)
	      move    (sp)+,d2       d2 = ymax
	      move    (sp)+,d3       d3 = ymin
	      sub     d3,d2          d2 has # of char rows to move
	      mulu    fontht(a5),d2  now d2 has height to move
	      mulu    fontht(a5),d3  d3 = y offset in bytes of origin
	      jsr     savestate
	      tst     d6             check up/down flag
	      bne.s   cscrollwindb    and branch if dn
	      move    d3,doy(a0)     set ymin to dest y origin
	      add     fontht(a5),d3
	      move    d3,soy(a0)     one row down is src y origin

cscrollwin1   tst.b   lowres(a5)     is this low res?
	      beq.s   cscrollwin2    if not then skip
	      add     #32,d0         else adjust x offset
	      addi    #10,soy(a0)    and y offsets
	      addi    #10,doy(a0)
cscrollwin2   move    d1,ww(a0)      setup width reg
	      move    d2,wh(a0)      setup height reg
	      move    d0,sox(a0)     setup x coordinates
	      move    d0,dox(a0)
	      move    #3,wrr(a0)
	      move.b  planemask(a5),wmove(a0)   all planes
	      bsr     restorestate
	      bsr     cursoron      turn on 98549A soft cursor SFB 9/24/86
	      jmp     (a4)


cscrollwindb  move    d3,soy(a0)      ymin = src y origin
	      add     fontht(a5),d3
	      move    d3,doy(a0)      one row down is dest y
	      bra     cscrollwin1

cscrollwinddn equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #1,d6          set down scroll flag
	      bra     cscrollwindc    go to common code





cdbscrolll    equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #0,d6          set left scroll flag
cdbscrollb    movea.l (sp)+,a4       pickup return addr
	      move    (sp)+,d1       width in chars
	      subq    #1,d1          actual width to move is 1 less
	      mulu    fontwidth(a5),d1  width in pixels in d1
	      move    (sp)+,d0       x offset in chars
	      mulu    fontwidth(a5),d0  d0 = x offset in pixels
	      move    (sp)+,d5       d5 = ymax
	      move    (sp)+,d3       d3 = ymin
	      sub     d3,d5
	      addq    #1,d5          d5 = # char rows to move
	      mulu    fontht(a5),d5  d5 = # pixel rows to move
	      mulu    fontht(a5),d3  d3 = y window start offset
	      tst.b   lowres(a5)     is this low res?
	      beq.s   cdbscrolld     if not then skip
	      add     #32,d0         else offset x
	      add     #10,d3         and y origins
cdbscrolld    jsr     savestate      save window mover state
	      tst     d6             check left/right flag
	      bne.s   cdbscroll2     if right, skip
	      move    d0,dox(a0)     if left xmin= dest x
	      add     fontwidth(a5),d0
	      move    d0,sox(a0)     and src is 1 char to rt
cdbscrollc    move    d1,ww(a0)      setup width reg
	      move    d5,wh(a0)      setup height reg
	      move    d3,soy(a0)     y is same for src and dest
	      move    d3,doy(a0)
	      move    #3,wrr(a0)    setup repl rule
	      move    planemask(a5),wmove(a0)   all planes
	      bsr     restorestate
	      bsr     cursoron      turn on 98549A soft cursor SFB 9/24/86
	      move.l  a4,-(sp)
	      rts                    finished!

cdbscroll2    move    d0,sox(a0)     xmin is src x for rt move
	      add     fontwidth(a5),d0
	      move    d0,dox(a0)     dest is 1 char to rt
	      bra     cdbscrollc     goto common code





cdbscrollr    equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #1,d6          set right shift flag
	      bra     cdbscrollb     go to common code

	      end
@


56.2
log
@
pws2rcs automatic delta on Wed Jan 27 11:57:27 MST 1993
@
text
@d1 1045
@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@a0 1045
	     page
*
*   BOBCAT family bit-mapped alpha driver
*
*     Pascal 3.1 version by J. Schmidt
*
	 def     cscrollup,cscrolldown,cupdatecursor,cchar,cclear
	 def     cbuildtable,cshiftleft,cshiftright
	 def     cexchange,cscrollwindow,cursoron,cursoroff
	 def     cscrollwinddn,cdbscrolll,cdbscrollr,cclearall
	 rorg.l 0
	 refa    crtbc,sysdevs,delay_timer
	 lmode   delay_timer
	 nosyms
	 sprint

lowresfont  equ  $64000   400*1024
fontoff1    equ  $3C00    15*1024
fontoff2    equ  $7800    30*1024
fontoff3    equ  $B400    45*1024



fontwidth   equ  crtbc-2
fontht      equ  crtbc-4
maxx        equ  crtbc-10
maxy        equ  crtbc-12
highlight   equ  crtbc-18
planemask   equ  crtbc-20
lowres      equ  crtbc-21
hascolor    equ  crtbc-22
holdcursor  equ  crtbc-38       {SFB 9/22/86}
cursoraddr  equ  crtbc-42       {SFB 9/22/86}
softcursor  equ  crtbc-43       {SFB 9/22/86}
controladdr equ  sysdevs-86
screen      equ  sysdevs-90

* TOPCAT status registers (bitslice)

vblank      equ  $4040      vertical retrace status
busy        equ  $4044      window mover busy
intv        equ  $4048      requesting vert. blank interrupt
intb        equ  $404C      requesting not busy interrupt

* TOPCAT control registers (bit slice)

nblank      equ  $4080       enable display
ensync      equ  $4084       turn on sync
tcwen       equ  $4088       TOPCAT write enable
tcren       equ  $408C       TOPCAT read enable
fben        equ  $4090       frame buffer write enable
intenv      equ  $4094       enable int. on vert. blanking
intenb      equ  $4098       enable int. on not busy
wmove       equ  $409C       window move trigger
blink       equ  $40A0       blink enable
onecas      equ  $40A4
altframe    equ  $40A8
curon       equ  $40AC       cursor enable

* TOPCAT control registers (word wide)

prr         equ  $40EA       pixel replacement rule
wrr         equ  $40EE       window move replacement rule
sox         equ  $40F2       src window origin x
soy         equ  $40F6       src window origin y
dox         equ  $40FA       dest. window origin x
doy         equ  $40FE       dest. window origin y
ww          equ  $4102       window width
wh          equ  $4106       window height
cax         equ  $410A       cursor x position
cay         equ  $410E       cursor y position
cul         equ  $4112       cursor length

* NEREID color map registers

cmapbusy equ     $6003      color map busy
cmapptr  equ     $60B8      color map ptr reg  (word)
cmapmask equ     $60BA      plane mask
cmapred  equ     $61B2      color map red (word)
cmapgrn  equ     $61B4      color map green (word)
cmapblu  equ     $61B6      color map blue  (word)
cmapwrt  equ     $60F0      color map write trigger (word)



width        equ     1024
initoffset   equ      $23            offset to initialization offset
fontoffset   equ      $3B            offset to font info offset
frameoffset  equ      $5D            offset to frame buffer reg. offset
cmapaddr     equ      $33            addr of color map (0 = monochrome)
cmapidoff    equ      $57            offset to color map id offset
cmapinitoff  equ      $3F            offset to cmap 0 init region offset
framecnt     equ      $5B            offset of number of frames
nonsquare    equ      $17            flag for non-square pixels (low res)
fbwidth      equ      $5             width of frame buffer
fbht         equ      $9             height of frame buffer
dispht       equ      $11            height of displayed frame buffer
*
*   cbuildtable
*
cbuildtable movea.l  controladdr(a5),a0    get pointer to ROM start
	    movep    initoffset(a0),d1     form pointer to init block
	    movea.l  a0,a1                  make copy of ROM start addr
	    adda     d1,a1                  a1 points to init info now
	    jsr      ginitblock             call the initializatiion routine
	    clr.b    hascolor(a5)
	    movep    cmapaddr(a0),d0        get color map addr
	    tst      d0
	    beq.s    cnocolor               if 0 then no color init

	    moveq    #0,d1
	    movep    cmapidoff(a0),d0       get ptr to color map id reg
	    tst      d0                     if ptr=0, then use init region 0
	    beq.s    cinitclr
	    move.b   0(a0,d0),d1            get cmap id into d1
cinitclr    and      #3,d1                  look at least sig bits
	    lsl      #2,d1
	    move.b   cmapinitoff(a0,d1.w),d2  form cmap init block addr
	    lsl      #8,d2
	    move.b   cmapinitoff+2(a0,d1.w),d2
	    movea.l  a0,a1
	    adda     d2,a1                  a1 points to cmap init block
	    jsr      ginitblock
	    st       hascolor(a5)           set color boolean
cnocolor    clr.l    screen(a5)             clear space for frame buffer addr
	    movep.w  frameoffset(a0),d0     get offset of frame buffer loc.
	    move.b   0(a0,d0),screen+1(a5)  form frame buffer addr

	    moveq    #-1,d1                 set all 1's in d1
	    moveq    #0,d0                  clear d0

	    move     d1,ensync(a0)          enable sync on all planes
	    move     d1,tcwen(a0)           enable writes to all TOPCATS
	    move     d1,fben(a0)            enable writes to all planes
	    move.b   #1,tcren(a0)           read from plane 0 TOPCAT
	    move     d0,intenv(a0)          disable interrupts
	    move     d0,intenb(a0)
	    move     d0,blink(a0)           turn off blinking

	    move.b   framecnt(a0),d0      d0=# of planes in system
	    beq.s    cnumplanes           if zero then read planes
	    moveq    #8,d1                else make the mask up
	    moveq    #$FF,d2
	    sub      d0,d1                d1 has shift count
	    lsr.b    d1,d2                after shift d2 has mask
	    bra.s    csetplanes           go setup planemask

cnumplanes  moveq   #0,d2
	    movea.l screen(a5),a1         addr of fb in a1
	    move.b  #$FF,(a1)             write all 1's
	    move.b  (a1),d2               get plane mask in d2
csetplanes  move.b  d2,nblank(a0)           blank nonexistent planes
	    move.b  d2,planemask(a5)       save as plane mask
	    tst.b   hascolor(a5)           monochrome ?
	    beq.s   cnocolor2                if so then skip color map init
	    move    d2,cmapmask(a0)        set color map mask
	    jsr     loadcmap               load the color map
	    st       hascolor(a5)          set color boolean


cnocolor2   moveq    #0,d0
	    move     d0,wrr(a0)             setup to clear frame buffer
	    move     d0,dox(a0)             dest is 0,0
	    move     d0,doy(a0)
	    move     d0,sox(a0)
	    move     d0,soy(a0)
	    movep.w  fbwidth(a0),d2         get width from ROM
	    move     d2,ww(a0)              set as window width
	    movep.w  fbht(a0),d2            get height from ROM
	    subq     #4,d2                  don't touch last 4 lines
	    move     d2,wh(a0)              set as window height
	    move.b   planemask(a5),wmove(a0)  trigger the move


cclrtst     move.b   wmove(a0),d2           check for move done
	    and.b    planemask(a5),d2
	    beq.s    cfbclrdone
	    moveq    #50,d2                 kill time
	    dbra     d2,*
	    bra      cclrtst
cfbclrdone  move     #$300,prr(a0)          setup pixel repl rule

	    move.l  d0,d1
	    move.l  d0,d2
	    movep   fontoffset(a0),d1     get font info offset
	    lea     2(a0,d1.w),a1         point to font id code
	    moveq   #2,d7                 count number of font found with d7
	    btst    #0,nonsquare(a0)      find 2 for high res, 1 for low res
	    beq.s   fontidchk
	    moveq   #1,d7
fontidchk   movep   2(a1),d2              get offset of font info
	    lea      0(a0,d2.l),a3        a3 points to font info
	    move.b  (a3),d0               d0 = font height
	    moveq   #0,d1
	    move.b  2(a3),d1              d1 = font width
	    move    d0,fontht(a5)
	    move    d1,fontwidth(a5)
	    adda    #10,a3                a3 now points to first char
	    cmpi.b  #1,(a1)               is font = roman8 ?
	    bne.s   kanachk
	    bsr     unpkroman             if so go unpack it

kanachk     btst    #0,nonsquare(a0)      is this low res???
	    bne.s   nextfont              if so then skip kana for now


	    cmpi.b  #2,(a1)               is font = kana8 upper half?
	    bne.s   nextfont
	    bsr     unpkkana              if so go unpack it
nextfont    addq    #6,a1                 point to next font id
	    tst     d7                    have we found both fonts?
	    bne     fontidchk             if not look at this one
	    btst    #0,nonsquare(a0)      is this low res?
	    beq.s   curset                if not then skip
	    jsr     lowreskanafix         else do kana unpack

curset      move    #0,cax(a0)            set cursor to 0,0
	    move    #0,cay(a0)
	    move    fontwidth(a5),cul(a0) set cursor length
	    move.b  planemask(a5),curon(a0)   enable cursor on all planes
	    move.l  screen(a5),cursoraddr(a5) save init cursoraddr for 98549A
	    bra     cursoron             turn on 98549A soft cursor SFB 9/24/86
*           rts
*
*   misc utilities for initialization
*
*
loadcmap    lea     cmaptable,a1          initialize the color map
	    moveq   #0,d1                 clear some registers
	    move.l  d1,d2
	    move.l  d1,d3
	    move.l  d1,d4
cmaploop1   move.b  (a1)+,d2              get rgb values in d2-d4
	    move.b  (a1)+,d3
	    move.b  (a1)+,d4
	    bsr     cmapenter             stuff the color map entry
	    addq    #1,d1                 bump cmap pointer value
	    cmp     #16,d1                have we done 16 yet?
	    bne     cmaploop1             if not then continue
	    moveq   #-1,d2                set entries 16-255 to white
	    move.l  d2,d3
	    move.l  d2,d4
cmaploop2   bsr     cmapenter
	    addq    #1,d1
	    cmp     #256,d1                done with cmap init?
	    bne     cmaploop2
cmaploop3   btst    #2,cmapbusy(a0)   wait for not busy
	    bne     cmaploop3
	    moveq   #0,d2
	    move    d2,cmapred(a0)        zero the rgb regs
	    move    0,d1                  force DIO uncached read for delay SFB
	    move    d2,cmapgrn(a0)
	    move    0,d1                  force DIO uncached read for delay SFB
	    move    d2,cmapblu(a0)
	    rts

cmapenter   btst    #2,cmapbusy(a0)       check for color map busy
	    bne     cmapenter             loop till bit is clear
	    move    d1,d5
	    not     d5                    kludge for NEREID
	    move    d5,cmapptr(a0)        set pointer register
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d2,cmapred(a0)        stuff the rgb regs
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d3,cmapgrn(a0)
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d4,cmapblu(a0)
	    move    0,d5                  force DIO uncached read for delay SFB
	    move    d1,cmapwrt(a0)        hit the write trigger
	    move    0,d5                  force DIO uncached read for delay SFB
*           nop                           kludge for NERIED - replaced w/move SFB
	    rts                           done with cmap entry write
*
*
*
unpkroman   subq    #1,d7                 count a found font
	    btst    #0,nonsquare(a0)      check for low-res
	    beq.s   unpkromanhr           if not unpack hi-res
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont,a2
	    bsr.s   unpackit
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont+fontoff1,a2
	    bsr.s   unpackit
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont+fontoff2,a2
	    bsr.s   unpackit
	    moveq   #63,d3                do a blocks of 64
	    movea.l #lowresfont+fontoff3,a2
	    bra.s   unpackit


unpkromanhr moveq   #127,d3               #chars to unpack-1
	    movea.l #$C0000,a2            start at beginning of font storage
	    bsr.s   unpackit
	    moveq   #127,d3               now unpack second half of font
	    movea.l #$C4000,a2
	    bra.s   unpackit

unpkkana    subq    #1,d7
	    moveq   #127,d3               kana8 upper half has 128 chars
	    movea.l #$C8000,a2            store at font storage + 256*128

unpackit    adda.l  screen(a5),a2
	    movea.l a2,a4                 a4 points to font char start addr
	    suba    fontwidth(a5),a4
unpackchar  move    d0,d5                unpack d0 rows/char
	    subq    #1,d5
	    adda    fontwidth(a5),a4      point to char storage start
	    movea.l a4,a2                 make the working copy
unpackrow   moveq   #7,d4                 we need to look at 8 bits/byte
unpackrow2  btst    d4,(a3)               is bit set in font?
	    sne     (a2)+                 set frame buffer byte accordingly
	    dbra    d4,unpackrow2         loop till all 8 bits done
	    addq    #2,a3                 look at next font byte
	    btst    #0,nonsquare(a0)      is this low-res?
	    beq.s   nextrow               if not then do next row
	    moveq   #7,d4                 else do last part of font row
	    moveq   #3,d6
unpackrow3  btst    d4,(a3)
	    sne     (a2)+
	    subq    #1,d4
	    dbra    d6,unpackrow3
	    addq    #2,a3                 point to next font byte
nextrow     adda    #width,a2           adjust storage pointer
	    suba    fontwidth(a5),a2
	    dbra    d5,unpackrow          and loop till rows in char done
	    dbra    d3,unpackchar         loop till all chars done
	    rts                           go look at next font



ginitblock  moveq    #0,d1                  clear some regs
	    moveq    #0,d0
	    move.b   2(a1),d0               get word count to initialize
	    movep    4(a1),d1               form destination offset
	    add.l    a0,d1                  d1 points to dest addr
	    lea      8(a1),a2               a2 points to first data byte
	    movea.l  d1,a3                  a3 points to destination
	    btst     #0,(a1)                is this a bit test block?
	    bne.s    ginitbtst              if so go handle it
ginitloop   movep    0(a2),d1                form a data word in d1
	    move.w   d1,(a3)+               move data to the destination addr
	    btst     #6,(a1)                increment data pointer
	    bne.s    ginit1                 based on control byte
	    addq     #4,a2
ginit1      dbra     d0,ginitloop           loop till word count exhausted
	    btst     #7,(a1)                was this last block?
	    bne.s    ginitdone              yes -- go return
	    btst     #6,(a1)                adjust data pointer
	    beq.s    ginit2                 to point to next init block
ginit3      addq     #4,a2
ginit2      movea.l  a2,a1                  a1 points to new init block
	    bra      ginitblock             do the initialize
ginitdone   rts

ginitbtst   moveq    #0,d2                  handle bit test blocks here
	    move.b   2(a2),d2               d2 = bit # to test
ginittst2   move     (a3),d3                d3 = data word to test
	    btst     #0,(a2)                check for sense of test
	    bne.s    ginittst3              comp if waiting for 0
	    not      d3
ginittst3   btst     d2,d3                  check the bit
	    beq      ginittst2              if not 1 then loop
	    btst     #7,(a1)                was this last block?
	    bne      ginitdone              if so then return
	    bra      ginit3                 else do next block
*
*
cmaptable   equ      *                      initial color map contents (r,g,b)
	    dc.b     0,0,0                  0
	    dc.b     255,255,255            1
	    dc.b     255,0,0                2
	    dc.b     255,255,0              3
	    dc.b     0,255,0                4
	    dc.b     0,255,255              5
	    dc.b     0,0,255                6
	    dc.b     255,0,255              7
	    dc.b     0,0,0                  8
	    dc.b     204,187,51             9
	    dc.b     51,170,119             10
	    dc.b     136,102,170            11
	    dc.b     204,68,102             12
	    dc.b     255,102,51             13
	    dc.b     255,119,0              14
	    dc.b     221,136,68             15

first_blk_offset   equ $73000+396      460*1024+(33 chars)
first_blk_width    equ 23     24 words (31 chars + junk)
second_blk_offset  equ $73000+fontoff1
second_blk_width   equ 47     48 words (64 chars)
*
lowreskanafix equ *
	    movep    dispht(a0),d0         move roman font over kana area
	    add      #30,d0
	    move     d0,soy(a0)
	    add      #30,d0
	    move     d0,doy(a0)
	    moveq    #0,d0
	    move     d0,sox(a0)
	    move     d0,dox(a0)
	    move     #width,ww(a0)
	    move     #30,wh(a0)
	    move     #3,wrr(a0)
	    move.b   planemask(a5),wmove(a0)  trigger the move
	    jsr      waitforready
*      move first block
	    lea      block1,a1
	    movea.l  screen(a5),a2
	    adda.l   #first_blk_offset,a2
	    move     #first_blk_width,d4
	    bsr.s    unpk_kana_blk
*      move second block
	    lea      block2,a1
	    movea.l  screen(a5),a2
	    adda.l   #second_blk_offset,a2
	    move     #second_blk_width,d4
*  unpack kana font block
unpk_kana_blk equ *
	    move     #14,d0   setup to move 15 rows
upb0        movea.l  a2,a3    a2=line start, a3=current
	    move     d4,d1    pre-adjusted word count
upb1        moveq    #15,d2   bit pointer
	    move     (a1)+,d3  get data word
upb2        btst     d2,d3    test a bit
	    sne      (a3)+    set byte in font space
	    dbra     d2,upb2   count bits
	    dbra     d1,upb1   count words in row
	    adda     #width,a2  point to next row
	    dbra     d0,upb0   count rows
	    rts

block1  equ    *    KANA CHARS 161-191
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$0001F801
	dc.l    $80000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000606,$00000180,$C0060000,$18000019,$80000001
	dc.l    $80000000,$00018001,$80000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000C06,$00000180,$C0060000
	dc.l    $18000019,$80000001,$80000000,$00018001,$80000007
	dc.l    $FE000000,$00000000,$00000000,$00000000,$7FC0187F
	dc.l    $E3FC7FE7,$FE3FC1FE,$1FE3F87F,$E3C07FC7,$FC60E000
	dc.l    $00018001,$80000000,$0600000C,$06000003,$01800000
	dc.l    $00000000,$00603860,$60600380,$C6060306,$31800C19
	dc.l    $80000061,$86346000,$00018001,$80000E03,$FE3FC030
	dc.l    $3FC0007F,$C7FC1F83,$FC6C67FC,$0660D860,$60600780
	dc.l    $C67FE606,$61800C19,$87860061,$8C186000,$00018001
	dc.l    $80000E00,$0C00C0E0,$30C3FC07,$018C0180,$0C366000
	dc.l    $07871800,$60600D80,$C606000C,$01800C01,$80060181
	dc.l    $80006000,$00018001,$80000000,$18078760,$00C0600F
	dc.l    $01980301,$FC00C000,$06001800,$C0601981,$86060018
	dc.l    $01800C01,$800C0601,$8000C000,$0E018001,$80E00000
	dc.l    $60060060,$0180601B,$01800600,$0C018000,$06001801
	dc.l    $80606181,$86060060,$03000C03,$03181981,$86018000
	dc.l    $0E01801F,$80E00003,$80180060,$0E03FC63,$01807FE7
	dc.l    $FC0E0000,$3800180E,$07FE0183,$1C060380,$1C07FC1C
	dc.l    $03E06060,$FC0E0000,$00000000,$00600000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00C00000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000


block2  equ    *    KANA CHARS 192-255
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $003301E0,$7C07C07C,$07C07C07,$C07C07C0,$7C07C07C
	dc.l    $07C07C07,$C07C07C0,$7C07C07C,$07C07C07,$C07C07C0
	dc.l    $7C07C07C,$07C07C07,$C07C03FC,$00000000,$00001800
	dc.l    $30000000,$06000000,$03000000,$00060000,$00000000
	dc.l    $00001800,$00000000,$00000000,$00000000,$00330330
	dc.l    $40040040,$04004004,$00400400,$40040040,$04004004
	dc.l    $00400400,$40040040,$04004004,$00400400,$40040040
	dc.l    $04004004,$004007FE,$00001C00,$00001800,$30000000
	dc.l    $06000003,$03000000,$00060000,$00003000,$60001800
	dc.l    $00000000,$31800000,$00000000,$00330330,$78078078
	dc.l    $07807807,$80780780,$78078078,$07807807,$80780780
	dc.l    $78078078,$07807807,$80780780,$78078078,$07807807
	dc.l    $807804F2,$1FE3F066,$63FC1807,$FE3FC7FC,$7FC03C01
	dc.l    $83FC7FE1,$E07FE7FC,$3F806000,$63FC7FE3,$F03FC3FC
	dc.l    $31833030,$03F87FE7,$800001E0,$40040040,$04004004
	dc.l    $00400400,$40040040,$04004004,$00400400,$40040040
	dc.l    $04004004,$00400400,$40040040,$04004004,$004004E6
	dc.l    $30603033,$60001F80,$30000006,$01800C18,$C3000063
	dc.l    $30060006,$0040C030,$C0C01860,$18006000,$31833030
	dc.l    $060C6060,$0C000000,$7C07C07C,$07C07C07,$C07C07C0
	dc.l    $7C07C07C,$07C07C07,$C07C07C0,$40040040,$04004004
	dc.l    $00400400,$40040040,$04004004,$004004CE,$6067FE00
	dc.l    $67FE18E0,$30000306,$06000C18,$C3000066,$1806000C
	dc.l    $1F01800D,$87FE18C0,$180067FE,$01833030,$C60C6060
	dc.l    $0C000000,$01C00801,$C03C0240,$3C01C03E,$01C01C01
	dc.l    $C03C01E0,$3C03E03E,$01C00801,$C03C0240,$3C01C03E
	dc.l    $01C01C01,$C03C01E0,$3C03E41E,$06C03000,$60301800
	dc.l    $300000CC,$1F801818,$630000C0,$0C36C018,$00830003
	dc.l    $00C01800,$301FE006,$01833630,$C60C0060,$0C000000
	dc.l    $02201802,$20020240,$20020002,$02202202,$20220200
	dc.l    $22020020,$02201802,$20020240,$20020002,$02202202
	dc.l    $20220200,$220204CE,$01803000,$C0301800,$30000030
	dc.l    $66603030,$63000180,$0C36C3B0,$00060C06,$C0C01800
	dc.l    $3000600C,$01833631,$860C00C0,$18000000,$02A00800
	dc.l    $C00C03E0,$3C03C004,$01C01E03,$E03C0200,$2203C03C
	dc.l    $02A00800,$C00C03E0,$3C03C004,$01C01E03,$E03C0200
	dc.l    $2203C4E6,$06606001,$80601800,$600000CC,$0600C030
	dc.l    $630C0600,$0636C060,$7FC60618,$60C61800,$60006018
	dc.l    $03033633,$060C0186,$30000000,$02200801,$00220040
	dc.l    $02022008,$02200202,$20220200,$22020020,$02200801
	dc.l    $00220040,$02022008,$02200202,$20220200,$220204F2
	dc.l    $3803800E,$03801803,$807FE306,$06070060,$61F83800
	dc.l    $06666018,$0023FC60,$007C1807,$FE7FE0E0,$1C063C3C
	dc.l    $07FC0E07,$C0000000,$01C01C03,$E01C0040,$3C01C010
	dc.l    $01C01C02,$203C01E0,$3C03E020,$01C01C03,$E01C0040
	dc.l    $3C01C010,$01C01C02,$203C01E0,$3C03E7FE,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$000003FC,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
	dc.l    $00000000,$00000000,$00000000,$00000000,$00000000
*
*
*  waitforready:  wait till window mover done
*
*
waitforready equ *
	   move      d0,-(sp)               save a register
	   movea.l   controladdr(a5),a0     get control address base


wait1      move.b    wmove(a0),d0
	   and.b     planemask(a5),d0       mask out unused planes
	   beq.s     waitdone               if clear then we're done
	   move.l    #50,-(sp)              else wait 50 us
	   jsr       delay_timer
	   bra       wait1                  and look again
waitdone   move      (sp)+,d0               restore d0
	   rts
*
*
* savestate: preserve window mover  state
*
*       Uses   a0,a2
*              a0 set to controladdr(a5)
*

savestate   equ *
	    jsr     waitforready
	    movea.l (sp)+,a2     save return addr
	    move    ww(a0),-(sp)
	    move    wh(a0),-(sp)
	    move    sox(a0),-(sp)
	    move    soy(a0),-(sp)
	    move    dox(a0),-(sp)
	    move    doy(a0),-(sp)
	    move    wrr(a0),-(sp)
	    jmp    (a2)
*
* restorestate: restores window mover control regs
*
*           Uses:  a0,a2
*
restorestate  equ *
	    jsr     waitforready
	    movea.l (sp)+,a2    save ret addr
	    move    (sp)+,wrr(a0)
	    move    (sp)+,doy(a0)
	    move    (sp)+,dox(a0)
	    move    (sp)+,soy(a0)
	    move    (sp)+,sox(a0)
	    move    (sp)+,wh(a0)
	    move    (sp)+,ww(a0)
	    jmp     (a2)

*
*
*  procedure cclearall: clears all of visible area
*
cclearall   jsr     savestate
	    bsr     cursoroff   {SFB 9/29/86}
	    moveq   #0,d0
	    move    d0,sox(a0)    setup x,y
	    move    d0,soy(a0)
	    move    d0,dox(a0)
	    move    d0,doy(a0)
	    move    #width,ww(a0) set width
	    movep   dispht(a0),d1 and height
	    move    d1,wh(a0)
	    move    d0,wrr(a0)    set repl rule
	    move.b  planemask(a5),wmove(a0)  do the move
	    jsr     restorestate
	    bsr     cursoron    {SFB 9/29/86}
	    rts
*
*
*   procedure cchar(ord(char),x,y:shortint);
*
cchar    movea.l (sp)+,a4
	 move    (sp)+,d0         d0 =  dest y char offset
	 mulu    fontht(a5),d0    d0 = pixel row offset
	 move    (sp)+,d5         d5 = x char offset
	 mulu    fontwidth(a5),d5   d5 = pixel column offset
	 tst.b   lowres(a5)       check if low res display
	 beq.s   cchar2           if not then no offset
	 add     #32,d5           else need offset to center
	 add     #10,d0           also adjust y offset
cchar2   moveq   #0,d1            d1 will have src y
	 movea.l controladdr(a5),a0
	 movep.w dispht(a0),d1
	 move    (sp)+,d2         d2 = character
	 moveq   #0,d3
	 moveq   #0,d4
	 tst.b   lowres(a5)
	 beq.s   cchres
	 moveq   #6,d7            low res shift count
	 moveq   #$3F,d6          low res mask
	 bra.s   cchfindxy        go find the char in font space
cchres   moveq   #7,d7            hi res shift count
	 moveq   #$7F,d6          hi res mask
cchfindxy equ    *
	 move    d2,d3            copy the character
	 move    d2,d4            to d3 and d4
	 lsr     d7,d3            d3 = src y row number
	 and     d6,d4            d4 = src x offset in chars
	 mulu    fontht(a5),d3    d3 = y pixel location
	 mulu    fontwidth(a5),d4  d4 = x pixel location
	 add     d1,d3            add in y offset
	 jsr     savestate        preserve window mover state
	 move    d3,soy(a0)
	 move    d4,sox(a0)       set up src location
	 move    d0,doy(a0)       and dest location
	 move    d5,dox(a0)
	 move    fontht(a5),wh(a0)  set up window size
	 move    fontwidth(a5),ww(a0)
	 move    #0,wrr(a0)       first clear the destination
	 moveq   #0,d3
	 move.b  highlight(a5),d3   get highlight byte
	 lsr     #4,d3              shift to get color mask
	 and     #7,d3
	 addq    #1,d3              get actual pen number
	 not     d3                 set all unused planes to 0
	 move.b  d3,wmove(a0)       trigger the move
	 jsr     waitforready
	 move    #3,wrr(a0)         setup rule to replace
	 btst    #0,highlight(a5)   inverse video?
	 beq.s   ccharb             if not, skip next instruction
	 move    #12,wrr(a0)        else set repl rule to invert
ccharb   not     d3                   get actual pen number
	 move.b  d3,wmove(a0)        make this the frames to move
	 btst    #2,highlight(a5)     underline?
	 beq.s   cchar1               no, skip next part
	 jsr     waitforready
	 add     fontht(a5),d0
	 subq    #1,d0                get y pos for underline
	 mulu    #width,d0            convert to address
	 add.l   d5,d0                add in x offset
	 movea.l screen(a5),a1        get frame buffer start
	 adda.l  d0,a1                point a1 to underline row
*        bsr     cursoroff
	 move    fontwidth(a5),d1     setup count for underline
	 subq    #1,d1
	 move    prr(a0),-(sp)        save the prr
	 move    #$600,prr(a0)          set up xor repl rule
cchrul   move.b  d3,(a1)+             place a pixel
	 dbra    d1,cchrul            loop till done
	 move    (sp)+,prr(a0)        restore prr
*        bsr     cursoron

cchar1   bsr     restorestate        restore window state
	 jmp     (a4)
*
*
*   cscrollup;
*
*   scrolls the screen up one line of alpha text
*
cscrollup jsr     savestate      save window mover state
	  bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	  movea.l controladdr(a5),a0
	  move    #0,dox(a0)     set up dest. loc
	  move    #0,doy(a0)
	  move    #0,sox(a0)     set up src loc
	  move    fontht(a5),soy(a0)  start one line width down
	  move    maxy(a5),d2    get lines in screen to move
	  mulu    fontht(a5),d2  get # pixel lines to move
	  move    d2,wh(a0)      set up window size
	  move    #width,ww(a0)
	  move    #3,wrr(a0)     repl rule to replace
	  tst.b   lowres(a5)     check for low res display
	  beq.s   cscroll2       if not then skip
	  addi    #10,soy(a0)    else adjust y offset
	  addi    #10,doy(a0)
cscroll2  move.b  planemask(a5),wmove(a0)  move all planes
*
* Clear bottom line on screen
*
	  jsr     waitforready
	  move    maxy(a5),d2
	  mulu    fontht(a5),d2   d2 = y offset of bottom line
	  move    d2,doy(a0)
	  move    fontht(a5),wh(a0) clear one char line ht
	  move    #0,wrr(a0)        repl rule to clear
	  tst.b   lowres(a5)       check for low res
	  beq.s   cscroll3         if not then skip
	  addi    #10,doy(a0)      else adjust y offset
cscroll3  move.b  planemask(a5),wmove(a0)  clear all planes
	  jsr     restorestate
	  bra     cursoron             turn on 98549A soft cursor SFB 9/24/86
*         rts

*
*    cscrolldown
*
*    scrolls the screen down one text line
*
cscrolldown jsr     savestate
	    bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	    moveq   #0,d0
	    movea.l controladdr(a5),a0
	    move    d0,sox(a0)      set up src origin
	    move    d0,soy(a0)
	    move    d0,dox(a0)      setup dest. origin
	    move    fontht(a5),doy(a0)
	    move    #width,ww(a0)   setup window size
	    move    maxy(a5),d2
	    mulu    fontht(a5),d2
	    move    d2,wh(a0)
	    move    #3,wrr(a0)      setup repl rule
	    tst.b   lowres(a5)      is this low-res display?
	    beq.s   cscroll4        if not then skip
	    addi    #10,doy(a0)     else adjust y offsets
	    addi    #10,soy(a0)
cscroll4    move.b  planemask(a5),wmove(a0) move all planes
	    jsr     waitforready
	    move    soy(a0),doy(a0)
	    move    fontht(a5),wh(a0)
	    move    d0,wrr(a0)
	    move.b  planemask(a5),wmove(a0)
	    jsr     restorestate
	    bra     cursoron             turn on 98549A soft cursor SFB 9/24/86
*           rts

*
* cupdatecursor(x,y:shortint);
*

cupdatecursor equ *
	      movea.l (sp)+,a4     a4 = return addr
	      move    (sp)+,d5     d5 = y in chars
	      move    (sp)+,d4     d4 = x in chars
	      movea.l controladdr(a5),a0
	      mulu    fontht(a5),d5  d5 = y in pixels
	      add     fontht(a5),d5
	      subq    #1,d5        d5 is last line of char
	      mulu    fontwidth(a5),d4  d4 = x in pixels
	      tst.b   lowres(a5)    check if low res
	      beq.s   cupdate2      if not then skip
	      add     #32,d4        else offset x
	      add     #10,d5        and y
cupdate2      move    d5,cay(a0)    do the cursor move
	      move    d4,cax(a0)

	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      subq    #1,d5          d5 is second last line of char
	      mulu    #width,d5      compute memory address
	      add     d4,d5
	      add.l   screen(a5),d5
	      move.l  d5,cursoraddr(a5)
	      bsr     cursoron      turn on 98549A soft cursor SFB 9/24/86

	      jmp     (a4)

*
*  cclear(xpos,ypos,nchars:shortint);
*    -- clears nchars starting at xpos, ypos
*    -- nchars + xpos must not exceed 128
*       no range checking is done
*

cclear        equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      movea.l (sp)+,a4     a4 = return address
	      move    (sp)+,d1     d4 = number of characters to clear
	      move    (sp)+,d3     d3 = y to begin at
	      move    (sp)+,d5     d5 = x
	      move.l  a4,-(sp)     stack return address
	      jsr     savestate    save window mover state
	      mulu    fontht(a5),d3   d3 = y in pixels
	      move    d3,doy(a0)
	      mulu    fontwidth(a5),d5  d5 = x in pixels
	      tst.b   lowres(a5)    check for low res
	      beq.s   cclear2       if not then skip
	      add     #32,d5        else offset x
	      addi    #10,doy(a0)   and y
cclear2       move    d5,dox(a0)    setup dest. x reg
	      move    fontht(a5),wh(a0) setup window size
	      mulu    fontwidth(a5),d1
	      move    d1,ww(a0)
	      moveq   #0,d0
	      move    d0,wrr(a0)    repl rule to clear
	      move    d0,sox(a0)
	      move    d0,soy(a0)
	      move.b  planemask(a5),wmove(a0) use all planes
	      jsr     restorestate
*             bra     cursoron      turn on 98549A soft cursor SFB 9/24/86
*             rts


cursoron      equ     *               enable cursor
	      tst.b   softcursor(a5)
	      bne.s   softon
	      movea.l controladdr(a5),a0
	      move.b  planemask(a5),curon(a0)
	      rts
softon        equ     *
	      movea.l cursoraddr(a5),a0
	      movem.l (a0),d0-d1
	      movem.l d0-d1,holdcursor(a5)
	      movem.l width(a0),d0-d1
	      movem.l d0-d1,holdcursor+8(a5)
	      moveq   #-1,d0
	      move.l  d0,d1
	      movem.l d0-d1,(a0)
	      movem.l d0-d1,width(a0)
	      rts


cursoroff     equ     *               disable cursor
	      tst.b   softcursor(a5)
	      bne.s   softoff
	      movea.l controladdr(a5),a0
	      move.b  #0,curon(a0)
	      rts
softoff       equ     *
	      movea.l cursoraddr(a5),a0
	      movem.l holdcursor(a5),d0-d1
	      movem.l d0-d1,(a0)
	      movem.l holdcursor+8(a5),d0-d1
	      movem.l d0-d1,width(a0)
	      rts

cshiftleft    equ     *
	      jsr     savestate       save window mover state
	      moveq   #0,d1             d1 = dest x location
	      move    fontwidth(a5),d2  d2 = src x location
cshift1       moveq   #1,d0        get pointer to last line of screen
	      add     maxy(a5),d0
	      mulu    fontht(a5),d0   d0 = y origin of typeahead
	      tst.b   lowres(a5)        check if lowres
	      beq.s   cshlhres          if not then skip
	      add     #32,d1            else offset x
	      add     #32,d2            locations
	      add     #10,d0            and y locations

cshlhres      move    d1,dox(a0)
	      move    d2,sox(a0)
	      move    d0,doy(a0)      setup destination and src loc
	      move    d0,soy(a0)
	      moveq   #-8,d1       get # chars in length to move
	      add     maxx(a5),d1  d1 now has # chars to move
	      mulu    fontwidth(a5),d1  d1 now has width in pixels
	      move    d1,ww(a0)
	      move    fontht(a5),wh(a0)  height is one char row
	      move    #3,wrr(a0)         setup replacement rule
	      move.b  planemask(a5),wmove(a0)    do all planes
	      bsr     restorestate   fix replacement rule reg and return
	      rts

cshiftright   equ     *
	      jsr     savestate
	      moveq   #0,d2           src x location
	      move    fontwidth(a5),d1  dest x location
	      bra     cshift1      now do same stuff as shift left


*  procedure cexchange(savearea: windowp; ymin, ymax, xmin, width: shortint);

cexchange     movea.l (sp)+,a4     a4 = return addr
	      move    (sp)+,d0     width of window in pixels in d0
	      lsr     #2,d0        d0=window width in long integers
	      subq    #1,d0        setup for later looping
	      move    (sp)+,d4     d4 = x offset in chars
	      mulu    fontwidth(a5),d4      d4 = x offset in pixels
	      move    (sp)+,d5     d5 = ymax
	      move    (sp)+,d1     d1 = ymin
	      movea.l (sp)+,a1     a1 = ptr to save area
	      sub     d1,d5
	      addq    #1,d5        d5 has # of char rows to move
	      mulu    fontht(a5),d5  now has # of pixel rows to move
	      subq    #1,d5       setup for outer loop
	      mulu    fontht(a5),d1    d1 = y offset in pixels
	      mulu    #width,d1        d1 = y address offset
	      bsr     savestate
*             bsr     cursoroff
	      move    prr(a0),-(sp)
	      move    #$300,prr(a0)  setup pixel repl rule
	      movea.l screen(a5),a0 a0 points to frame buffer start
	      adda.l  d1,a0         now points to correct row
	      adda    d4,a0         do x offset into row
	      tst.b   lowres(a5)    is this low res?
	      beq.s   cexchg2       if not then skip
	      adda    #32,a0        else adjust x offset
	      adda    #10240,a0     and y offset
cexchg2       movea.l a0,a2         make a working copy
	      move    d0,d7         initialize inner loop
cexchg3       move.l  (a2),d6       screen to temp
	      move.l  (a1),(a2)+    save area to screen
	      move.l  d6,(a1)+      temp to save area
	      dbra    d7,cexchg3    inner loop (pixel row move)
	      adda.l  #width,a0     bump row pointer
	      dbra    d5,cexchg2    outer loop (row count)
	      movea.l controladdr(a5),a0
	      move    (sp)+,prr(a0)
*             bsr     cursoron
	      bsr     restorestate  restore control regs
	      jmp     (a4)          done


* procedure cscrollwindow( ymin, ymax, xmin, width: shortint);

cscrollwindow equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #0,d6          set upscroll flag in d6
cscrollwindc  movea.l (sp)+,a4       a4 = return addr
	      move    (sp)+,d1       d1 = width in chars
	      mulu    fontwidth(a5),d1     d1 = width in pixels
	      move    (sp)+,d0       d0 = x offset of window in chars
	      mulu    fontwidth(a5),d0      d0 = x offset in pixels (bytes)
	      move    (sp)+,d2       d2 = ymax
	      move    (sp)+,d3       d3 = ymin
	      sub     d3,d2          d2 has # of char rows to move
	      mulu    fontht(a5),d2  now d2 has height to move
	      mulu    fontht(a5),d3  d3 = y offset in bytes of origin
	      jsr     savestate
	      tst     d6             check up/down flag
	      bne.s   cscrollwindb    and branch if dn
	      move    d3,doy(a0)     set ymin to dest y origin
	      add     fontht(a5),d3
	      move    d3,soy(a0)     one row down is src y origin

cscrollwin1   tst.b   lowres(a5)     is this low res?
	      beq.s   cscrollwin2    if not then skip
	      add     #32,d0         else adjust x offset
	      addi    #10,soy(a0)    and y offsets
	      addi    #10,doy(a0)
cscrollwin2   move    d1,ww(a0)      setup width reg
	      move    d2,wh(a0)      setup height reg
	      move    d0,sox(a0)     setup x coordinates
	      move    d0,dox(a0)
	      move    #3,wrr(a0)
	      move.b  planemask(a5),wmove(a0)   all planes
	      bsr     restorestate
	      bsr     cursoron      turn on 98549A soft cursor SFB 9/24/86
	      jmp     (a4)


cscrollwindb  move    d3,soy(a0)      ymin = src y origin
	      add     fontht(a5),d3
	      move    d3,doy(a0)      one row down is dest y
	      bra     cscrollwin1

cscrollwinddn equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #1,d6          set down scroll flag
	      bra     cscrollwindc    go to common code





cdbscrolll    equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #0,d6          set left scroll flag
cdbscrollb    movea.l (sp)+,a4       pickup return addr
	      move    (sp)+,d1       width in chars
	      subq    #1,d1          actual width to move is 1 less
	      mulu    fontwidth(a5),d1  width in pixels in d1
	      move    (sp)+,d0       x offset in chars
	      mulu    fontwidth(a5),d0  d0 = x offset in pixels
	      move    (sp)+,d5       d5 = ymax
	      move    (sp)+,d3       d3 = ymin
	      sub     d3,d5
	      addq    #1,d5          d5 = # char rows to move
	      mulu    fontht(a5),d5  d5 = # pixel rows to move
	      mulu    fontht(a5),d3  d3 = y window start offset
	      tst.b   lowres(a5)     is this low res?
	      beq.s   cdbscrolld     if not then skip
	      add     #32,d0         else offset x
	      add     #10,d3         and y origins
cdbscrolld    jsr     savestate      save window mover state
	      tst     d6             check left/right flag
	      bne.s   cdbscroll2     if right, skip
	      move    d0,dox(a0)     if left xmin= dest x
	      add     fontwidth(a5),d0
	      move    d0,sox(a0)     and src is 1 char to rt
cdbscrollc    move    d1,ww(a0)      setup width reg
	      move    d5,wh(a0)      setup height reg
	      move    d3,soy(a0)     y is same for src and dest
	      move    d3,doy(a0)
	      move    #3,wrr(a0)    setup repl rule
	      move    planemask(a5),wmove(a0)   all planes
	      bsr     restorestate
	      bsr     cursoron      turn on 98549A soft cursor SFB 9/24/86
	      move.l  a4,-(sp)
	      rts                    finished!

cdbscroll2    move    d0,sox(a0)     xmin is src x for rt move
	      add     fontwidth(a5),d0
	      move    d0,dox(a0)     dest is 1 char to rt
	      bra     cdbscrollc     goto common code





cdbscrollr    equ     *
	      bsr     cursoroff      turn off 98549A soft cursor SFB 9/24/86
	      moveq   #1,d6          set right shift flag
	      bra     cdbscrollb     go to common code

	      end
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.2
log
@No change. Checked in as companion to BCCRT, which changed. Scott.
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@@


5.2
log
@Changes from Scott Bayes
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@d32 3
a37 1

d221 3
a223 1
	    rts
d251 1
d253 1
d262 3
a264 1
	    move    d2,cmapred(a0)     stuff the rgb regs
d266 1
d268 1
d270 2
a271 1
	    nop                           kludge for NERIED
d604 1
d616 1
d683 1
a683 1
	 bsr     cursoroff
d691 1
a691 1
	 bsr     cursoron
d702 1
d732 2
a733 1
	  rts
d741 1
d764 2
a765 1
	    rts
d786 9
d805 1
d829 2
a830 1
	      rts
d834 2
d839 11
d853 2
d858 7
d918 1
a918 1
	      bsr     cursoroff
d938 1
a938 1
	      bsr     cursoron
d946 1
d977 1
d987 1
d996 1
d1027 1
d1041 1
@


4.1
log
@Automatic bump of revision number for PWS version 3.2i
@
text
@@


3.1
log
@Automatic bump of revision number for PWS version 3.2h
@
text
@@


2.1
log
@Auto bump rev number to 2.1 for sys 3.2e.
@
text
@@


1.1
log
@Initial revision
@
text
@@
