Inside - WINDOWS

From NitrOS-9
Jump to: navigation, search

Section 1

THE WINDOW DRIVERS

The windowing system on the CoCo-3 is composed of the window device descriptors, the main driver CC3IO specified in those descriptors, and several co-modules that handle window output.

The modules and a schematic of their relationship:

Term - Actually, the WO descriptor OR a VDG descriptor W1-W7 - Window descriptors W - Special window descriptor CC3IO - Keyboard scanning (60 times a second if key down) Joystick/mouse reads Some stat calls VDGrt Emulates L-I v2.0 gfx environment Adds hires gifx screens mapped into proc space Windlint- Preprocessor for hi-level windowing/menu calls plus Window codes Grf Int - Preprocessor for window codes Some stat calls GrfDrv - Text/gfx display TSMkeS eeeSMS TSMeS TSMLL LMq SLqMM qqS TS S S TS S LkS LLLS S S S qSqq qqSS LS LLSLSLL TS LS LS S S SSSSSSMq qqSS LS SS SSSSkLSS TSSS SS SS S TSLT TSS S SSSLS S S S S qTST TSSS SS SLS LLS S AMS S TSLkLSS SqqS qqSqM TSSSLS SMS TBS TSgLSL TS qMMqS CSL SLL LS S IOMAN l CC 3IO - Term W. W. W2 - . Main driver/desc l ... K----either-l-or----------- l l l l Grift WindInt Output processing l - - - - - . -- - ܗܡܗ = =- ܒ݁ܚ l VDG Ott l GrfED t V7 Screen data (video output)

COMPARISON WITH OTHER I/O DEVICES

Like other OS9 devices, reading and writing and stat calls are done through a main driver. Each device has it's own address, static memory, and has an input buffer for type-ahead. Outputted characters are not queued, but go straight to the screen.

Unlike others, though, each window also shares the same input device (the keyboard or mouse). They also share use of the GIME chip. This means that some way must be used to keep track of which window sets up it's display on the GIME, and which window gets the input from the keyboard. For this purpose, all of the window devices also share a common or global memory.

This global memory is located at in block 00, extended address 001000-001FFF, and is always mapped in for the CoCo terminal driver modules to use. A very preliminary and cursory look at this memory area is provided in the next section of the book.

The /W descriptor also introduces a new technique. This wildcard device flags CC3IO to open the next free window in place of it. I think that requesting the name from a path opened using /W will instead return (Wx instead (x=number).

Instead of hardcoding window numbers, good L-II programs that need to open another virtual terminal should use /W.

CC3IO

CC3IO is very similar to it's L-I (ver 2.0) counterpart, CCIO. Some of it's code is even the same for the keyboard, lo-res mouse read, and so on. However, where CCIO used CO80 or CO32 as comodules to handle the screen output, CC3IO now passes codes on to the GrfInt/GrfDrv or VDGInt comodules. (The name "CO80" can still be found within CC3IO, but was probably there just for debugging purposes, as it is no longer used.)

VDGINT

VDGInt contains the equivalent of the Level One CO32 and GRFO modules. It handles the 32x16 text screens, semi-graphics and original VDG-style graphics screens.

Because of this emulation, you can still run many older programs that ran on the CoCo-1/2's, including TSEDIT.

In addition, VDGint provides for new screens that allow speed-dependant programs to take advantage of the CoCo-3's high resolution graphics. Unlike the Grflint screens that are not mapped into a program's space, VDGInt graphics screens are. This means that games like Koronis Rift can directly access the screen memory to be displayed, allowing much faster updating of the screen than by using escape codes.

VDG text screens are normally allocated from the system map, as allocating a full 8K block just for a 512 byte display would be wasteful. To provide compatibility, the use of the SS.AlfaS GetStat call WILL map the screen into the caller's task space (since it returns the address within a logical 64Karea), along with any other system variables that just happened to be in the same system map block. For this reason, programs that use this call should be careful to stay within the 32x16 screen area, lest they accidentally write over crucial system data.

Windows within a screen are not provided for, although it is possible to set up more than one VDG screen. And, you can still <CLEAR-key> between these screens and normal windowing screens.

Character and graphics functions are not provided for the CoCo-3 specific modes. The only text output is through use of the 32x16 character display.

GRFINT/WINDINT

Grflint takes the parameters passed with a window code (as when you do a "display 1b 31 538"), checks them for values exceeding limits or specifications, and stores the possibly converted parameters in the system map global memory and window tables.

Grflint then calls GrfDrv with an internal code, which is used as a table index to call the appropriate GrfDrv subroutine for any screen manipulation.

WindInt will be included with the Multiview graphics shell package. It will take the place of GrfInt, providing the same calls plus adding new ones for creating pull-down menus, boxed windows, scroll bars and other hi-level windowing abilities.

GRFDRV

GrfDrv is the module that does any actual storage or drawing of data on the screen. It also handles allocation of screen memory and buffers. In other words, anything specific to the CoCo-3.

Both GrfInt and WindInt will use GrfDrv as the driver that manipulates the video data. By breaking things up this way, it's possible for perhaps just a new GrfDrv to be written for other display devices, or the next CoCo.

The most unique aspect of the GrfInt/GrfDrv combination for lovers of L-II is that it's code size, and the need to have direct access to so much memory (like 32K for each gfx screen), caused the authors of CoCo-3 L-II to adopt what amounts to an extension of the 64K system map into another 64K space to handle the memory needed.

A CLOSER LOOK

CC3IO

On initialization, CC3IO inserts it's IRQ handler vector into D.AltDRQ at S00B2 in the direct page variables. It also sets vectors for window select, mouse reads and the terminal bell (this is used by CLOCK's FSAlarm call).

Depending on the device type ($80= window, else= VDG), it will link or load, and inititialize the Interface module required. Obviously, VDG device types use VDGInt. Window devices cause CC3IO to first try locating WindInt. If that fails, it then goes after GrfInt.

On IRQ's, CLOCK calls CC3IO as a subroutine to read the keyboard, check for fire buttons, decrement the mouse scan delay, and send signals to processes needing them.

The Write routine passes all the characters onward to the Interface modules, but can be requested by them to read more than one parameter for escape codes.

The CLEAR key flip between windows is also caught during interrupts, which you can see by holding CLEAR down while doing disk access. Be careful, though - this causes my machine to crash.

Other than that, CC3IO really knows very little about windows.

CC3IO also handles these:

GETTSTATS SETSTATS SS ConSt. SS. CoSt. SS Mouse SS. Mouse SS Montr SS. Montr SS. KySns SS. KeySns SS. Joy SS. Tone SS. GIP SS. SSig SS. Ms Sig SS. Relea SS. Open

GRFINT

Grfnt has six entry points, Init, Write, Getstt, Setstt, Term, and SetWindow. At offset 0026 begins the window escape code table, each entry made up of a parameter count, vector, and a code byte to be used for internal GrfDrv calls.

On initialization, Grflint links or loads "grfdry" or "../CMDS/grfdrv". GrfDrv MUST end up on an 8K block exact boundary, which is why it should be loaded off disk. Grflint calls GrfDrv's Init routine and then unlinks it. This causes GrfDrv to be unmapped from the system task, which is okay as GrfDrv has already moved itself over to the second system map.

Grfnt moves a default palette into global memory where other modules may find it. This table is listed later.

Grflint sets up the window entry tables, screen tables, and requests system memory for the graphics cursor tables.

As said before, it handles the task of getting all the parameters for the window display codes. It checks for a valid window destination. Parameters are collected and passed onto GrfDrv for execution.

Loading of Get/Putbuffers is partially taken care of here, too. Grflint reads in up to 72 bytes at a time into a global buffer for GrfDrv to read from.

It also sets the page length according the window size, does most of the window Select routine, and computes relative coordinates.

GRFINT also handles these:

GETSTATS SETSTATS SS . ScSiz SS. Open SS. Palett SS.MpGPB SS. FBRegs SS. DifPal SS. Df Pal


GRFDRV

After being loaded by Grflint or WindInt, GrfDrv is called to initialize itself. It sets up the second task map (Task One, which is reserved, as is task zero, for the system use) to contain itself, global system memory, and areas for swapping in buffers and screens to access. This map looks like:

Logical Block Addrss Use O 0000-1FFF System Global Memory 1. 2000-3FFF Buffers mapped in here 2 4000-5FFF - 3 6000-7FFF Grfdr V 4 8000-9FFF Screens mapped in here 5 AOOO-BFFF 6 C000 - DIFFF gy 7 EO O O-E"DEFEF

To get to GrfDrv, GrfInt sets up a new stack with GrfDrv's entry point as the PC, then jumps via direct page vector 00AB to OS9p1. OS9p1 copies the reserved Task One DAT Image into the GIME's second DATset, flips over to the GrfDrv map, and doesa RTI.

Returning to the normal system map (back to GrfInt) is just the opposite, except the vector at 00A9 is used to flip back to the always set up Task Zero system map.

Interrupts are still enabled on the GrfDrv map, and OS9 saves which system map (0 or 1) it was in when the interrupt occurred. After servicing the interrupt, OS9 resets the DAT to the correct task number.

GrfDrv handles all character writing (text or graphics) and graphics routines (line, point, etc).

It checks for window collisions, sets the GIME, translates colors, handles buffers, and executes terminal codes such as CLS, INSLINE, etc.

Allocation and release of buffer and video memory is also done within GrfDrv.


SCREEN MEMORY

Screen memory is allocated using F$AlHRAM (from high block numbers at the top of memory), because the GIME requires contiguous physical memory for display, and there's a better chance of finding such up there. The OS9 kernal gets program and data blocks from the lower end.

Actually, it really shouldn't matter all that much where you found contiguous RAM, but perhaps they felt it was safer up high. Since we have no ROM blocks to map into DAT Images as a safe area (for blocks not used in a program map), the DAT.Free marker used by the CoCo (333E) means that a video page (3E) is all that should get clobbered if a bad program runs amuck through it's logical address space. (That is, unless it should run into the GIME and I/O page at XFFXX)

Each new window doesn't necessarily take up a lot more memory. If you open a window on a previously allocated screen, it's still going to use that screen memory. It's inside that screen, and so is also inside that memory block or blocks.

Graphics screens are allocated by blocks, since the smallest form uses 16K or two blocks. When all the windows on a screen are closed, all the blocks are returned to free memory.

Text screens are allocated a block at a time, and that block is divided up into at least two screens, if they are both 80 column (4K each) screens. So you can have two 80's, one 80 and two 40's, or four 40's per 8K RAM block. That is, you can if you apply the patch to GrfDrv that's in the BUGS section of this manual. See it for more details.

Obviously, it makes more sense, memory-wise, to use text screens where feasible.

    1. MISC WNDOW TIPS

The keyboard mouse toggled on and off by <CTRL-CLEAR> changes the arrow keys into a hires joystick, and the function keys into fire buttons. I believe that it takes over in place of the external right-hand joystick. In this mode, the arrow keys are set up as:

Arrow - move 8 positions Shift-arrow - move 1 position Ctrl-arrow - move to far edge

If you've set the proportional switch and are using the stdfonts character set, change the font to C8 02 for a better display.

Each device (TERM, Wx) has a 128 byte input queue. This means that you can go to an inactive window, type something blindly on it. Then if you started a program on that window, what you typed previously will be immediately read. For example, if you typed "dir" on W3, then went back and "shell <>>>/w3&", the dir command would be executed by the new shell.

In most cases, it might be better to use the Forgnd, Backgnd textcolor set commands, instead of the Palette command. There are eight colors already provided for, and except for two color graphics windows, should be easier to use and remember.

Want to see what your StdPtrs file looks like? Merge them into a window. Open a 320x 192 graphics window for best results. Then "display 1B 4E 01000050" to move the graphics cursor to an open spot. Now you can "display 1B 39 CA p", where p=1-7 to see how the various pointers look.

AREAS OF INTEREST

For those who might wish to customize their system by changing some of the module defaults, and could use a quick reference to the tables used, here are some helpful assembly areas:

CC3IO OO7D 007 F OO 82 OO 85 O087 008A O08B O08D OO 90 OO 92 OO 95 OO 97 0 0 9A OO 9D OOAO OOA3 OOA6 OOF 4 OOF6 OOF8 OOFA OOFC OOFE OOO 01.02 O5A2 05A5 O5A8 05AB O5AE 05B1 责 Keyboard & Mouse Delay Init (1st device) : 861E lda #30 1/2 second A7886 St二a $61, х set keybd delay constant A78829 Sta $29, х and first delay 8603 lda #S03 1/20 second A78862 Sta $62 х secondary delay 4A deca As O2 A784 Sta X (S1000) = 02 6C883C inc S3C, x mouse flag 860 lda #S01 A7883D Sta S3D x right joystick 8678 lda #120 2 seconds A7883E Sta SЗЕ, х set button timeout CCFFEFEF dd SFFFF ED8828 std $28, х init keyboard vars ED882B std $2B, x CCOO 78 lidd #$0078 set ss. mouse for device EDC828 std Ս0028, Ս (scan rate & timeout) 次 Keyboard Mouse Coord Deltas: 火 Normal, Shift Control O 801 fCb 8, 1 right 027 fob 639 F8FF fCb -8, -1 left 0000 fdb O O 801 fCb 8, 1 down O OBE fodb 191 F8FF fCb -8, -1 lup OOOO fdb O 欢 Special Key Code Table: 女 Normal Shift Control 40 6000 fCO Ş40, Ş60, Ş00 G OC1C13 fCO SOC, S1C, S13 up 0A1A12 fock SOA, S1A, S12 down O 81810 ifCb SO8, S18, S10 left 0.919.1 f Cho S09, S19, Sill right 202020 fCho S20, $20 S20 space 4-1-7 ________________ NSDE OS9 LEWEL Windows Section 1 05B4 303081 f Cho S30, S30, S81 0 O case 05B7 31217C fcb $31, $21, S7C 1 05BA 322200 fCb S32, S22, S00 2 05BD 33237E f Cho S33, S23, S7E 3 # 05C0 342400 f Cbo S34, S24, S00 4 S 05C3 35250 0 fcb S35, S25 SOO 5 钴 05C6 362600 if CC S36, S26 S00 6 & O5C9 37275E if CC $37, $27, S5E 7 O5CC 38285B fCb S38, S28, S5B 8 ( 05CF 39295D f Cho Տ39, $29, Տ5D 9 ) 05D2 3A2A00 fCb S3A, S2A S00 : 大 O5D5 3B2B7F f Cho S3B, S2B, S7F ; - O5D8 2C3C7B focb S2C, S3C S7B , K O5DB 2D3D5F fCO S2D, S3D, S5F - O5DE 2E3E 7D fckつ S2E, S3E, S7D . > 05E1 2F3F5C fcb S2F, S3F, S5C / 2 V 05E4 ODODOD fCb SOD, SOD, SOD enter 05E7 828384 f Cho S82, S83, S84 clear O5EA 05031B fcb S05, S03, S1B break 05ED 313335 f Cho $31, $33, S35 F1 O5F0 3234.36 f Cho S32, S34, S36 F2 GREINT Default Palette Table: * whic blu, blk, grn , red, yell, pur, cyn O2F2 3FO 90012 FCB S3F, S09, S00, $12, S24, S36 S2D, SlB O2FA 3FO 90012 FCB S3F, S09, S00, S12, S24, S36, S2D, S1B GRFDRV LO3C? lidd #$C8 01 set default font for gfx windows L08CC equ 大 Translate Color For RGB : pshs x tst >X1009 check monitor type (0=comp color, l=RGB, 2=mono) bne LO 8D 9 . . skip if not composite color leax >L08DB, pcir translation table ldbo b х get new gime palette byte LO 8 D9 equ 大 puls pc, X rts. 4-1-8 ________________ INSIDE OS9 LEVEL Windows Section 1 L08DB equ 大 64 Color Translation Table: FCB S00, S0C, SO2, SOE, S07, S09, S05, S10 FCB Ş1C, Ş2C, Ş0D, Ş1.D. Ş0B. Ş1B Ş0A, Ş2B FCB S22, S11, S12, S21, S03, S01, S13, S32 FCB Ş1E Ş2D, Ş1F, Ş2E Ş0F, Ş3C, Ş2F Ş3D FCB S17, S08, S15, S06, S27, S16, S26, S36 FCB S19, S2A, S1A, S3A, S18, S29, S28, S38 FCB ŞIl 4 Ş04, Ş23 Ş33 Ş25 Ş35 Ş24 Ş3 4 FCB 320, S3B, S31, S3E, S37, S39, S3F, 330 ________________ NSDE OS9 LEWE Windows Section 2

  • System and CC3IO Memory Map (block 00)
  • Our personal disa sm variable map from Rogue.
  • Kevin Darling 14 Feb. 87, 30 Mar 87 * Kent Meyers * Not necessarily accurate for latest versions. 女 * Global and CC3IO Memory Starts at S01000 :

1000 rnb 1 1001 rmb 1 1002 rmb l map side (grfolrv) 1007 rmb 2 grforv stack pointer 1009 rimb l monitor type (0 1 2) 100A rimbo 1 same as active dev flag 100B rmb 1 v. type of this dev OOC rrnb 2 device static memory ptr OOE rimbo 1 WindInt map flag? 100F rmb 6 FSAlarm time packet O5 rmb 1. FSAlarm process id 1.016 rmb 1. FSAlarm signal code 101.7 rmb 2 terminal bell vector O9 rmb 2 ptr to default palette ptr 101B rimbo 1 tone duration in ticks 10C rimb 1 bell flag 101D rimbo 3 102O rmb 2 active window devmem 1023 rimbo 1 screen changed flag 1024 rmb 1 S80=grf/windlint, S02-svdg found 1025 rimbo 2 1027 rmb 1 last keybd row find 1028 rmb i O29 rmb 1 repeat delay cnt now 102A rmb 5 102F rmb 1 grfdrv init 'd flag 1030 rmb 1. SHIFT key down 1.031 rmb 1. CTRL key down 1032 rimbo 1 1033 Cubo 1 ALT key down 1034 rmb 1 keysns byte 1035 rmb 1 same key flag O36 rmb 1 SHIFT/CLEAR flg 1037 rmb 1 1038 rmb 1 grfdrv init 'd flag 1039 rimbo 2 L03B rimb 1 mouse sample tick counter

  • --

k Mouse Packet : (S20 bytes) 4-2-1 ________________ 103C 103D 103E 103F 1040 1041 1042 104.4 1045 1046 104.7 104.8 1049 104A 104B 104C 04E 1050 1052 1053 1054 1056 1058 105A 1060 1061 O 62 O 63 1064 1065 1066 1067 1068 106A 106E 1070 1071 1075 10 BEF 10C2 10C4 10C 6 10C7 10 E7 1100 1200 1280 1290 1A80 NSIDE OS9 LEVEL 器 Windows Section 2 OO fire biti, rdflg 01 bit 0-fire button bit l=side (0=right l-Fleft) bit 6=set if was keybd mouse timeout constant 02 keybd flag 03 04 CItir 05 0-FFFF" Cnt 06 fire chg bit 08 fire chg bit 09 up time OA up time 0B chg counter OC chg counter OD down time 0E down time 0F 10 returned X 12 returned Y 14 l6 0=old, 1-hires 17 X coordinate 18 Y coordinate 1A X window 1C Y window 1E mouse sample rate first key delay ticks secondary repeat ticks enable kbdmouse toggle flag one shot ignore CLEAR key flag fire button dwin (F1=01 F2=04) mouse to use (AND 66+67-C-0: update packet) mouse coord changed flag comodule entry vectors . . . vodgint entry grfdrv entry move data cintr for buffers 32 bit window alloc map ptr to 576 byte gfx tables cc3io L011 6 flag (chg mouse?) cc3io shift-clear key sub (L0614) cc3io set mouse sub (L06AE) fire not read: zero if ssig sent palette reg data (sys default) grforw variables data buffer for gpload window tables (S40 each) window table base offset used screen tables 4-2-2 ________________ 女 INSIDE OS9 LEVE II Windows Section 2

  • GrifInt/GriffDrv Vars :

grfdrv 11 OE 1120 1122 1124 126 112E 1130 132 1135 138 113B 13D 147 1149 14B 11 AD 14F 1151 1153 1155 1157 1158 1159 15A 115B 115D 11.5F 1160 161 1162 1163 L164 1166 11.68 11.6A 116C 116E 1170 1172 17D 117E 1180 1182 1185 1187 1197 11.99 Irmo rmb rmb rmb l 1. 6

equ Ş0 100 use for global offset char bs W bits ellipse parms: windentry now screen table now 3 byte buffer table grp, offset grp offset returned (new) end of vars ptir? HBX, LBX HBY, LBY Current X current Y HSX, LSX HSY, LSY Circle, ellipse arc Ellipse, arc GRP BEN SVS PRN ВХ putgc BY putgc STY marker fore rgb data WE: 06 back rgb data WE: 07 bytes / row SC: 04. lset vector? WE: 16 Pset offset WE: OF grfdrv liset WE: 4 maX x coord WE: 1B max y coord WED X pixell cnt Y pixel cnt get/put ow save screen strt buffer block (get block) buffer offset grp/bfn HBL LBL 3 byte extended screen address temp grifdrv (sysmap 1) DAT Image temp this windentry ptr 4-2-3 ________________ 19B 19C 19D 1280 赏 INSIDE OS9 LEVE I Windows Section 2 rimb l counter temp rmb 1 rmb 2 offset to buffer in block rmb x windentries : base-1290

  • Window Entry: (S40 each)

-10 W. -OE -OD aOB 09ي 07-سے -05 -03 02-سی ー01 0A OB OC OE OF 10 11 1.2 14 18 19 1B D 1F 24 26 28 2A org -S10 screen table ptr back windi link screen logical start CPX, CPY S ZX SZY x, y sizes? cursor address sty marker byte X byte cnt (cwarea) cwarea temp bytes/row fore/back prn delf attr byte FUTTTBBB char bs w bits: (defaults S89) 80 TChr. 40 Under 20 Bold 10 Prop 08 Scale 04. Invers 02 NoCurs 01 Protect ILSET GRP for font font offset GRP for PSET pset offset? LCD mode overlay grp overlay offset ptr to grifdrv LSET tabolie vector (1FDE/1FF4) gcursor BFN gcursor offset max X coord (0-79, 0-639) max Y coord (etic txt/gfx) BLength grp/offset for next gpload screen logical start default cpx, cpy defaults Szx, szy reserved 4-2-4


    * -----------------------------------------------
    * Screen Table: (S20 each)
00 S.        rmb 1 sty marker
Ol           rmbo 1 first block # (used flag)
02           rmb 2 screen logical start
O4           rmb 1 bytes/row
05           rmb 1 border prn
06           rmb 1 foregnd prin (software border)
O7           rmb 1 backgnd prin
08           rmb 8
10           rmb 16 palette regs (00 RGBRGB)

    * -----------------------------------------------
    * Gfx Table (32 of 18 bytes each) pt 'd to by .75-6
OO           rmb 1
01           rmb 2 BX of graphics cursor O3 rimbo 2 BY
O3           rmb 2 BY
05           rmb 13

    *------------------------------------------------
    * Internal Screen TYpe marker byte:
    * User STY =>Mark ...
             FF FF Current Screen
             OO FF Current Screen
             05 01 640 two color
             O6 02 320 four
             O7 O3 640 four
             08 04 320 sixteen
             O2 85 8 0 Col
             O1 8 6 4 0 Col

    *------------------------------------------------
    * Device Memory:

rimbo V. SCEF 1D V . rimbo 1 0=window 2=vdg., 4=?? , 6=grifdrv 1E rimbo 1 1F rmb 2 parity, baud (also chair temp) 21 rmb 1 case flag 22 rmb 1 keysns enable 23 rimbo 1 screen change flag 24 rimbo 2 keybod s sig id, signal 26 rimbo 2 mouse s sig id, signal
SS. Mouse (X) : 28 rmb 1 init ' d to S00 mouse sample rate 29 rmb 1 init 'd to S78 mouse fire timeout
SS. Mouse (Y) : 2A rmb 1 mouse to use 2B rimbo 1 " " 2C rmb 1 parm cnt 2D rimbo 2 parim vector 2Ε. rmb 2 ptir to parms start 31 rmb 2 ptr to next parm storage 33 rmb 1 last char read buff offset 34 rmb 1 next Char read

35
37 38 51 80
00 01. 03 04 05
O 9 OB OC OD OE OF 10 20
00 02 04 O6 O8 OA OC OE 10 12 14 16 18 1A

1 window entry number 1 dwinum from descriptor 1 internal comod call number x parm storage
Χ S

80 read bouffer


* Device Descriptor :
DXSiz rimbo 1 SZX
DYSiz rimbo 1. SZY
DWNUI rmb 1 window number
DWIini rmb 1 0=no defaults, 1=use defaults DS Typ rmb 1 STY
DXPOS rimbo 1 CPX
DYPO 8 rro 1 CPY
DECO rmb 1 Foregnd PRN
DBCol rmb 1 Backgnd PRN
DBordi rimbo 1 Border PRN
* Get/Put Buffer Header ($20 each?) :
B - Block rimbo 1 block link B. Offset rimb 2 offset in block B. Grp rmb 1 group number B - Bfn rmb 1 buffer number B. Len rimbo 2 BL length B. XDots rimb 2 di x dots in Char B. YDots rimb. 2 # y dots in char B. Rows C rimb 1 di rows in char
rimbo 1 rimbo 1 B. STyp rmb 1 sty marker byte B. Bllik Siz rmb 1 number of blocks
S
10 reserved
data
* Internal GrfDrv Call Numbers (from Grfint)
What Escape if What Escape Init 2C DEFGB 29 Terminate 2E KTLLBUF 2A DWSET 20 30 GPILOAD 2B DWPROTSW 36 32 Move buffer
DWEND 24 34 GETIBILIK 2C OWSET 22 36 PUTBLIK 2D OWEND 23 38 Map GP Buffer CWAREA 3A Alpha put
SELECT 21 3C Control codes
PSET 2E 3E 05 XX cursor CallS BORDER 34 40 1F codes
PALET 31 42 Goto xy
FONT 3A 44 PUTGC 4E GCSET 39 46 Set Window

1C 1E 20 22
26 28 2A

DEFCOLIR 30 48 POINT
LSET 2F 4A LINE FCOLOR 32 AC BOX BCOLOR 33 4E BAR TCHRSW 3C 50 CIRCLE PROPSW 3F 52 ELLIPS SCALE 35 54 ARC BOLD 3D 5 6 FIFILL

CHARACTER FONTS - by Chris Babcock

Each font has a maximum size of $400 bytes.

The first $100 bytes are broken up and scattered around in the area $80 to SFF.

The next $300 bytes contain the definitions for the area $20 to $7F.

Each character is represented by 8 bytes. If the bit is 1 the pixel will be set and if it is 0 the pixel will not be set (as you would expect.) The graphic mode is always interpreted as mode five for the fonts.

The font color is the foreground palette. This means the font can not be more than two colors, the foreground palette and the background palette for the on/off conditions of the bits.

A font always uses exactly 8 scan lines per character row. The number of pixels across per character can be either 6 or 8. Using a size of six allows up to 53 characters across in 40 column graphic windows and 106 in 80 column graphic windows. Eight pixels allow 40 or 80 in the corresponding graphic windows.

The following is the breakup of the file:

Position in file Character codes represented SOOOO - SOOCF ŞC1-ŞDA and ŞE1-ŞFA Stored here S00D0 – S00 FF SAA-SAF and SBA-SEF stored here SO 100 - SO3FF S20-S7F stored in this area SO 170 - S0177 (S2E) SAO-SA9 SBO-SB9 SCO SDB SEO SFB-SFF Note: All the above reference S2E ( " . " )

Proportional spacing uses a different method of putting characters on the screen. The 8 bytes are checked to find the range of bits used. Then a blank bit is added to the range at the end. This range is used as the character. The driver is not smart enough to do a proper backspace; it always uses a backspace of the number of pixels selected when the buffer was loaded. A text graphic example of this is below using the word "Mistake."

Normal:

    76543210765432107654321076543210765432107654321076543210
      Χ   X                                    X
      XX XX     X      Χ Χ
      X X X          X             XXXXX XXXXX XXX X X XXXX
      X X X     Χ    Χ X X X X X Χ X 
      X   X     XXXX X X Χ       XX XXXXXX X Χ X X X X Χ Χ Χ Χ Χ
      Χ   X     X XXXXX Χ XXX X X X XXXX
      X   X     X

Proportional:

    76543210765432107654321076543210765432107654321076543210
    X   X                                  Χ
    XX XX     Χ X X X X X XXXXX XXXXX XXX X X XXXX
    X X X     X X Χ X X X X X X X X
    X X X     X X Χ X XX XXXXXX Χ X X X X X X X X X X
    X   X     X
    X   X     XXX Χ XXX X X    XXXX
    X   X

The transparent character option causes only the set bits to be placed on the screen. Bits already set are not removed from the screen as they would be without this option selected. Using this mode allows the text to overlay graphics on the screen without erasing the character block area.

If moving the cursor, change to fonts you're going to use before moving, otherwise the cursor ends up one line down. Unless you're going from 6-6 or 8-8, then okay.

Note that fonts don't have to be real text. You could for example, set up a font of small objects. The ROGUE game uses special fonts to represent people, gold, trapdoors, etc.


Section 4

00001 al Window Descriptor - CC3 LII 00002 ttl INSIDE OS 9 LEVEL II 00003 * SRC for /W1-W9 00004 * roll your own descriptors 00005 * 1st version - 24 Jan 87 00006 * Copyright 1987 by Kevin Darling OOOO7 00008 * -- ح --- س ----- س -----------سے ---- ســــــــــــــــــــ حس۔ --سیحی۔ -- یـہ --------سہ -------- ی -ست ------ ہے -- س -------------- 00009 * Change these to make a new /Wx descriptor : 0 0010 * (only "window" need really be changed) 0 001 * For Window numbers great than 9, you must 0 002 * manually set the dnam at the end. OOO 13 * The following is just a sample . . . 0 004 OOO15 OOO1 window set 1. the window number OOO16 OOOO срх Set O begin col OOO 17 0000 сру Set O being row 00018 0 0 1B cols Set 27 number cols OOO19 OOOB TOWS Set 11 number rows OOO20 OOO1 mode Set 1. ( 1 = 4 0 col text 2=80 col text 0 0021 OOO2 fore set 2 foregnd and cursor palettes OOO22 OOOO back set O backgnd palette 0 0023 0 004 bord Set 4 border palette 00024 OOO25 * cols should be <= the mode maximum. 0 0026 * fore--8 is actual foregnd palette, fore is cursor. OOO27 OOO28 * -- -- ۔ سی۔ ---------------سے ------ ح - ۔ ------------------------- یـہ ----------------- ست۔ --------- سے---------- 00029 OOFO devic equ SFO quicker than defs file OOO30 OOO1 objct equ SO1 00031 0080 reent equ S80 OOO32 0 001 READ equ S01 OOO33 OOO2 WRT equ SO2 OOO34 OOOO DT : SCE” eզu O OOO35 OOO36 OOOO 87CDOO 44 mod lendnam, devic+objctreent+1 mgr, drv OOO37 OOO38 OOOD O3 fcb READ. --WRIT. device mode 00O39 OOOE 07 fcb S07 OOO 40 0 0 0 F FIFA.1 fCl2 SFFA0+window port address OOO 41 O011 1A fC:b optis - * -1 option byte count OOO 42 0 0 12 00 fcb DT.SCF device type OOO 43 OOO 44 OO13 00 fCb O case=upper and lower OOO 45 0 0 1A 01 fcb 1. backspace mode OOOA 6 OO15 00 fob O delete mode OOO 47 0 0 16 O fCo 1. echo on OOO 48 OO 17 O. fCb l auto line feed on OOO 49 0.018 00 f Cb O no nulls after cr OOO50 0 0 19 OO fcb O no pause OOO51. OO 1A 18 fCb 24 lines per page default (MW) OOO52 0 01B 08 fCo S08 backspace char 00053 OO1C 18 fCO S18 delete line char OOO54 OO1D OD fcb SOD end of record char OOO55 0 01E 1B fCO S1B end of file char OOO 56 OO1F O 4 fcb SO 4 reprint line char 4-4-1 ________________ Windows Section 4 00057 OO 20 O1 fCb SO1 dup last line chair OOO58 OO21 17 fCb S17 pause char 00059 OO22 03 fCb SO3 interrupt character 000 60 OO23 O5 fCb SO5 quit character 000 61 OO24 08 fCo S08 backspace echo char 0.0062 OO25 O7 fCb S07 line overflow char OOO 63 OO26 8O ico S80 type=window OOO 64 OO27 OO fcb SOO batud 000 65 0 028 0036 Cb dnam echo device OOO 66 002A OO CO SOO xon character OOO67 OO2B OO fCO SOO xoff character OOO 68 002C opts equ * End of Path Desc Options 000 69 OOO 70 002C 1B fob cols 0 007 OO2D OB f Cho O WIS 00072 002E Ol fco window window if OOO73 OO2F O1 fCb 1. use defaults option 000 74 OO30 01. fCo mode OOO75 OO3 OO f Cho срх 00076 O032 OO fob cpy 00077 OO33 O2 fc. fore forgnd and cursor palette O0078 OO34 00 fCb back backqnd palette OOOT 9 OO35 O 4 foco bord border palette OO 080 OOO 81 OO36 576E dinam foc 'Win OOO 82 OO38 B1 fCO SBO-window OO 083 0.039 5343C6 mgr focs TT SCEF TV file manager OOO 84 OO3C 43.433349 drv fcs CC3 TOT driver OOO 85 OOO 86 0.041. 3EF9CA emod OOO 87 0044 llen equ 大 OOO 88 end 0 0 0 0 0 error ( S ) 00000 warning (s) S0044 000 68 program bytes generated S0000 00000 data bytes allocated S0160 00352 bytes used for symbols 0000 S BACK 0 0 0 4 S BORD 001B S COLS OOOO S CX 0 000 S CPY 00F0 E DEVIC 0 036 L DINAM OO3C I, DRV 0 0 0 0 E D ' . SCF O002 S FORE 0044 E LEN 0039 L MGR OOO1 S MODE 0 001 E OBJCT OO2C E OPTS 000 E READ. O O 8 O E REENT OOOB S ROWS OOO S WINDOW OOO2 E WRIT .

These are the Tandy-supplied options:
 (in same order as descriptor)

OPTION   W  W1  W2  W3  W4  W5  W6  W7
 cols   00  1B  0C  28  3C  13  50  50
 rows   00  0B  0B  0C  0B  0B  0C  18
 wind#  FF  01  02  03  04  05  06  07
 deflt  00  00  01  01  01  01  01  01
 mode   00  01  FF  FF  02  FF  FF  02
 срх    00  00  10  00  00  3D  00  00
 сру    00  00  00  0C  00  00  0C  00
 fore   00  02  00  02  00  02  02  00
 back   00  00  01  07  01  07  00  01
 bord   00  04  01  01  04  04  04  01

Note that a descriptor with TYPE=1 is a VDG
window instead of these (TYPE=80).