* Demo06.a      Version 1.00   July 20, 2000   by Ken Shillito


*
*  This program demonstrates advanced programming of ucode.library
*  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*  It...  (1) opens a window
*         (2) creates a blank ucode_preview
*         (3) calls TLUpreview to fill the ucode_preview
*         (4) calls TLUformat to format the ucode_preview into lines
*         (5) calls TLUprit to print the ucode_preview lines
*         (3) waits for the user to click the close window gadget
*         (4) shuts down
*
*  (Caution: If the program fails, it does not report why, but just exits)

 IFND what
 INCLUDE 'exec/types.i'
 INCLUDE 'UCODE:Includes/ucode.i'
 INCLUDE 'UCODE:Includes/ucodeasms.i'
 ENDC

 INCLUDE 'dos/dosextens.i'
 INCLUDE 'intuition/intuition.i'


 XREF _AbsExecBase
 XREF _LVOCloseLibrary
 XREF _LVOCloseWindow
 XREF _LVOFindTask
 XREF _LVOForbid
 XREF _LVOGetMsg
 XREF _LVOOpenLibrary
 XREF _LVOOpenWindowTagList
 XREF _LVOReplyMsg
 XREF _LVOWaitPort


***************************************************************************
*
*                 First, do setting up
*                 ~~~~~~~~~~~~~~~~~~~~
***************************************************************************



***********  Setting up Step 1: Process Startup  **************

Start:                     ;cold startup...
 clr.l bench               ;(bench will 0 if started from CLI)
 move.l _AbsExecBase,a6
 sub.l a1,a1               ;for current task..
 jsr _LVOFindTask(a6)      ;.. find own Process structure
 move.l d0,a2              ;(A2) = our own Process structure
 tst.l pr_CLI(a2)          ;pr_CLI<>0 if from CLI
 bne.s Both                ;go if from CLI

 lea pr_MsgPort(a2),a0     ;wait for workbench startup message to arrive
 jsr _LVOWaitPort(a6)
 lea pr_MsgPort(a2),a0     ;get workbench startup message now it's here
 jsr _LVOGetMsg(a6)
 move.l d0,bench           ;remember the message, for replying &c (bench<>0)


*******   Setting up Step 2: open ucode.library *************

Both:

 IFND what
 lea uname,a1
 moveq #xxp_uver,d0
 jsr _LVOOpenLibrary(a6)
 move.l d0,ubase
 beq Quit0
 ENDC

 IFD what
 IFEQ what-3
 lea uname,a1
 moveq #xxp_uver,d0
 jsr _LVOOpenLibrary(a6)
 move.l d0,ubase
 beq Quit0
 ENDC
 IFEQ what-4
 move.l #Endcode+24,ubase  ;only assemble this if debugging
 ENDC
 ENDC


******** Setting up Step 3: make ucode_path structure   *********

 move.l ubase,a6           ;a6 = base of ucode.library
 moveq #0,d0               ;d0 = 0 = same bitplanes as default public screen
 moveq #0,d1               ;d1,d2 = 0 = no ucode_tilp structure
 moveq #0,d2
 jsr _LVOTLUstart(a6)      ;create ucode_path
 tst.l d0
 move.l d0,upath           ;address of ucode_path to upath
 beq Quit1                 ;quit if can't


****** Setting up Step 4: make a ucode_preview structure  *******

 move.l ubase,a6           ;a6 = base of ucode.library
 moveq #ucode_preview,d0   ;d0 = type of structure to make
 move.l #500000,d1         ;d1 = parameter = size in bytes
 move.l upath,a0           ;a0 = ucode_path
 jsr _LVOTLUmake(a6)       ;create ucode_preview
 move.l d0,uprev           ;cache its address in uprev
 beq Quit2                 ;quit if out of memory


***************  Setting up Step 5: open window *****************

 move.l upath,a0           ;get intuition.library base from ucode_path
 move.l xxp_intp(a0),a6

 sub.w #128,a7             ;room for 15 tags
 move.l a7,a0
 move.l #WA_Left,(a0)+      ;xpos = 20
 move.l #20,(a0)+
 move.l #WA_Top,(a0)+       ;ypos = 10
 move.l #10,(a0)+
 move.l #WA_Width,(a0)+     ;init width = 600
 move.l #600,(a0)+
 move.l #WA_Height,(a0)+    ;init height = 236    Make window fixed size to
 move.l #236,(a0)+          ;                     make example simpler.
 move.l #WA_MinWidth,(a0)+
 move.l #600,(a0)+
 move.l #WA_MinHeight,(a0)+
 move.l #236,(a0)+
 move.l #WA_MaxWidth,(a0)+
 move.l #600,(a0)+
 move.l #WA_MaxHeight,(a0)+
 move.l #236,(a0)+
 move.l #WA_CloseGadget,(a0)+ ;+ close gadget
 move.l #-1,(a0)+
 move.l #WA_SizeGadget,(a0)+  ;+ size gadget
 move.l #-1,(a0)+
 move.l #WA_DragBar,(a0)+   ;+ drag bar
 move.l #-1,(a0)+
 move.l #WA_Activate,(a0)+ ;open active
 move.l #-1,(a0)+
 move.l #WA_IDCMP,(a0)+
 move.l #IDCMP_CLOSEWINDOW,(a0)+ ;+ close window
 move.l #WA_Title,(a0)+
 move.l #wnam,(a0)+        ;title = *wnam
 clr.l (a0)                ;delimit tags
 sub.l a0,a0               ;a0 = 0 = no NewWindow structure
 move.l a7,a1              ;a1 = tags
 jsr _LVOOpenWindowTagList(a6)   ;open the window
 add.w #128,a7             ;discard tags
 move.l d0,wndw            ;wndw = address of window
 beq Quit2                 ;quit if can't open window


***************************************************************************
*
*            Setting up is complete - now do something
*            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***************************************************************************


******************  Step 1: set ucode_path attributes  ********************

; The string to be displayed below will be grabbed from data files named
; "Ucode/Uni/U0B/NMSS1??".  The "0B" in the "U0B" sub-directory
; means the glyphs are of nominal height 11 ($0B=11). Files of nominal
; height 11 have "actual" height of 14 (for details, see ucode.guide). The
; "NM" means width = normal, which means the width code (which can be
; 0-8) is 4. The "SS" means "Sans Serif" style. The "1" means the weight
; code (which can be 1 to 9) is 1. The "??" stands for glyphs in 1024 byte
; blocks whose 1st 2 digits can be 00, 04, 08, ..... F4, F8, FC.


 move.l ubase,a6           ;a6 = base of ucode.library
 move.l upath,a0           ;a0 = ucode_path
 moveq #11,d0              ;d0 = nominal height = 11
 moveq #4,d1               ;d1 = width = 4 = NM = normal
 move.w #'SS',d2           ;d2 = style = SS = sans serif
 moveq #1,d3               ;d3 = weight = 1

 moveq #xxp_bmake,d4       ;flag ucode_block list in a1

 move.w #$0600,d5          ;ucode_group incorp $0600 Arabic (0400 - 07FF)

 sub.w #20,a7              ;build ucode_blok data in stack

 move.l a7,a1
 move.w #$0021,(a1)+       ;common Latin glyphs 0021-007E
 move.w #$007E,(a1)+
 move.w #$0621,(a1)+       ;common Arabic glyphs 0621-064A
 move.w #$064A,(a1)+
 move.w #$FB50,(a1)+       ;common Arabic presentation forms FB50-FBB1
 move.w #$FBB1,(a1)+
 move.l a7,a1
 jsr _LVOTLUset(a6)

 add.w #20,a7              ;discard ucode_blok data


***************   Step 2: sort the strings into boxes   *******************


; First, TLUpreview must be called, to put character-by-character data
; into the ucode_preview. A set of tags must be supplied, and of course
; the address of the string to be printed. The input strings at *utext
; are in UTF16 format.


 move.w #1,whic            ;whic = 1 = printing 1st window-full
 move.l #utext,d0          ;address of text to be shown


Pick:
 move.l ubase,a6           ;A6 = base of ucode.library
 move.l uprev,d1           ;D1 = ucode_preview
 move.l upath,d2           ;D2 = ucode_path

 sub.w #12,a7              ;make tag list
 move.l a7,a0
 move.l #xxp_xfrmt,(a0)+   ;xfrmt = +1 = UTF16
 move.l #1,(a0)+
 clr.l (a0)
 move.l a7,a0              ;A0 = tag list

 jsr _LVOTLUpreview(a6)    ;do the preview
 add.w #12,a7              ;discard the taglist
 tst.l d0
 beq Quit3                 ;quit if TLUpreview fails (unlikely)


**************  Step 3: divide the preview into lines ******************

; After TLUpreview, the ucode_preview must be divided up into lines.
; The same ucode_preview may be repeatedly called, e.g. to divide a
; page into many little boxes, to experiment with box widths, &c.


 move.l ubase,a6           ;A6 = base of ucode.library
 move.l wndw,a0
 moveq #0,d0
 move.b wd_BorderLeft(a0),d0  ;d0 = line box width = wndw interior wdth - 4
 add.b wd_BorderRight(a0),d0
 neg.w d0
 add.w wd_Width(a0),d0
 subq.w #4,d0
 moveq #10,d1              ;D1 = word spacing = 10 pixels between words
 moveq #2,d2               ;D2 = character spacing = 2
 moveq #0,d3               ;D3 = bit 10 set = code for right justify
; bset #10,d3              ;( un-comment to right justify, since Arabic)
 moveq #0,d4               ;D4 = 0 = default tabs set
 moveq #0,d5               ;D5 = 0 = start from line 0
 move.l uprev,a0           ;A0 = ucode_preview

 jsr _LVOTLUformat(a6)     ;format the ucode_preview into lines
 tst.l d0
 beq Quit3                 ;go if TLUformat failed (out of mem)


*********  Step 4: Keep printing, until all lines printed **********

; Finally, to display the string, call TLUprint. You can intersperse
; TLUformat calls with TLUprint to re-format line boxes progressively, if
; you wish. The ypos can be progressively increased for each TLUprint call,
; until all lines are printed. TLUprint returns with D0 = the height of the
; line just printed.

; The first call to TLUprint normally starts from line 0, and each call
; will be to a successive line. However you can supply tags to jump to
; other lines at any time.

; You will need some knowledge of ucode_preview's internal structure to use
; TLUprint - the structure is found in ucode.i

; Normally, you would use constant line spacing, e.g. xxp_pwhl + 1. But as
; the lines below are a rag-tag collection, I have used variable line
; spacing.


; make room in stack for wint, wbox

 sub.w #16,a7              ;a7 = wint, a7+8 = wbox

; make wint

 move.l wndw,a0
 moveq #0,d0
 move.b wd_BorderLeft(a0),d0
 move.w d0,(a7)
 add.b wd_BorderRight(a0),d0
 move.w wd_Width(a0),d1
 sub.w d0,d1
 move.w d1,4(a7)
 move.b wd_BorderTop(a0),d0
 move.w d0,2(a7)
 add.b wd_BorderBottom(a0),d0
 move.w wd_Height(a0),d1
 sub.w d0,d1
 move.w d1,6(a7)

; make wbox at stack + 8 = (2, 1, wint wdth - 4, wint height -2)

 move.w #2,8+0(a7)
 move.w #1,8+2(a7)
 move.w 4(a7),d0
 subq.w #2,d0
 move.w d0,8+4(a7)
 move.w 6(a7),d0
 subq.w #2,d0
 move.w d0,8+6(a7)

 moveq #0,d1               ;initial ypos = 0
 move.l a7,d2
 addq.l #8,d2              ;d2 = wbox
 move.l a7,d3              ;d3 = wint
 moveq #2,d4               ;d4 = jam2
 moveq #1,d5               ;d5 = fgpen
 moveq #0,d6               ;d6 = bgpen
 moveq #0,d7               ;d7 = 0 = default uderline data
 move.l upath,a0           ;a0 = ucode_path
 move.l wndw,a1
 move.l wd_RPort(a1),a1    ;a1 = wndw's rastport
 move.l uprev,a2           ;a2 = ucode_preview
 move.l ubase,a6           ;a6 = ucode.library base

line:                      ;Print next line ...
 moveq #0,d0
 jsr _LVOTLUprint(a6)      ;print the line
 add.w d0,d1
 addq.w #2,d1              ;bump ypos by line height + 1

 move.l xxp_linc(a2),d0    ;d0 = address of next line printed  (rel to a2)
 cmp.l xxp_linf(a2),d0     ;is d0 >= end of last line?
 bcs line                  ;no, go print next

 add.w #16,a7              ;discard wint, wbox


*********  Step 5: Wait until user clicks the CloseWindow gadget **********

.step5:
 move.l _AbsExecBase,a6
 move.l wndw,a2
 move.l wd_UserPort(a2),a0 ;(i.e. get IDCMP_CloseWindow & reply to it)
 jsr _LVOWaitPort(a6)
 move.l wd_UserPort(a2),a0
 jsr _LVOGetMsg(a6)
 tst.l d0
 beq .step5
 move.l d0,a1
 jsr _LVOReplyMsg(a6)


***********************   Step 6: Clear window   ***************************

 move.l upath,a0
 move.l xxp_gfxp(a0),a6    ;a6 = graphics.library base
 move.l wndw,a0
 move.l wd_RPort(a0),a1    ;a1 = window's rastport
 moveq #0,d2
 moveq #0,d3               ;d3-d5 = window interior
 moveq #0,d4
 moveq #0,d5
 move.b wd_BorderRight(a0),d2
 move.w wd_Width(a0),d4
 sub.w d2,d4
 subq.w #1,d4
 move.b wd_BorderLeft(a0),d2
 move.b wd_BorderBottom(a0),d3
 move.w wd_Height(a0),d5
 sub.w d3,d5
 subq.w #1,d5
 move.b wd_BorderTop(a0),d3
 move.l d4,d0              ;scroll contents off
 moveq #0,d1
 jsr _LVOScrollRaster(a6)


************   Step 7:  Recycle until all 3 window-fulls shown   ***********

 move.w whic,d1            ;quit if just did 1st window-full
 cmp.w #3,d1
 beq.s Quit3

 move.l #utex2,d0          ;go do 2nd window if just did first
 move.w #2,whic
 cmp.w #1,d1
 beq Pick

 move.l #utex3,d0          ;go do 3rd window if just did second
 move.w #3,whic
 bra Pick


***************************************************************************
*
*                  Finally, close everything down
*                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***************************************************************************


*****   Close window  *****

Quit3:
 move.l upath,a0
 move.l xxp_intp(a0),a6
 move.l wndw,a0
 jsr _LVOCloseWindow(a6)


*****   Release ucode.library structures  *****

Quit2:
 move.l ubase,a6
 move.l upath,a0
 jsr _LVOTLUfinish(a6)


*****   Close ucode.library  *******

Quit1:

 IFND what
 move.l _AbsExecBase,a6
 move.l ubase,a1
 jsr _LVOCloseLibrary(a6)
 ENDC

 IFD what
 IFEQ what-3
 move.l _AbsExecBase,a6
 move.l ubase,a1
 jsr _LVOCloseLibrary(a6)
 ENDC
 ENDC


******  Exit from Program  *******

Quit0:                     ;reply to workbench startup message if any
 move.l _AbsExecBase,a6
 move.l bench,d2
 beq.s Quit
 jsr _LVOForbid(a6)
 move.l d2,a1
 jsr _LVOReplyMsg(a6)
Quit:
 rts


***************************************************************************
*
*                           Data Section
*                           ~~~~~~~~~~~~
***************************************************************************


* system data
bench: ds.l 1             ;bench = 0 if CLI, else = workbench message
ubase: ds.l 1             ;ucode.library base
uname: dc.b 'UCODE:ucode.library',0
 ds.w 0


* window data
wnam: dc.b 'Ucode Test Asm Window',0
 ds.w 0
wndw: ds.l 1                ;window structure
dims: ds.l 4                ;window interior dims


* ucode.library structures
upath: ds.l 1               ;ucode_path
uprev: ds.l 1               ;ucode_preview


* text to be printed

whic: ds.w 1                ;will be 1/2/3 for window-full being done


*************************   1st window-full   *****************************

utext:

; Latin diac merging

 dc.w $0041,$0302,$0300,$0020,$0041,$0302,$0301,$0020,$0041,$0302,$0309
 dc.w $0041,$0306,$0300,$0020,$0041,$0306,$0301,$2028

; Greek diac merging

 dc.w $03B1,$0020,$03B1,$0313,$0020,$03B1,$0314,$0020
 dc.w $03B1,$0300,$0020,$03B1,$0301,$0020
 dc.w $03B1,$0313,$0300,$0020,$03B1,$0301,$0313,$0020
 dc.w $03B1,$0314,$0300,$0020,$03B1,$0314,$0301,$0020
 dc.w $03B1,$0342,$0020,$03B1,$0313,$0342,$0020,$03B1,$0314,$0342,$0020
 dc.w $03B1,$0301,$0342,$0020,$03B1,$0342,$0300,$0020
 dc.w $03B1,$0313,$0301,$0342,$0020
 dc.w $03B1,$0342,$0314,$0300,$2028

 dc.w $0391,$0020,$0391,$0313,$0020,$0391,$0314,$0020
 dc.w $0391,$0300,$0020,$0391,$0301,$0020
 dc.w $0391,$0313,$0300,$0020,$0391,$0301,$0313,$0020
 dc.w $0391,$0314,$0300,$0020,$0391,$0314,$0301,$0020
 dc.w $0391,$0342,$0020,$0391,$0313,$0342,$0020,$0391,$0314,$0342,$0020
 dc.w $0391,$0301,$0342,$0020,$0391,$0342,$0300,$0020
 dc.w $0391,$0313,$0301,$0342,$0020
 dc.w $0391,$0342,$0314,$0300,$2028

; Hebrew

; points + marks

 dc.w $05D0,$05B9,$059F,$0020
 dc.w $05D0,$05BC,$05B9,$0599,$0020
 dc.w $05D0,$05B0,$05A4,$0020
 dc.w $05D0,$05B0,$059A,$0020
 dc.w $05D0,$05B0,$05AD,$0020
 dc.w $05D0,$05BC,$05B9,$05BD,$0020
 dc.w $05D0,$05B0,$05BD,$0020
 dc.w $05D0,$05B9,$059F,$05BD,$0020
 dc.w $05D0,$05B9,$0599,$05BD,$0020
 dc.w $05D0,$05B0,$05A4,$05BD,$0020
 dc.w $05D0,$05B0,$059A,$05BD,$0020
 dc.w $05D0,$05B0,$05AD,$05BD,$2028

 dc.w $05DC,$05B9,$059F,$0020
 dc.w $05DC,$05BC,$05B9,$0599,$0020
 dc.w $05DC,$05B0,$05A4,$0020
 dc.w $05DC,$05B0,$059A,$0020
 dc.w $05DC,$05B0,$05AD,$0020
 dc.w $05DC,$05BC,$05B9,$05BD,$0020
 dc.w $05DC,$05B0,$05BD,$0020
 dc.w $05DC,$05B9,$059F,$05BD,$0020
 dc.w $05DC,$05B9,$0599,$05BD,$0020
 dc.w $05DC,$05B0,$05A4,$05BD,$0020
 dc.w $05DC,$05B0,$059A,$05BD,$0020
 dc.w $05DC,$05B0,$05AD,$05BD,$2028

 dc.w $05E9,$05B9,$059F,$0020
 dc.w $05E9,$05C1,$05B9,$0599,$0020
 dc.w $05E9,$05C2,$05B0,$05A4,$0020
 dc.w $05E9,$05C1,$05BC,$05B0,$059A,$0020
 dc.w $05E9,$05C2,$05BC,$05B0,$05AD,$0020
 dc.w $05E9,$05B9,$05BD,$0020
 dc.w $05E9,$05C1,$05B0,$05BD,$0020
 dc.w $05E9,$05C2,$05B9,$059F,$05BD,$0020
 dc.w $05E9,$05C1,$05BC,$05B9,$0599,$05BD,$0020
 dc.w $05E9,$05C2,$05BC,$05B0,$05A4,$05BD,$0020
 dc.w $05E9,$05B0,$059A,$05BD,$0020
 dc.w $05E9,$05B0,$05AD,$05BD,$05BF,$2028

; terminal forms

 dc.w $05D0,$0020
 dc.w $05DE,$0020,$05DE,$05D0,$0020,$05D0,$05DE,$0020
 dc.w $05DB,$05D0,$0020,$05D0,$05DB,$0020
 dc.w $05E0,$05D0,$0020,$05D0,$05E0,$0020
 dc.w $05E4,$05D0,$0020,$05D0,$05E4,$0020
 dc.w $05E6,$05D0,$0020,$05D0,$05E6,$2028

; combining diacs

 dc.w $05E9,$05E9,$05C1,$05E9,$05C2,$05E9,$05C1,$05BC,$05E9,$05C2,$05BC
 dc.w $05E9,$05BC,$05C1,$05E9,$05BC,$05C2
 dc.w $05E9,$05C1,$05B9,$05E9,$05C2,$05B9,$0020
 dc.w $05D1,$05D1,$05BF,$05E4,$05E4,$05BF,$05D4,$05D4,$05BF,$0020
 dc.w $05D5,$05D5,$05B9,$05D0,$05B9,$2028

; dagesh/mappiq

 dc.w $05D0,$05D1,$05D2,$05D3,$05D4
 dc.w $05D5,$05D6,$05D8,$05D9,$05DA
 dc.w $05DB,$05DC,$05DE,$05E0,$05E1
 dc.w $05E3,$0020,$05E4,$05E6,$05E7,$05E8
 dc.w $05E9,$05EA,$2028

 dc.w $05D0,$05BC,$05D1,$05BC,$05D2,$05BC,$05D3,$05BC,$05D4,$05BC
 dc.w $05D5,$05BC,$05D6,$05BC,$05D8,$05BC,$05D9,$05BC,$05DA,$05BC
 dc.w $05DB,$05BC,$05DC,$05BC,$05DE,$05BC,$05E0,$05BC,$05E1,$05BC
 dc.w $05E3,$05BC,$0020,$05E4,$05BC,$05E6,$05BC,$05E7,$05BC,$05E8,$05BC
 dc.w $05E9,$05BC,$05EA,$05BC,$2028

; vowel points

 dc.w $05D1,$05B0,$05D1,$05B1,$05D1,$05B2,$05D1,$05B3,$05D1,$05B4
 dc.w $05D1,$05B5,$05D1,$05B6,$05D1,$05B7,$05D1,$05B8,$05D1,$05B9
 dc.w $05D1,$05BB,$0020,$0020

; metheg

 dc.w $05D1,$05BD,$05D1,$05B0,$05BD,$05D1,$05BD,$05B9,$05D1,$05BD,$05BB
 dc.w $2028

; cantillation marks

 dc.w $05D1,$05A9,$05D1,$0595,$05D1,$059D,$05D1,$05A5,$05D1,$0596
 dc.w $0020
 dc.w $05D1,$05A9,$05BB,$05D1,$0595,$05B9,$05D1,$05A0,$05BB,$05BD,$0020
 dc.w $0020
 dc.w $05D1,$05A5,$05B9,$05D1,$05B3,$0596,$05D1,$05B3,$05BD,$0596
 dc.w $0020

 dc.w $05D1,$05B9,$0599,$05D1,$059A,$05B5,$05D1,$05AD
 dc.w $2003
 dc.w $05DC,$0332,$05DC,$05B9,$20DE,$0332
 dc.w $05DC,$05B9,$059C,$0332,$0020
 dc.w $05E9,$0332,$05B9,$05E9
 dc.w $05C1,$05B9,$0332,$05E9
 dc.w $05C1,$05B9,$0332
 dc.w $0020,$05E9,$05C1,$05BC,$05B9,$05BD,$05BF,$05AF
 dc.w $2028

 dc.w $0000


*************************   2nd window-full   ****************************

; common diac types

utex2:
 dc.w $22A1,$0020,$0020
 dc.w $22A1,$0483,$0020,$22A1,$0300,$0020,$22A1,$0315,$0020
 dc.w $22A1,$0B47,$0020,$22A1,$0903,$0020
 dc.w $22A1,$0AC1,$0020,$22A1,$0318,$0020,$22A1,$0328,$2028

 dc.w $22A1,$0020,$0020
 dc.w $22A1,$0C46,$0020,$22A1,$0BC0,$0020,$22A1,$0C3E,$0020
 dc.w $0020,$0020,$0020,$22A1,$0BBF,$0020
 dc.w $22A1,$09E2,$0020,$22A1,$0327,$0020,$22A1,$0321,$2028

; decomposing diacs

 dc.w $09A6,$0020
 dc.w $09A6,$09CB,$0020,$09A6,$09CC,$2028

 dc.w $0A9E,$0020
 dc.w $0A9E,$0AC9,$0020,$0A9E,$0ACB,$0020,$0A9E,$0ACC,$2028

 dc.w $0B0B,$0020
 dc.w $0B0B,$0B48,$0020,$0B0B,$0B4B,$0020,$0B0B,$0B4C,$2028

 dc.w $0B8E,$0020
 dc.w $0B8E,$0BCA,$0020,$0B8E,$0BCB,$0020,$0B8E,$0BCC,$2028

 dc.w $0C0C,$0020
 dc.w $0C0C,$0C48,$2028

 dc.w $0C8E,$0020
 dc.w $0C8E,$0CC0,$0020,$0C8E,$0CC7,$0020,$0C8E,$0CC8,$0020
 dc.w $0C8E,$0CCA,$0020,$0C8E,$0CCB,$2028

 dc.w $0D0C,$0020
 dc.w $0D0C,$0D48,$0020,$0D0C,$0D4A,$0020,$0D0C,$0D4B,$0020,$0D0C,$0D4C
 dc.w $2028

 dc.w $0F56,$0020
 dc.w $0F56,$0F73,$0020,$0F56,$0F75,$0020,$0F56,$0F76,$0020
 dc.w $0F56,$0F78,$0020,$0F56,$0F81,$0020,$0F56,$0F77,$0020
 dc.w $0F56,$0F79

; code 1

 dc.w $0020,$0031,$0020,$0020
 dc.w $0054,$0483,$0020,$0049,$0483,$0020,$0069,$0483,$0020
 dc.w $006A,$0483,$0020,$0069,$0483,$0069,$0483,$0020
 dc.w $004F,$0B47,$0483,$0300,$0315,$0903,$0020
 dc.w $004F,$0903,$0483,$0300,$0315,$0B47,$2028

; code 17

 dc.w $0031,$0037,$0020,$0020
 dc.w $25EF,$0020
 dc.w $25EF,$0334,$25EF,$0335,$25EF,$20D3
 dc.w $25EF,$20D8,$25EF,$20D9,$25EF,$20DA,$0020,$0020
 dc.w $0049,$0020
 dc.w $0049,$0334,$0049,$0335,$0049,$20D3
 dc.w $0049,$20D8,$0049,$20D9,$0049,$20DA
 dc.w $2028

; code 18

 dc.w $0031,$0038,$0020,$0020
 dc.w $05D0,$0020
 dc.w $05D0,$0599,$05D0,$05C2,$05D0,$05C2,$0599,$05D0,$0599,$05C2,$0020

; Line 0: Latin characters

 dc.w $0041,$0301,$0042,$0043,$0300,$0061,$0301,$0062,$20DE
 dc.w $0067,$0302,$0043,$0327
 dc.w $0065,$0308
 dc.w $2028                     ;line separator

; Line 1: Arabic characters

 dc.w $0627,$0628,$0629,$062A
 dc.w $062B,$062C,$062D,$06D6
 dc.w $06E9,$0020,$0633
 dc.w $0644,$0627          ;alif-lam (ligates)
 dc.w $0645
 dc.w $2028

 dc.w 0


**************************   3rd Window-full   ****************************

; Line 2: Indic characters

utex3:
 dc.w $0905,$0906,$0907,$20DE,$0908,$0020
 dc.w $0A05,$0A06,$0A07,$20DF,$0A08,$0020
 dc.w $0A85,$0A86,$0A87,$0A88,$0020
 dc.w $2028

; Line 3: single level bidi

 dc.w $0627,$0628,$0629,$0020
 dc.w $201C,$0041,$0042,$201D,$0020   ;(quotes are mirrored)
 dc.w $0020,$062A,$062B,$062C
 dc.w $2028

; Line 4: multi-level bidi

 dc.w $0628,$0629,$0020,$201C
 dc.w $202A                     ;ltr embed
 dc.w $0041,$0042,$0020,$201C
 dc.w $202B                     ;rtl embed
 dc.w $062C,$062D
 dc.w $202C                     ;pop
 dc.w $201D,$0020,$0043,$0044
 dc.w $202C                     ;pop
 dc.w $201D,$0020,$062E,$062F
 dc.w $2028                     ;line separator

; Line 5: Punctuation & various widths of spacers (rtl b/f from line 3)

 dc.w $2010,$2000,$2011,$2001
 dc.w $2012,$2002,$2013,$2003
 dc.w $2016,$2004,$2017,$2005
 dc.w $2018,$2006,$2019,$2007
 dc.w $201A,$2008,$201B,$2009
 dc.w $201C,$200A,$201D,$200B
 dc.w $201E,$200C,$201F,$200D
 dc.w $2020,$2021,$2022,$2023
 dc.w $2028

; Line 6: Unusual diacritics

 dc.w $0041,$20DD,$0042,$20DE
 dc.w $0043,$20DF,$0044,$20DF
 dc.w $0045,$20E0,$0020
 dc.w $0634,$06DD,$0634,$06DE
 dc.w $0020
 dc.w $0F4A,$0F4A,$0F77,$0020
 dc.w $0041,$0360,$0042,$0020
 dc.w $0C87,$0C87,$0CC7,$0020
 dc.w $0D38,$0D38,$0D4A,$0020
 dc.w $0C1A,$0C1A,$0C48
 dc.w $2028

; Delimiter

 dc.w $0000
