Anonymous avatar Anonymous committed be95e14 Draft

Import og BefOS version 0.9 revision 2011.0427 sources.

Comments (0)

Files changed (32)

README

-BefOS - an Operating System for the Linearly Challenged
-=======================================================
-
-BefOS v2006.0204
-(c)1999-2006 Cat's Eye Technologies.  All rights reserved.
-
-  ,---------------------------------------------------.
-  | * WARNING! * CAUTION * PROCEED AT YOUR OWN RISK * |
-  |                                                   |
-  | *        THIS PRODUCT IS PROVIDED "AS IS"       * |
-  |                                                   |
-  | * CAT'S EYE TECHNOLOGIES CAN NOT BE HELD LIABLE * |
-  | *    FOR ANY DAMAGES RESULTING FROM ITS USE     * |
-  `---------------------------------------------------'
-
-What is it?
------------
-
-BefOS is a toy OS written in 100% 8086 assembler.  It requires the
-following hardware (or a decently emulated version thereof):
-
-	Processor:	100% Intel 8086+ Compatible
-	BIOS:		100% IBM PC Compatible
-	Video:		100% VGA Compatible
-	Keyboard:	100% Standard 101/102-Key Compatible
-	RAM:		640K base, 8M extended
-	Storage:	1.44M floppy drive 0 (A:)
-
-BefOS was originally written in Borland's Turbo Assembler format,
-but this version has been translated to use the free assembler
-NASM.
-
-Booting into BefOS
-------------------
-
-Using Bochs or some other emulator: point the emulated A: drive of
-the emulator at the file disk/befos.flp, and boot from the floppy.
-The 'test' target in the top-level (and disk/) Makefile will run
-Bochs automatically on this floppy image.
-
-Using Windows: run BEKERNEL.COM.  (Note that I'm not sure if this
-works anymore in the NASM version; I haven't tried it.  You still
-need a blank floppy in drive A:, though.)
-
-For real: install the floppy image (disk/befos.flp) onto a blank,
-1.44M floppy disk, using a tool such as 'fdimage.exe' (which is
-available at ftp://ftp.freebsd.org/pub/FreeBSD/tools/).  Then
-reset your computer and boot off that floppy.
-
-Using BefOS
------------
-
-Once you've booted into BefOS, you'll see a blue screen with some stuff
-on it.
-
-Here is a quick-and-dirty guide to the top line of this display:
-
-	B		the BefOS 'logo.'
-	(light)		yellow = working, green = worked, red = failed
-	(4 hex digits)	amount of base memory available, in K
-	(4 hex digits)	amount of extended memory available, in K
-	(green bar)
-	(4 hex digits)	link to next cluster of current cluster
-	(4 hex digits)	link to previous cluster of current cluster
-	(4 hex digits)	link to application cluster of current cluster
-	(4 hex digits)	link to colour cluster of current cluster
-	(4 hex digits)	link to help cluster of current cluster
-	(green bar)
-	(16 OEM chars)	description of current cluster
-	(green bar)
-	(4 hex digits)	value of last keystroke detected
-	(2 hex digits)	value of current byte under cursor
-	(4 hex digits)	current cluster number, starts at 0
-
-And here are some key bindings: (NYI=Not Yet Implemented):
-
-	PgUp		Up One Cluster 
-	PgDn		Down One cluster
-
-	Ctrl-PgUp	Link to Previous Cluster (header)
-	Ctrl-PgDn	Link to Next Cluster (header)
-	F1		Link to Help Cluster (header)
-
-	Up		Move Pointer Up One Row
-	Down		Move Pointer Down One Row
-	Left		Move Pointer Left One Column
-	Right		Move Pointer Right One Column
-
-	^2 (^@)		Write	 0
-	^A to ^Z	Write	 1 - 26
-	ESC		Write	27
-	^\		Write	28	
-	^]		Write	29	
-	^6 (^^)		Write	30
-	^- (^_)		Write	31	
-	Space		Write	32
-	!..~		Write	33 - 126
-	Ctrl-Bkspc	Write  127
-
-	Alt-L		Load (refresh from disk)
-	Alt-R		Run (if AA==ffff, executes machine code)
-
-	F4		Change Properties (Header)
-	Alt--		Delete Properties (Header)
-	Alt-=		Initialize Properties (Header)
-
-	Alt-M		show More data on screen
-	Alt-N		show less data on screeN
-
-	Alt-G		Go to cluster number
-
-NYI*1	Alt-E		Edit: allow writes
-	Alt-U		fill cluster Uniformly with current byte
-	Alt-C		Copy cluster data & header to clipboard
-	Alt-P		Paste cluster data & header from clipboard
-	Alt-H		toggle High bit
-	Alt-S		Save (commit changes to data & header to disk)
-
-	Alt-Q		Quit (MS-DOS only)
-*2	Alt-I		Install cluster from file (MS-DOS only)
-
-*1: writes are always allowed in this version so BE CAREFUL WITH ALT-S.
-*2: type the filename into the start of the cluster buffer and
-    terminate it with a null (Ctrl-2)
-
-Cluster Format
---------------
-
-Each cluster has a 'header' which is in fact stored in the LAST
-48 bytes of the second cluster.  The first 2000 bytes are data.
-The header is structured thus:
-
-+------------------------------------------------+
-|VVNNPPAACCHHxxxxxxxxxxxxxxxxxxxxDDDDDDDDDDDDDDDD|
-+------------------------------------------------+
-
-VV = word indicating header type.
-
-     bef0 indicates standard BefOS header, the only type supported.
-
-NN = word containing the cluster number of the next cluster.
-
-     0000 indicates that there is no next cluster.
-
-PP = word containing the cluster number of the previous cluster.
-
-     0000 indicates that there is no previous cluster.
-
-AA = word containing the cluster number of the first cluster of
-     the application for which this is a document.
-
-     0000 indicates that there is no special application for this
-     generic document.
-
-     ffff indicates that this IS an application written in
-     x86 machine code.
-
-CC = word containing the cluster number of
-     this cluster's colour cluster.
-
-     0000 indicates that this cluster is monochrome.
-
-HH = 2 bytes containing the cluster number of
-     this cluster's help-cluster.
-
-     0000 indicates that this cluster is helpless.
-
-xxxxxxxxxxxxxxxxxxxx = 20 bytes reserved.
-
-DDDDDDDDDDDDDDDD = 16 bytes ASCII description e.g. "Seismology Now"
-
-
-
-------------------------------------------------------------------
-
-But the following is more like what I would like it to be...
-
-------------------------------------------------------------------
-
-First, we say that 1 "screen" is 4096 bytes:
-  80x25char + 80x25colour + 96 bytes header.
-A "tableau" is a set of 80x25 screens = 2000 * 4K = 8M.
-  There is one tableau on the computer which maps to it's extended RAM.
-
-One 1.44M floppy disk can contain six columns = 150 screens.
-
-Header:
-
-+------------------------------------------------+
-|VVAAxxxxxxxxxxxxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD|
-|DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD|
-+------------------------------------------------+
-
-VV = word indicating header type.
-
-     bef0 indicates standard BefOS header, the only type supported.
-
-AA = word containing the cluster number of the first cluster of
-     the application for which this is a document.
-
-     0000 indicates that there is no special application for this
-     generic document.
-
-     ffff indicates that this IS an application written in
-     x86 machine code.
-
-xxxxxxxxxxxx = 12 bytes reserved.
-
-DD..DD = 80 bytes ASCII description.
-
-
-Building BefOS
---------------
-
-BefOS can be built on FreeBSD (and probably Linux and Cygwin.)
-Just type 'make clean all' from the top level to build it all.
-
-Here is what is in the various directories:
-
-    bin/
-        amalgam8      Constructs a boot disk image from BefOS objects
-	extract8      Extracts BefOS objects from a boot disk image
-	txt2page      Turns a text file into a BefOS object file
-	mkbfinc.pl    Used during build to generate list of API calls
-    disk/             Contains bootable BefOS boot disk images
-    obj/              Contains BefOS objects that will be amalgamated
-    src/              Contains source code for BefOS:
-        apps/         Source code for the BefOS applications installed
-	boot/         Source code for the boot disk's boot block
-	inc/          Include files shared by many BefOS object sources
-	kernel/       Source file for the core components of BefOS
-	page/         Misc files that become BefOS pages on the disk
-	tools/        Source code for the util programs put in bin/
-	turbo/        The original Turbo Assembler sources for BefOS
 	   $(OBJDIR)/belife.com \
 	   $(OBJDIR)/welcome.bin \
 	   $(OBJDIR)/legend.bin \
+	   $(OBJDIR)/keybind.bin \
 	   $(BINDIR)/amalgam8
 	$(BINDIR)/amalgam8 befos.flp \
 		$(OBJDIR)/beboot.com     0 \
 		$(OBJDIR)/bekernel.com   1 \
 		$(OBJDIR)/welcome.bin    8 \
 		$(OBJDIR)/legend.bin     9 \
-		$(OBJDIR)/belife.com    10 \
+		$(OBJDIR)/keybind.bin   10 \
+		$(OBJDIR)/belife.com    11
 
 clean:
+	echo 'Use `make cleandist` to delete disk image.'
+
+cleandist:
 	rm -f *.flp
 
 test: befos.flp

Binary file modified.

+BefOS - an Operating System for the Linearly Challenged
+=======================================================
+
+BefOS v2006.0204
+(c)1999-2006 Cat's Eye Technologies.  All rights reserved.
+
+  ,---------------------------------------------------.
+  | * WARNING! * CAUTION * PROCEED AT YOUR OWN RISK * |
+  |                                                   |
+  | *        THIS PRODUCT IS PROVIDED "AS IS"       * |
+  |                                                   |
+  | * CAT'S EYE TECHNOLOGIES CAN NOT BE HELD LIABLE * |
+  | *    FOR ANY DAMAGES RESULTING FROM ITS USE     * |
+  `---------------------------------------------------'
+
+What is it?
+-----------
+
+BefOS is a toy OS written in 100% 8086 assembler.  It requires the
+following hardware (or a decently emulated version thereof):
+
+	Processor:	100% Intel 8086+ Compatible
+	BIOS:		100% IBM PC Compatible
+	Video:		100% VGA Compatible
+	Keyboard:	100% Standard 101/102-Key Compatible
+	RAM:		640K base, 8M extended
+	Storage:	1.44M floppy drive 0 (A:)
+
+BefOS was originally written in Borland's Turbo Assembler format,
+but this version has been translated to use the free assembler
+NASM.
+
+Booting into BefOS
+------------------
+
+Using Bochs or some other emulator: point the emulated A: drive of
+the emulator at the file disk/befos.flp, and boot from the floppy.
+The 'test' target in the top-level (and disk/) Makefile will run
+Bochs automatically on this floppy image.
+
+Using Windows: run BEKERNEL.COM.  (Note that I'm not sure if this
+works anymore in the NASM version; I haven't tried it.  You still
+need a blank floppy in drive A:, though.)
+
+For real: install the floppy image (disk/befos.flp) onto a blank,
+1.44M floppy disk, using a tool such as 'fdimage.exe' (which is
+available at ftp://ftp.freebsd.org/pub/FreeBSD/tools/).  Then
+reset your computer and boot off that floppy.
+
+Using BefOS
+-----------
+
+Once you've booted into BefOS, you'll see a blue screen with some stuff
+on it.
+
+Here is a quick-and-dirty guide to the top line of this display:
+
+	B		the BefOS 'logo.'
+	(light)		yellow = working, green = worked, red = failed
+	(4 hex digits)	amount of base memory available, in K
+	(4 hex digits)	amount of extended memory available, in K
+	(green bar)
+	(4 hex digits)	link to next cluster of current cluster
+	(4 hex digits)	link to previous cluster of current cluster
+	(4 hex digits)	link to application cluster of current cluster
+	(4 hex digits)	link to colour cluster of current cluster
+	(4 hex digits)	link to help cluster of current cluster
+	(green bar)
+	(16 OEM chars)	description of current cluster
+	(green bar)
+	(4 hex digits)	value of last keystroke detected
+	(2 hex digits)	value of current byte under cursor
+	(4 hex digits)	current cluster number, starts at 0
+
+And here are some key bindings: (NYI=Not Yet Implemented):
+
+	PgUp		Up One Cluster 
+	PgDn		Down One cluster
+
+	Ctrl-PgUp	Link to Previous Cluster (header)
+	Ctrl-PgDn	Link to Next Cluster (header)
+	F1		Link to Help Cluster (header)
+
+	Up		Move Pointer Up One Row
+	Down		Move Pointer Down One Row
+	Left		Move Pointer Left One Column
+	Right		Move Pointer Right One Column
+
+	^2 (^@)		Write	 0
+	^A to ^Z	Write	 1 - 26
+	ESC		Write	27
+	^\		Write	28	
+	^]		Write	29	
+	^6 (^^)		Write	30
+	^- (^_)		Write	31	
+	Space		Write	32
+	!..~		Write	33 - 126
+	Ctrl-Bkspc	Write  127
+
+	Alt-L		Load (refresh from disk)
+	Alt-R		Run (if AA==ffff, executes machine code)
+
+	F4		Change Properties (Header)
+	Alt--		Delete Properties (Header)
+	Alt-=		Initialize Properties (Header)
+
+	Alt-M		show More data on screen
+	Alt-N		show less data on screeN
+
+	Alt-G		Go to cluster number
+
+NYI*1	Alt-E		Edit: allow writes
+	Alt-U		fill cluster Uniformly with current byte
+	Alt-C		Copy cluster data & header to clipboard
+	Alt-P		Paste cluster data & header from clipboard
+	Alt-H		toggle High bit
+	Alt-S		Save (commit changes to data & header to disk)
+
+	Alt-Q		Quit (MS-DOS only)
+*2	Alt-I		Install cluster from file (MS-DOS only)
+
+*1: writes are always allowed in this version so BE CAREFUL WITH ALT-S.
+*2: type the filename into the start of the cluster buffer and
+    terminate it with a null (Ctrl-2)
+
+Cluster Format
+--------------
+
+Each cluster has a 'header' which is in fact stored in the LAST
+48 bytes of the second cluster.  The first 2000 bytes are data.
+The header is structured thus:
+
++------------------------------------------------+
+|VVNNPPAACCHHxxxxxxxxxxxxxxxxxxxxDDDDDDDDDDDDDDDD|
++------------------------------------------------+
+
+VV = word indicating header type.
+
+     bef0 indicates standard BefOS header, the only type supported.
+
+NN = word containing the cluster number of the next cluster.
+
+     0000 indicates that there is no next cluster.
+
+PP = word containing the cluster number of the previous cluster.
+
+     0000 indicates that there is no previous cluster.
+
+AA = word containing the cluster number of the first cluster of
+     the application for which this is a document.
+
+     0000 indicates that there is no special application for this
+     generic document.
+
+     ffff indicates that this IS an application written in
+     x86 machine code.
+
+CC = word containing the cluster number of
+     this cluster's colour cluster.
+
+     0000 indicates that this cluster is monochrome.
+
+HH = 2 bytes containing the cluster number of
+     this cluster's help-cluster.
+
+     0000 indicates that this cluster is helpless.
+
+xxxxxxxxxxxxxxxxxxxx = 20 bytes reserved.
+
+DDDDDDDDDDDDDDDD = 16 bytes ASCII description e.g. "Seismology Now"
+
+
+
+------------------------------------------------------------------
+
+But the following is more like what I would like it to be...
+
+------------------------------------------------------------------
+
+First, we say that 1 "screen" is 4096 bytes:
+  80x25char + 80x25colour + 96 bytes header.
+A "tableau" is a set of 80x25 screens = 2000 * 4K = 8M.
+  There is one tableau on the computer which maps to it's extended RAM.
+
+One 1.44M floppy disk can contain six columns = 150 screens.
+
+Header:
+
++------------------------------------------------+
+|VVAAxxxxxxxxxxxxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD|
+|DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD|
++------------------------------------------------+
+
+VV = word indicating header type.
+
+     bef0 indicates standard BefOS header, the only type supported.
+
+AA = word containing the cluster number of the first cluster of
+     the application for which this is a document.
+
+     0000 indicates that there is no special application for this
+     generic document.
+
+     ffff indicates that this IS an application written in
+     x86 machine code.
+
+xxxxxxxxxxxx = 12 bytes reserved.
+
+DD..DD = 80 bytes ASCII description.
+
+
+Building BefOS
+--------------
+
+BefOS can be built on FreeBSD (and probably Linux and Cygwin.)
+Just type 'make clean all' from the top level to build it all.
+
+Here is what is in the various directories:
+
+    bin/
+        amalgam8      Constructs a boot disk image from BefOS objects
+	extract8      Extracts BefOS objects from a boot disk image
+	txt2page      Turns a text file into a BefOS object file
+	mkbfinc.pl    Used during build to generate list of API calls
+    disk/             Contains bootable BefOS boot disk images
+    obj/              Contains BefOS objects that will be amalgamated
+    src/              Contains source code for BefOS:
+        apps/         Source code for the BefOS applications installed
+	boot/         Source code for the boot disk's boot block
+	inc/          Include files shared by many BefOS object sources
+	kernel/       Source file for the core components of BefOS
+	page/         Misc files that become BefOS pages on the disk
+	tools/        Source code for the util programs put in bin/
+	turbo/        The original Turbo Assembler sources for BefOS
+Putative todo list:
+
+Clean up the code base
+Rebrand the thing because I don't like the name BefOS
+Update the README
+Document the entry points
+Abstract "main loop" out of bekernel.s, into editor.s
+Translate all tools to Python?  Or at least Perl.
+
+Switch to unreal mode on boot
+
+Allow editing memory pages
+- "current page" also needs "current device"
+- can be just the base RAM for now
+
+Implement an actual VM for it (likely something rather befungeoid, but not Befunge)
+- Execute from "current exection page"
+- If "current execution page" is "current displayed page",
+  also update cursor while executing
+Rewrite Editor in the befungeoid VM?
+
+
+Fix syscalls
+- Really, you should only be able to syscall a Beeble (=Befunge-05) instruction
+
+#!/bin/sh
+# $Id$
+
+# This is chintzy.  But at least it's not a recursive Makefile, right?
+
+TARGET=$1
+
+cd src/tools && make ${TARGET} && cd ../..
+cd src/kernel && make ${TARGET} && cd ../..
+cd src/inc && make ${TARGET} && cd ../..
+cd src/apps && make ${TARGET} && cd ../..
+cd src/page && make ${TARGET} && cd ../..
+cd src/boot && make ${TARGET} && cd ../..
+cd disk && make ${TARGET} && cd ..

src/apps/Makefile

 all: $(OBJDIR)/belife.com
 
 $(OBJDIR)/belife.com: belife.s
-	$(ASM) -f bin -o $(.TARGET) -l belife.lst belife.s
+	$(ASM) -f bin -o $@ -l belife.lst belife.s
 
 $(OBJDIR)/befterm.com: befterm.s ../inc/bekernel.inc
-	$(ASM) -f bin -o $(.TARGET) -l befterm.lst befterm.s
+	$(ASM) -f bin -o $@ -l befterm.lst befterm.s
 
 clean:
 	rm -f $(OBJDIR)/*.com *.lst

src/boot/Makefile

 all: $(OBJDIR)/beboot.com
 
 $(OBJDIR)/beboot.com: beboot.s ../inc/befos.inc
-	$(ASM) -f bin -o $(.TARGET) -l beboot.lst beboot.s
+	$(ASM) -f bin -o $@ -l beboot.lst beboot.s
 
 clean:
 	rm -f $(OBJDIR)/*.com *.lst

src/inc/befkeys.inc

-SEGMENT	.data
+SEGMENT .data
 
-keytab		dw	Unimp		; 0000
-		dw	Unimp		; 0100 Alt-ESC
-		dw	Unimp		; 0200
-		dw	Unimp		; 0300 Ctrl-2
-		dw	Unimp		; 0400
-		dw	Unimp		; 0500
-		dw	Unimp		; 0600
-		dw	Unimp		; 0700
-		dw	Unimp		; 0800
-		dw	Unimp		; 0900
-		dw	Unimp		; 0a00
-		dw	Unimp		; 0b00
-		dw	Unimp		; 0c00
-		dw	Unimp		; 0d00
-		dw	Unimp		; 0e00 Alt-BkSp
-		dw	Unimp		; 0f00
+keytab  dw  Unimp         ; 0000
+        dw  Unimp         ; 0100 Alt-ESC
+        dw  Unimp         ; 0200
+        dw  Unimp         ; 0300 Ctrl-2
+        dw  Unimp         ; 0400
+        dw  Unimp         ; 0500
+        dw  Unimp         ; 0600
+        dw  Unimp         ; 0700
+        dw  Unimp         ; 0800
+        dw  Unimp         ; 0900
+        dw  Unimp         ; 0a00
+        dw  Unimp         ; 0b00
+        dw  Unimp         ; 0c00
+        dw  Unimp         ; 0d00
+        dw  Unimp         ; 0e00 Alt-BkSp
+        dw  Unimp         ; 0f00
 
-		dw	Unimp		; 1000 Alt-Q
-		dw	Unimp		; 1100 Alt-W
-		dw	EditMode	; 1200 Alt-E
-		dw	RunAsm		; 1300 Alt-R
-		dw	ColourPage	; 1400 Alt-T
-		dw	Unimp		; 1500 Alt-Y
-		dw	FillPage	; 1600 Alt-U
-		dw	Unimp		; 1700 Alt-I
-		dw	CopyByte	; 1800 Alt-O
-		dw	PasteByte	; 1900 Alt-P
-		dw	Unimp		; 1a00 Alt-[	(sometimes)
-		dw	Unimp		; 1b00 Alt-]	(sometimes)
-		dw	Unimp		; 1c00
-		dw	Unimp		; 1d00
-		dw	PopUpTest	; 1e00 Alt-A
-		dw	SavePage	; 1f00 Alt-S
+        dw  Unimp         ; 1000 Alt-Q
+        dw  Unimp         ; 1100 Alt-W
+        dw  EditMode      ; 1200 Alt-E
+        dw  RunAsm        ; 1300 Alt-R
+        dw  ColourPage    ; 1400 Alt-T
+        dw  Unimp         ; 1500 Alt-Y
+        dw  FillPage      ; 1600 Alt-U
+        dw  Unimp         ; 1700 Alt-I
+        dw  CopyByte      ; 1800 Alt-O
+        dw  PasteByte     ; 1900 Alt-P
+        dw  Unimp         ; 1a00 Alt-[ (sometimes)
+        dw  Unimp         ; 1b00 Alt-] (sometimes)
+        dw  Unimp         ; 1c00
+        dw  Unimp         ; 1d00
+        dw  PopUpTest     ; 1e00 Alt-A
+        dw  SavePage      ; 1f00 Alt-S
 
-		dw	Unimp		; 2000 Alt-D
-		dw	Unimp		; 2100 Alt-F
-		dw	AskGoPage	; 2200 Alt-G
-		dw	ToggleHighBit	; 2300 Alt-H
-		dw	JumpPage	; 2400 Alt-J
-		dw	Unimp		; 2500 Alt-K
-		dw	LoadPage	; 2600 Alt-L
-		dw	Unimp		; 2700
-		dw	Unimp		; 2800
-		dw	Unimp		; 2900
-		dw	Unimp		; 2a00
-		dw	Unimp		; 2b00
-		dw	Unimp		; 2c00 Alt-Z
-		dw	CutPage		; 2d00 Alt-X
-		dw	CopyPage	; 2e00 Alt-C
-		dw	PastePage	; 2f00 Alt-V
+        dw  Unimp         ; 2000 Alt-D
+        dw  Unimp         ; 2100 Alt-F
+        dw  AskGoPage     ; 2200 Alt-G
+        dw  ToggleHighBit ; 2300 Alt-H
+        dw  JumpPage      ; 2400 Alt-J
+        dw  Unimp         ; 2500 Alt-K
+        dw  LoadPage      ; 2600 Alt-L
+        dw  Unimp         ; 2700
+        dw  Unimp         ; 2800
+        dw  Unimp         ; 2900
+        dw  Unimp         ; 2a00
+        dw  Unimp         ; 2b00
+        dw  Unimp         ; 2c00 Alt-Z
+        dw  CutPage       ; 2d00 Alt-X
+        dw  CopyPage      ; 2e00 Alt-C
+        dw  PastePage     ; 2f00 Alt-V
 
-		dw	Unimp		; 3000 Alt-B
-		dw	LessScreen	; 3100 Alt-N
-		dw	MoreScreen	; 3200 Alt-M
-		dw	Unimp		; 3300
-		dw	Unimp		; 3400
-		dw	Unimp		; 3500
-		dw	Unimp		; 3600
-		dw	Unimp		; 3700 Alt-*	(sometimes)
-		dw	Unimp		; 3800
-		dw	Unimp		; 3900
-		dw	Unimp		; 3a00
-		dw	HelpPage	; 3b00 F1
-		dw	DiskInfo	; 3c00 F2
-		dw	Unimp		; 3d00 F3
-		dw	EditPageProps	; 3e00 F4
-		dw	RefreshStatus	; 3f00 F5
+        dw  Unimp         ; 3000 Alt-B
+        dw  LessScreen    ; 3100 Alt-N
+        dw  MoreScreen    ; 3200 Alt-M
+        dw  Unimp         ; 3300
+        dw  Unimp         ; 3400
+        dw  Unimp         ; 3500
+        dw  Unimp         ; 3600
+        dw  Unimp         ; 3700 Alt-*	(sometimes)
+        dw  Unimp         ; 3800
+        dw  Unimp         ; 3900
+        dw  Unimp         ; 3a00
+        dw  HelpPage      ; 3b00 F1
+        dw  DiskInfo      ; 3c00 F2
+        dw  Unimp         ; 3d00 F3
+        dw  EditPageProps ; 3e00 F4
+        dw  RefreshStatus ; 3f00 F5
 
-		dw	Unimp		; 4000 F6
-		dw	ExecBeebInstr	; 4100 F7
-		dw	PlugClock	; 4200 F8
-		dw	UnplugClock	; 4300 F9
-		dw	Unimp		; 4400 F10
-		dw	Unimp		; 4500
-		dw	Unimp		; 4600
-		dw	PrevPage	; 4700 Home
-		dw	BufUp		; 4800 Up
-		dw	PageUp		; 4900 PgUp
-		dw	Unimp		; 4a00
-		dw	BufLeft		; 4b00 Left
-		dw	Unimp		; 4c00
-		dw	BufRight	; 4d00 Right
-		dw	Unimp		; 4e00
-		dw	NextPage	; 4f00 End
+        dw  Unimp         ; 4000 F6
+        dw  ExecBeebInstr ; 4100 F7
+        dw  PlugClock     ; 4200 F8
+        dw  UnplugClock   ; 4300 F9
+        dw  Unimp         ; 4400 F10
+        dw  Unimp         ; 4500
+        dw  Unimp         ; 4600
+        dw  PrevPage      ; 4700 Home
+        dw  BufUp         ; 4800 Up
+        dw  PageUp        ; 4900 PgUp
+        dw  Unimp         ; 4a00
+        dw  BufLeft       ; 4b00 Left
+        dw  Unimp         ; 4c00
+        dw  BufRight      ; 4d00 Right
+        dw  Unimp         ; 4e00
+        dw  NextPage      ; 4f00 End
 
-		dw	BufDown		; 5000 Down
-		dw	PageDown	; 5100 PgDn
-		dw	InsByte		; 5200 Ins
-		dw	DelByte		; 5300 Del
-		dw	Unimp		; 5400
-		dw	Unimp		; 5500
-		dw	Unimp		; 5600
-		dw	Unimp		; 5700
-		dw	Unimp		; 5800
-		dw	Unimp		; 5900
-		dw	Unimp		; 5a00
-		dw	Unimp		; 5b00
-		dw	Unimp		; 5c00
-		dw	Unimp		; 5d00
-		dw	Unimp		; 5e00
-		dw	Unimp		; 5f00
+        dw  BufDown       ; 5000 Down
+        dw  PageDown      ; 5100 PgDn
+        dw  Unimp         ; 5200 Ins
+        dw  Unimp         ; 5300 Del
+        dw  Unimp         ; 5400
+        dw  Unimp         ; 5500
+        dw  Unimp         ; 5600
+        dw  Unimp         ; 5700
+        dw  Unimp         ; 5800
+        dw  Unimp         ; 5900
+        dw  Unimp         ; 5a00
+        dw  Unimp         ; 5b00
+        dw  Unimp         ; 5c00
+        dw  Unimp         ; 5d00
+        dw  Unimp         ; 5e00
+        dw  Unimp         ; 5f00
 
-		dw	Unimp		; 6000
-		dw	Unimp		; 6100
-		dw	Unimp		; 6200
-		dw	Unimp		; 6300
-		dw	Unimp		; 6400
-		dw	Unimp		; 6500
-		dw	Unimp		; 6600
-		dw	Unimp		; 6700
-		dw	Unimp		; 6800
-		dw	Unimp		; 6900
-		dw	Unimp		; 6a00
-		dw	Unimp		; 6b00
-		dw	Unimp		; 6c00
-		dw	Unimp		; 6d00
-		dw	Unimp		; 6e00
-		dw	Unimp		; 6f00
+        dw  Unimp         ; 6000
+        dw  Unimp         ; 6100
+        dw  Unimp         ; 6200
+        dw  Unimp         ; 6300
+        dw  Unimp         ; 6400
+        dw  Unimp         ; 6500
+        dw  Unimp         ; 6600
+        dw  Unimp         ; 6700
+        dw  Unimp         ; 6800
+        dw  Unimp         ; 6900
+        dw  Unimp         ; 6a00
+        dw  Unimp         ; 6b00
+        dw  Unimp         ; 6c00
+        dw  Unimp         ; 6d00
+        dw  Unimp         ; 6e00
+        dw  Unimp         ; 6f00
 
-		dw	Unimp		; 7000
-		dw	Unimp		; 7100
-		dw	Unimp		; 7200
-		dw	DecByte		; 7300 Ctrl-Left
-		dw	IncByte		; 7400 Ctrl-Right
-		dw	NextDisk	; 7500 Ctrl-End
-		dw	NextTextVidPage	; 7600 Ctrl-PgDn
-		dw	PrevDisk	; 7700 Ctrl-Home
-		dw	Unimp		; 7800 Alt-1
-		dw	Unimp		; 7900 Alt-2
-		dw	Unimp		; 7a00 Alt-3
-		dw	Unimp		; 7b00 Alt-4
-		dw	Unimp		; 7c00 Alt-5
-		dw	Unimp		; 7d00 Alt-6
-		dw	Unimp		; 7e00 Alt-7
-		dw	Unimp		; 7f00 Alt-8
+        dw  Unimp         ; 7000
+        dw  Unimp         ; 7100
+        dw  Unimp         ; 7200
+        dw  DecByte       ; 7300 Ctrl-Left
+        dw  IncByte       ; 7400 Ctrl-Right
+        dw  NextDisk      ; 7500 Ctrl-End
+        dw  NextTextVidPage ; 7600 Ctrl-PgDn
+        dw  PrevDisk      ; 7700 Ctrl-Home
+        dw  Unimp         ; 7800 Alt-1
+        dw  Unimp         ; 7900 Alt-2
+        dw  Unimp         ; 7a00 Alt-3
+        dw  Unimp         ; 7b00 Alt-4
+        dw  Unimp         ; 7c00 Alt-5
+        dw  Unimp         ; 7d00 Alt-6
+        dw  Unimp         ; 7e00 Alt-7
+        dw  Unimp         ; 7f00 Alt-8
 
-		dw	Unimp		; 8000 Alt-9
-		dw	Unimp		; 8100 Alt-0
-		dw	DelPageProps	; 8200 Alt--
-		dw	InitPageProps	; 8300 Alt-=
-		dw	PrevTextVidPage	; 8400 Ctrl-PgUp
-		dw	Unimp		; 8500
-		dw	Unimp		; 8600
-		dw	Unimp		; 8700
-		dw	Unimp		; 8800
-		dw	Unimp		; 8900
-		dw	Unimp		; 8a00
-		dw	Unimp		; 8b00
-		dw	Unimp		; 8c00
-		dw	Unimp		; 8d00
-		dw	Unimp		; 8e00
-		dw	Unimp		; 8f00
+        dw  Unimp         ; 8000 Alt-9
+        dw  Unimp         ; 8100 Alt-0
+        dw  DelPageProps  ; 8200 Alt--
+        dw  InitPageProps ; 8300 Alt-=
+        dw  PrevTextVidPage ; 8400 Ctrl-PgUp
+        dw  Unimp         ; 8500
+        dw  Unimp         ; 8600
+        dw  Unimp         ; 8700
+        dw  Unimp         ; 8800
+        dw  Unimp         ; 8900
+        dw  Unimp         ; 8a00
+        dw  Unimp         ; 8b00
+        dw  Unimp         ; 8c00
+        dw  Unimp         ; 8d00
+        dw  Unimp         ; 8e00
+        dw  Unimp         ; 8f00

src/inc/maybe_so/befcom.inc

-DATASEG
-
-baud		dw	08h
-comhead		dw	combuf
-comtail		dw	combuf
-
-CODESEG
-
-PUBLIC	InitCom
-PROC	InitCom
-
-		mov	ax, 0400h	; ext. init COM port
-		mov	bx, 0
-		mov	cx, 0300h
-		add	cx, [word baud]
-		mov	dx, 0		; COM1
-		int	14h		; init port
-
-		mov	ax, 0500h
-		int	14h
-		or	bl, 3		; up my DTR & RTS
-		mov	ax, 0501h
-		int	14h
-
-		and	ax, 8e00h
-		cmp	ax, 0
-		je	@@Great
-		jmp	BadLight
-@@Great:	jmp	OKLight
-
-ENDP
-
-PUBLIC	StatCom
-PROC	StatCom
-		mov	ax, 0300h
-		mov	dx, 0
-		int	14h		; check port
-		mov	cx, ax
-		ret
-ENDP
-
-PUBLIC	WriteCom
-PROC	WriteCom
-; cl = char to write
-@@OutAgain:	mov	dx, 03f8h + 5
-		in	al, dx
-		and	al, 020h
-		jz	@@OutAgain
-
-		mov	al, cl
-		mov	dx, 03f8h
-		out	dx, al
-ENDP
-
-PUBLIC	ReadCom
-PROC	ReadCom
-; read cl from combuf.
-; returns ch = number of chars (0 or 1.)
-
-		mov	bx, [word comhead]
-		cmp	bx, [word comtail]
-		je	@@Nothing
-
-		mov	cl, [byte combuf + bx]
-		inc	bx
-		cmp	bx, 2048
-		jne	@@NoWrap
-		xor	bx, bx
-
-@@NoWrap:	mov	[word comhead], bx
-		mov	ch, 1
-		ret
-
-@@Nothing:	xor	cx, cx
-		ret
-ENDP
-
-PUBLIC	PlugCom
-PROC	PlugCom
-
-		call	WorkLight
-
-		mov	cl, 0ch
-		call	ReadIntr
-
-		mov	ax, es
-		mov	[word comSegment], ax
-		mov	[word comOffset], di
-
-		mov	ax, cs
-		mov	es, ax
-		mov	di, offset ComISR
-		mov	cl, 0ch		; com #0 interrupt
-		call	WriteIntr
-
-		; the 8259 stuff
-
-		in	al, 021h	; 8259_1 line: read 8259 enable masks
-		and	al, 0efh	; clear masked bit, enabling IRQ
-		out	021h, al	; spit back out, write new masks
-
-		; the 8250 stuff
-
-		mov	dx, 03f8h + 3	; LineControl
-		in	al, dx
-		and	al, 07fh	; clear bit 7 "DLAB"
-		out	dx, al
-
-		mov	dx, 03f8h + 1	; InterruptEnable
-		xor	al, al
-		inc	al
-		out	dx, al
-
-		; clear Rx, LineStatus, ModemStatus
-
-@@ClearLines:	mov	dx, 03f8h
-		in	al, dx
-		add	dx, 5
-		in	al, dx
-		inc	dx
-		in	al, dx
-
-		; keep doing so until we get green flag.
-
-		mov	dx, 03f8h + 2	; IntIdent
-		in	al, dx
-		test	al, 1
-		jz	@@ClearLines
-
-		; set bit 3 of ModemControl
-
-		mov	dx, 03f8h + 4	; ModemControl
-		in	al, dx
-		or	al, 08h
-		out	dx, al		; Blastoff!
-
-		call	OKLight
-
-		ret
-ENDP
-
-PUBLIC	UnplugCom
-PROC	UnplugCom
-
-		call	WorkLight
-		mov	ax, [word comSegment]
-		cmp	ax, 0
-		je	@@Fail
-		mov	[word comSegment], 0
-		mov	es, ax
-		mov	di, [word comOffset]
-		mov	cl, 0ch		; com #0 interrupt
-		call	WriteIntr
-		call	OKLight
-		ret
-@@Fail:		jmp	BadLight
-ENDP
-
-PUBLIC	ComISR
-PROC	ComISR
-		push	ax
-		push	bx
-		push	dx
-		push	ds
-
-		mov	ax, cs
-		mov	ds, ax
-
-		mov	dx, 03f8h
-		in	al, dx		; al = char read from port
-
-		mov	bx, [word comtail]
-		mov	[byte combuf + bx], al	; store in buffer
-		inc	bx
-
-		cmp	bx, 2048
-		jne	@@NoWrap
-
-		xor	bx, bx
-
-@@NoWrap:	mov	[word comtail], bx
-
-		; issue end-of-interrupt to 8259.
-
-		mov	al, 020h
-		out	020h, al	; 8259_0 line
-
-		pop	ds
-		pop	dx
-		pop	bx
-		pop	ax
-
-		iret
-ENDP

src/inc/maybe_so/befgraph.inc

-CENX		EQU	160	; center of VGA screen xwise
-CENY		EQU	100	; center of VGA screen ywise
-
-CODESEG
-
-;	mov	di, [word tcol]
-;	inc	di
-;	mov	[word tcol], di
-;	mov	si, di
-;	mov	ax, [word mx]
-;	mov	bx, [word my]
-;	mov	cx, 160
-;	mov	dx, 199
-;	call	LINE
-;
-;	; now, is there a keypress outstanding?
-;
-;	mov	ah, 1
-;	int	16h	
-;	jz	@@Tram
-;	jmp	@@Test
-;
-;	; IF A$ = "" THEN
-;
-
-PUBLIC	SynchRaster
-PROC	SynchRaster
-; dx,al = DESTROYED
-
-	mov	dx, 03dah
-@@VRT3:	in	al, dx
-	test	al, 08h
-	je	@@VRT3
-ENDP
-
-;	mov	si, 0
-;	mov	ax, [word mx]
-;	mov	bx, [word my]
-;	mov	cx, 160
-;	mov	dx, 199
-;	call	LINE
-;
-
-PUBLIC	DrawPix
-PROC	DrawPix
-; es SHOULD BE SET TO pixbase FIRST!!
-	;	ah = y coordinate
-	;	bx = x coordinate
-	;	dl = colour
-	;	cx, al DESTROYED
-
-	; VGA[(py<<8)+(py<<6)+px]=color;
-
-	xor	al, al
-	mov	cx, ax
-	shr	cx, 2
-	add	ax, cx
-	add	ax, bx
-	mov	di, ax
-	mov	[byte es:di], dl
-	ret
-ENDP
-
-;	Thanks for the following algorithm goes to lines.c
-;	by David Brackeen (http://silo.csci.unt.edu/home/brackeen/vga/)
-
-PUBLIC	DrawLine
-PROC	DrawLine
-; es SHOULD BE SET TO pixbase FIRST!!
-	;	ax = x1 coordinate
-	;	bx = y1 coordinate
-	;	cx = x2 coordinate
-	;	dx = y2 coordinate
-	;	si = colour
-
-	;  px=x1;
-	;  py=y1;
-
-	mov	[word lpx], ax
-	mov	[word lpy], bx
-
-	;  dx=x2-x1; (cx-ax) /* the horizontal distance of the line */
-	;  dy=y2-y1; (bh-bl) /* the vertical distance of the line */
-
-	sub	cx, ax
-	mov	[word ldx], cx
-
-	sub	dx, bx
-	mov	[word ldy], dx
-
-	mov	bx, si
-	mov	[byte lcol], bl
-
-	;  dxabs=abs(dx);
-	;  dyabs=abs(dy);
-	;  sdx=sgn(dx);
-	;  sdy=sgn(dy);
-
-	mov	[word lsdx], 1
-	cmp	cx, 0
-	jge	@@S1
-
-	neg	cx
-	mov	[word lsdx], -1
-
-@@S1:	mov	[word ldxabs], cx
-
-	mov	[word lsdy], 1
-	cmp	dx, 0
-	jge	@@S2
-
-	neg	dx
-	mov	[word lsdy], -1
-
-@@S2:	mov	[word ldyabs], dx
-
-	;  x=dyabs>>1;
-	;  y=dxabs>>1;
-
-	shr	cx, 1
-	mov	[word ly], cx
-
-	shr	dx, 1
-	mov	[word lx], dx
-
-	; VGA[(py<<8)+(py<<6)+px]=color;
-
-	mov	bx, [word lpx]
-	mov	ax, [word lpy]
-	mov	ah, al
-	mov	dl, [byte lcol]
-	call	DrawPix
-
-	;  if (dxabs>=dyabs) /* the line is more horizontal than vertical */
-	;  {
-
-	mov	ax, [word ldyabs]
-	cmp	ax, [word ldxabs]
-	jg	@@Vert
-
-	;	if dx>=dy we draw dy horizontal lines
-	;	staggered between y1 and y2.
-	;	each line is of length dx/dy
-
-	;    for(i=0;i<dxabs;i++) ( i == bx )
-	;    {
-
-	xor	bx, bx
-@@B1:	cmp	bx, [word ldxabs]
-	jge	@@E1
-
-	;      y+=dyabs;
-
-	mov	ax, [word ldyabs]
-	add	ax, [word ly]
-	mov	[word ly], ax
-
-	;      if (y>=dxabs)
-	;      {
-
-	cmp	ax, [word ldxabs]
-	jl	@@NE1
-
-	;        y-=dxabs;
-
-	sub	ax, [word ldxabs]
-	mov	[word ly], ax
-
-	;        py+=sdy;
-
-	mov	ax, [word lsdy]
-	add	[word lpy], ax
-
-	;      }
-
-@@NE1:
-	;      px+=sdx;
-
-	mov	ax, [word lsdx]
-	add	[word lpx], ax
-
-	;      plot_pixel(px,py,color);
-
-	mov	[word temp], bx
-	mov	bx, [word lpx]
-	mov	ax, [word lpy]
-	mov	ah, al
-	mov	dl, [byte lcol]
-	call	DrawPix
-	mov	bx, [word temp]
-
-	;    }
-
-	inc	bx
-	jmp	@@B1
-
-	;  }
-
-@@E1:	jmp	@@Exit
-
-        ; else the line is more vertical than horizontal
-
-@@Vert:	;	if dy>dx we draw dx vertical lines
-	;	staggered between x1 and x2.
-	;	each line is of length dy/dx
-
-	;  {
-	;    for(i=0;i<dyabs;i++) (i == bl)
-
-	xor	bx, bx
-@@B2:	cmp	bx, [word ldyabs]
-	jge	@@E1
-
-	;    {
-	;      x+=dxabs;
-
-	mov	ax, [word ldxabs]
-	add	ax, [word lx]
-	mov	[word lx], ax
-
-	;      if (x>=dyabs)
-	;      {
-
-	cmp	ax, [word ldyabs]
-	jl	@@NE2
-
-	;        x-=dyabs;
-
-	sub	ax, [word ldyabs]
-	mov	[word lx], ax
-
-	;        px+=sdx;
-
-	mov	ax, [word lsdx]
-	add	[word lpx], ax
-
-	;      }
-
-@@NE2:
-	;      py+=sdy;
-
-	mov	ax, [word lsdy]
-	add	[word lpy], ax
-
-	;      plot_pixel(px,py,color);
-
-	mov	[word temp], bx
-	mov	bx, [word lpx]
-	mov	ax, [word lpy]
-	mov	ah, al
-	mov	dl, [byte lcol]
-	call	DrawPix
-	mov	bx, [word temp]
-
-	;    }
-
-	inc	bx
-	jmp	@@B2
-
-	;  }
-
-@@Exit:	ret
-
-ENDP

src/inc/maybe_so/befosfnt.inc

-charset	db	0, 0, 192, 64, 64, 122, 68, 74, 82, 98, 66, 188, 0, 0, 0, 0
-	db	0, 0, 126, 129, 165, 129, 129, 165, 153, 129, 129, 126, 0, 0, 0, 0
-	db	0, 0, 126, 255, 219, 255, 255, 219, 231, 255, 255, 126, 0, 0, 0, 0
-	db	0, 0, 0, 0, 68, 238, 254, 254, 254, 124, 56, 16, 0, 0, 0, 0
-	db	0, 0, 0, 0, 16, 56, 124, 254, 124, 56, 16, 0, 0, 0, 0, 0
-	db	0, 0, 0, 24, 60, 60, 102, 231, 231, 24, 24, 60, 0, 0, 0, 0
-	db	0, 0, 0, 24, 60, 126, 255, 255, 126, 24, 24, 60, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 24, 60, 60, 24, 0, 0, 0, 0, 0, 0
-	db	255, 255, 255, 255, 255, 255, 231, 195, 195, 231, 255, 255, 255, 255, 255, 255
-	db	0, 0, 0, 0, 0, 24, 36, 66, 66, 36, 24, 0, 0, 0, 0, 0
-	db	255, 255, 255, 255, 255, 231, 219, 189, 189, 219, 231, 255, 255, 255, 255, 255
-	db	0, 14, 6, 10, 16, 32, 124, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 130, 130, 124, 16, 124, 16, 16, 0, 0, 0, 0
-	db	0, 0, 24, 24, 28, 22, 18, 16, 16, 112, 240, 224, 0, 0, 0, 0
-	db	0, 0, 63, 33, 63, 33, 33, 33, 33, 39, 231, 230, 192, 0, 0, 0
-	db	0, 0, 0, 16, 56, 146, 124, 198, 124, 146, 56, 16, 0, 0, 0, 0
-	db	0, 128, 192, 224, 240, 248, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0
-	db	0, 2, 6, 14, 30, 62, 126, 62, 30, 14, 6, 2, 0, 0, 0, 0
-	db	0, 0, 16, 56, 124, 16, 16, 16, 124, 56, 16, 0, 0, 0, 0, 0
-	db	0, 0, 68, 68, 68, 68, 68, 68, 68, 0, 68, 68, 0, 0, 0, 0
-	db	0, 0, 126, 148, 148, 148, 116, 20, 20, 20, 20, 20, 0, 0, 0, 0
-	db	0, 124, 130, 64, 56, 68, 130, 130, 68, 56, 4, 130, 124, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 0, 254, 254, 254, 254, 0, 0, 0, 0
-	db	0, 0, 16, 56, 124, 16, 16, 16, 124, 56, 16, 124, 0, 0, 0, 0
-	db	16, 56, 124, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
-	db	16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 124, 56, 16
-	db	0, 0, 0, 0, 0, 4, 6, 255, 6, 4, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 32, 96, 255, 96, 32, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 128, 128, 128, 252, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 40, 68, 254, 68, 40, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 16, 56, 56, 124, 124, 254, 254, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 254, 254, 124, 124, 56, 56, 16, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 16, 56, 56, 56, 16, 16, 16, 0, 16, 16, 0, 0, 0, 0
-	db	0, 36, 36, 36, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 72, 72, 252, 72, 72, 72, 252, 72, 72, 0, 0, 0, 0
-	db	16, 16, 124, 130, 130, 128, 124, 2, 2, 130, 130, 124, 16, 16, 0, 0
-	db	0, 0, 0, 66, 162, 68, 8, 16, 32, 68, 138, 132, 0, 0, 0, 0
-	db	0, 0, 112, 136, 136, 144, 96, 144, 138, 132, 138, 114, 0, 0, 0, 0
-	db	0, 16, 16, 16, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 12, 16, 32, 32, 32, 32, 32, 32, 16, 12, 0, 0, 0, 0
-	db	0, 0, 48, 8, 4, 4, 4, 4, 4, 4, 8, 48, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 108, 56, 254, 56, 108, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 16, 16, 124, 16, 16, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 16, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 252, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 2, 4, 8, 16, 32, 64, 128, 0, 0, 0, 0
-	db	0, 0, 124, 134, 138, 138, 146, 146, 162, 162, 194, 124, 0, 0, 0, 0
-	db	0, 0, 16, 48, 80, 16, 16, 16, 16, 16, 16, 124, 0, 0, 0, 0
-	db	0, 0, 124, 130, 2, 4, 8, 16, 32, 64, 128, 254, 0, 0, 0, 0
-	db	0, 0, 124, 130, 2, 2, 60, 2, 2, 2, 130, 124, 0, 0, 0, 0
-	db	0, 0, 12, 20, 36, 68, 132, 254, 4, 4, 4, 14, 0, 0, 0, 0
-	db	0, 0, 254, 128, 128, 128, 252, 2, 2, 2, 130, 124, 0, 0, 0, 0
-	db	0, 0, 60, 64, 128, 128, 252, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 254, 2, 2, 2, 4, 8, 16, 32, 32, 32, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 130, 124, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 130, 126, 2, 2, 2, 4, 120, 0, 0, 0, 0
-	db	0, 0, 0, 0, 16, 16, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 16, 16, 0, 0, 0, 16, 16, 32, 0, 0, 0, 0
-	db	0, 0, 0, 4, 8, 16, 32, 64, 32, 16, 8, 4, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 124, 0, 0, 124, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 32, 16, 8, 4, 2, 4, 8, 16, 32, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 4, 8, 16, 16, 0, 16, 16, 0, 0, 0, 0
-	db	0, 0, 0, 124, 130, 130, 158, 146, 146, 156, 128, 124, 0, 0, 0, 0
-	db	0, 0, 16, 40, 68, 130, 130, 254, 130, 130, 130, 130, 0, 0, 0, 0
-	db	0, 0, 252, 66, 66, 66, 124, 66, 66, 66, 66, 252, 0, 0, 0, 0
-	db	0, 0, 60, 66, 128, 128, 128, 128, 128, 128, 66, 60, 0, 0, 0, 0
-	db	0, 0, 248, 68, 66, 66, 66, 66, 66, 66, 68, 248, 0, 0, 0, 0
-	db	0, 0, 254, 66, 66, 72, 120, 72, 64, 66, 66, 254, 0, 0, 0, 0
-	db	0, 0, 254, 66, 64, 64, 120, 64, 64, 64, 64, 224, 0, 0, 0, 0
-	db	0, 0, 60, 66, 130, 128, 128, 158, 130, 130, 70, 58, 0, 0, 0, 0
-	db	0, 0, 130, 130, 130, 130, 254, 130, 130, 130, 130, 130, 0, 0, 0, 0
-	db	0, 0, 124, 16, 16, 16, 16, 16, 16, 16, 16, 124, 0, 0, 0, 0
-	db	0, 0, 14, 4, 4, 4, 4, 4, 132, 132, 132, 120, 0, 0, 0, 0
-	db	0, 0, 194, 68, 72, 80, 96, 80, 72, 68, 66, 194, 0, 0, 0, 0
-	db	0, 0, 224, 64, 64, 64, 64, 64, 64, 64, 66, 254, 0, 0, 0, 0
-	db	0, 0, 130, 198, 170, 146, 130, 130, 130, 130, 130, 130, 0, 0, 0, 0
-	db	0, 0, 130, 194, 162, 146, 138, 134, 130, 130, 130, 130, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 130, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 252, 66, 66, 66, 124, 64, 64, 64, 64, 240, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 130, 130, 130, 130, 146, 146, 124, 4, 6, 0, 0
-	db	0, 0, 252, 66, 66, 66, 124, 68, 68, 66, 66, 194, 0, 0, 0, 0
-	db	0, 0, 124, 130, 130, 64, 48, 12, 2, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 254, 146, 16, 16, 16, 16, 16, 16, 16, 124, 0, 0, 0, 0
-	db	0, 0, 130, 130, 130, 130, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 130, 130, 130, 130, 130, 130, 130, 68, 40, 16, 0, 0, 0, 0
-	db	0, 0, 130, 130, 130, 130, 130, 146, 146, 146, 146, 108, 0, 0, 0, 0
-	db	0, 0, 130, 130, 68, 40, 16, 16, 40, 68, 130, 130, 0, 0, 0, 0
-	db	0, 0, 130, 130, 130, 68, 40, 16, 16, 16, 16, 56, 0, 0, 0, 0
-	db	0, 0, 254, 130, 4, 8, 16, 32, 64, 128, 130, 254, 0, 0, 0, 0
-	db	0, 0, 60, 32, 32, 32, 32, 32, 32, 32, 32, 60, 0, 0, 0, 0
-	db	0, 0, 0, 128, 192, 96, 48, 24, 12, 6, 2, 0, 0, 0, 0, 0
-	db	0, 0, 60, 4, 4, 4, 4, 4, 4, 4, 4, 60, 0, 0, 0, 0
-	db	16, 40, 68, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0, 0
-	db	0, 16, 16, 16, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 120, 4, 124, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 192, 64, 64, 120, 68, 66, 66, 66, 66, 124, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 124, 130, 128, 128, 128, 130, 124, 0, 0, 0, 0
-	db	0, 0, 12, 4, 4, 60, 68, 132, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 124, 130, 130, 252, 128, 130, 124, 0, 0, 0, 0
-	db	0, 0, 28, 34, 32, 32, 120, 32, 32, 32, 32, 112, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 118, 140, 132, 132, 132, 132, 124, 4, 132, 120, 0
-	db	0, 0, 192, 64, 64, 92, 98, 66, 66, 66, 66, 194, 0, 0, 0, 0
-	db	0, 0, 16, 16, 0, 48, 16, 16, 16, 16, 16, 124, 0, 0, 0, 0
-	db	0, 0, 4, 4, 0, 12, 4, 4, 4, 4, 4, 4, 4, 68, 56, 0
-	db	0, 0, 192, 64, 64, 66, 68, 120, 72, 68, 66, 194, 0, 0, 0, 0
-	db	0, 0, 112, 16, 16, 16, 16, 16, 16, 16, 16, 124, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 236, 146, 146, 146, 146, 146, 130, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 220, 98, 66, 66, 66, 66, 66, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 124, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 220, 98, 66, 66, 66, 66, 124, 64, 64, 224, 0
-	db	0, 0, 0, 0, 0, 118, 140, 132, 132, 132, 132, 124, 4, 4, 14, 0
-	db	0, 0, 0, 0, 0, 220, 98, 64, 64, 64, 64, 224, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 124, 130, 128, 124, 2, 130, 124, 0, 0, 0, 0
-	db	0, 0, 32, 32, 32, 252, 32, 32, 32, 32, 34, 28, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 132, 132, 132, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 130, 130, 130, 130, 68, 40, 16, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 130, 130, 146, 146, 146, 146, 108, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 198, 40, 40, 16, 40, 40, 198, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 130, 130, 130, 130, 130, 134, 122, 2, 4, 248, 0
-	db	0, 0, 0, 0, 0, 254, 132, 8, 16, 32, 66, 254, 0, 0, 0, 0
-	db	0, 0, 14, 16, 16, 16, 96, 16, 16, 16, 16, 14, 0, 0, 0, 0
-	db	0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0
-	db	0, 0, 112, 8, 8, 8, 6, 8, 8, 8, 8, 112, 0, 0, 0, 0
-	db	0, 50, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 16, 16, 40, 40, 68, 68, 130, 254, 0, 0, 0, 0, 0
-	db	0, 0, 60, 66, 128, 128, 128, 128, 128, 128, 66, 60, 16, 48, 0, 0
-	db	0, 0, 132, 0, 0, 132, 132, 132, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 8, 16, 32, 0, 124, 130, 130, 252, 128, 130, 124, 0, 0, 0, 0
-	db	0, 16, 40, 68, 0, 120, 4, 124, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 132, 0, 0, 120, 4, 124, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 32, 16, 8, 0, 120, 4, 124, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 48, 72, 48, 0, 120, 4, 124, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 124, 130, 128, 128, 128, 130, 124, 8, 48, 0, 0
-	db	0, 16, 40, 68, 0, 124, 130, 130, 252, 128, 130, 124, 0, 0, 0, 0
-	db	0, 0, 130, 0, 0, 124, 130, 130, 252, 128, 130, 124, 0, 0, 0, 0
-	db	0, 32, 16, 8, 0, 124, 130, 130, 252, 128, 130, 124, 0, 0, 0, 0
-	db	0, 0, 68, 0, 0, 48, 16, 16, 16, 16, 16, 56, 0, 0, 0, 0
-	db	0, 16, 40, 68, 0, 48, 16, 16, 16, 16, 16, 56, 0, 0, 0, 0
-	db	0, 32, 16, 8, 0, 48, 16, 16, 16, 16, 16, 56, 0, 0, 0, 0
-	db	0, 130, 0, 16, 40, 68, 130, 130, 254, 130, 130, 130, 0, 0, 0, 0
-	db	56, 68, 56, 16, 40, 68, 130, 130, 254, 130, 130, 130, 0, 0, 0, 0
-	db	8, 16, 0, 254, 66, 66, 72, 120, 72, 66, 66, 254, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 236, 18, 18, 126, 144, 144, 110, 0, 0, 0, 0
-	db	0, 0, 62, 72, 136, 136, 254, 136, 136, 136, 136, 142, 0, 0, 0, 0
-	db	0, 16, 40, 68, 0, 124, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 130, 0, 0, 124, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 32, 16, 8, 0, 124, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 48, 72, 132, 0, 132, 132, 132, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 32, 16, 8, 0, 132, 132, 132, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 130, 0, 0, 130, 130, 130, 130, 130, 134, 122, 2, 4, 248, 0
-	db	0, 130, 0, 124, 130, 130, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 130, 0, 130, 130, 130, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 16, 16, 124, 146, 144, 144, 144, 146, 124, 16, 16, 0, 0, 0, 0
-	db	0, 56, 68, 68, 64, 240, 64, 240, 64, 64, 66, 252, 0, 0, 0, 0
-	db	0, 0, 68, 68, 56, 16, 124, 16, 124, 16, 16, 16, 0, 0, 0, 0
-	db	0, 240, 136, 136, 240, 136, 136, 158, 136, 136, 136, 134, 0, 0, 0, 0
-	db	0, 14, 17, 16, 16, 16, 124, 16, 16, 16, 144, 96, 0, 0, 0, 0
-	db	0, 8, 16, 32, 0, 120, 4, 124, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 8, 16, 32, 0, 48, 16, 16, 16, 16, 16, 56, 0, 0, 0, 0
-	db	0, 8, 16, 32, 0, 124, 130, 130, 130, 130, 130, 124, 0, 0, 0, 0
-	db	0, 8, 16, 32, 0, 132, 132, 132, 132, 132, 140, 118, 0, 0, 0, 0
-	db	0, 0, 100, 152, 0, 220, 98, 66, 66, 66, 66, 66, 0, 0, 0, 0
-	db	100, 152, 0, 130, 194, 162, 146, 138, 134, 130, 130, 130, 0, 0, 0, 0
-	db	0, 0, 48, 72, 72, 52, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 48, 72, 72, 48, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 16, 16, 0, 16, 32, 64, 128, 130, 130, 124, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 254, 128, 128, 128, 128, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 254, 2, 2, 2, 2, 0, 0, 0, 0, 0
-	db	0, 64, 192, 66, 68, 72, 16, 32, 64, 156, 2, 12, 16, 30, 0, 0
-	db	0, 64, 192, 66, 68, 72, 16, 32, 70, 138, 18, 31, 2, 2, 0, 0
-	db	0, 0, 8, 8, 0, 8, 8, 8, 28, 28, 28, 8, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 36, 72, 144, 72, 36, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 144, 72, 36, 72, 144, 0, 0, 0, 0, 0, 0
-	db	17, 68, 17, 68, 17, 68, 17, 68, 17, 68, 17, 68, 17, 68, 17, 68
-	db	85, 170, 85, 170, 85, 170, 85, 170, 85, 170, 85, 170, 85, 170, 85, 170
-	db	221, 119, 221, 119, 221, 119, 221, 119, 221, 119, 221, 119, 221, 119, 221, 119
-	db	24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24
-	db	24, 24, 24, 24, 24, 24, 24, 248, 24, 24, 24, 24, 24, 24, 24, 24
-	db	24, 24, 24, 24, 24, 248, 24, 248, 24, 24, 24, 24, 24, 24, 24, 24
-	db	54, 54, 54, 54, 54, 54, 54, 246, 54, 54, 54, 54, 54, 54, 54, 54
-	db	0, 0, 0, 0, 0, 0, 0, 252, 54, 54, 54, 54, 54, 54, 54, 54
-	db	0, 0, 0, 0, 0, 240, 24, 248, 24, 24, 24, 24, 24, 24, 24, 24
-	db	54, 54, 54, 54, 54, 230, 6, 230, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54
-	db	0, 0, 0, 0, 0, 252, 6, 230, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 230, 6, 252, 0, 0, 0, 0, 0, 0, 0, 0
-	db	54, 54, 54, 54, 54, 54, 54, 252, 0, 0, 0, 0, 0, 0, 0, 0
-	db	24, 24, 24, 24, 24, 248, 24, 240, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 240, 24, 24, 24, 24, 24, 24, 24, 24
-	db	24, 24, 24, 24, 24, 24, 24, 15, 0, 0, 0, 0, 0, 0, 0, 0
-	db	24, 24, 24, 24, 24, 24, 24, 255, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 255, 24, 24, 24, 24, 24, 24, 24, 24
-	db	24, 24, 24, 24, 24, 24, 24, 31, 24, 24, 24, 24, 24, 24, 24, 24
-	db	0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0
-	db	24, 24, 24, 24, 24, 24, 24, 255, 24, 24, 24, 24, 24, 24, 24, 24
-	db	24, 24, 24, 24, 24, 31, 24, 31, 24, 24, 24, 24, 24, 24, 24, 24
-	db	54, 54, 54, 54, 54, 54, 54, 55, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 51, 48, 31, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 31, 48, 51, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 227, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 255, 0, 227, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 51, 48, 51, 54, 54, 54, 54, 54, 54, 54, 54
-	db	0, 0, 0, 0, 0, 255, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0
-	db	54, 54, 54, 54, 54, 227, 0, 227, 54, 54, 54, 54, 54, 54, 54, 54
-	db	24, 24, 24, 24, 24, 255, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0
-	db	54, 54, 54, 54, 54, 54, 54, 255, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 255, 0, 255, 24, 24, 24, 24, 24, 24, 24, 24
-	db	0, 0, 0, 0, 0, 0, 0, 255, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 54, 54, 31, 0, 0, 0, 0, 0, 0, 0, 0
-	db	24, 24, 24, 24, 24, 31, 24, 15, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 15, 24, 31, 24, 24, 24, 24, 24, 24, 24, 24
-	db	0, 0, 0, 0, 0, 0, 0, 31, 54, 54, 54, 54, 54, 54, 54, 54
-	db	54, 54, 54, 54, 54, 54, 54, 255, 54, 54, 54, 54, 54, 54, 54, 54
-	db	24, 24, 24, 24, 24, 255, 24, 255, 24, 24, 24, 24, 24, 24, 24, 24
-	db	24, 24, 24, 24, 24, 24, 24, 240, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 15, 24, 24, 24, 24, 24, 24, 24, 24
-	db	255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
-	db	0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255
-	db	240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240
-	db	15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
-	db	255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 98, 148, 136, 136, 136, 148, 98, 0, 0, 0, 0
-	db	0, 0, 120, 132, 132, 132, 152, 132, 130, 162, 162, 156, 0, 0, 0, 0
-	db	0, 0, 254, 130, 130, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0
-	db	0, 0, 0, 0, 128, 254, 68, 68, 68, 68, 68, 70, 0, 0, 0, 0
-	db	0, 0, 254, 130, 64, 32, 16, 16, 32, 64, 130, 254, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 126, 136, 136, 136, 136, 136, 112, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 66, 66, 66, 66, 66, 66, 124, 64, 64, 128, 0
-	db	0, 0, 0, 0, 114, 156, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0
-	db	0, 0, 126, 24, 36, 66, 66, 66, 66, 36, 24, 126, 0, 0, 0, 0
-	db	0, 0, 56, 68, 130, 130, 254, 130, 130, 130, 68, 56, 0, 0, 0, 0
-	db	0, 0, 56, 68, 130, 130, 130, 68, 40, 40, 40, 238, 0, 0, 0, 0
-	db	0, 0, 14, 16, 8, 4, 62, 66, 66, 66, 66, 60, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 102, 153, 153, 153, 102, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 1, 2, 110, 153, 153, 153, 102, 64, 128, 0, 0, 0, 0
-	db	0, 0, 28, 32, 64, 64, 124, 64, 64, 64, 32, 28, 0, 0, 0, 0
-	db	0, 0, 0, 124, 130, 130, 130, 130, 130, 130, 130, 130, 0, 0, 0, 0
-	db	0, 0, 0, 0, 254, 0, 0, 254, 0, 0, 254, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 16, 16, 124, 16, 16, 0, 0, 124, 0, 0, 0, 0
-	db	0, 0, 0, 16, 8, 4, 2, 4, 8, 16, 0, 62, 0, 0, 0, 0
-	db	0, 0, 0, 8, 16, 32, 64, 32, 16, 8, 0, 124, 0, 0, 0, 0
-	db	0, 0, 0, 4, 8, 124, 16, 16, 124, 32, 64, 0, 0, 0, 0, 0
-	db	16, 16, 16, 16, 16, 16, 16, 16, 16, 144, 144, 144, 96, 0, 0, 0
-	db	0, 0, 0, 0, 0, 16, 0, 124, 0, 16, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 100, 152, 0, 100, 152, 0, 0, 0, 0, 0, 0
-	db	0, 56, 68, 68, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 24, 24, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 7, 4, 4, 4, 4, 8, 8, 136, 72, 40, 24, 0, 0, 0, 0
-	db	0, 40, 52, 36, 36, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 56, 68, 8, 16, 32, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 126, 126, 126, 126, 126, 126, 126, 0, 0, 0, 0, 0
-	db	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

src/kernel/Makefile

 all: $(OBJDIR)/bekernel.com
 
 $(OBJDIR)/bekernel.com: bekernel.s \
-			memory.s interrupt.s keyboard.s video.s disk.s comm.s \
+			memory.s interrupt.s keyboard.s video.s disk.s \
 			screen.s digit.s display.s statusbar.s dataedit.s \
 			page.s pageedit.s pageprop.s buffedit.s copypaste.s \
 			syscall.s interp.s \
 			../inc/befos.inc ../inc/befkeys.inc ../inc/beeble.inc
-	$(ASM) -f bin -o $(.TARGET) -l bekernel.lst bekernel.s
+	$(ASM) -f bin -o $@ -l bekernel.lst bekernel.s
 
 clean:
 	rm -f $(OBJDIR)/*.com *.lst

src/kernel/bekernel.s

-; BefOS Kernel BEKERNEL.COM
-; v2004.0404
-; (c)1999-2004 Cat's-Eye Technologies.  All rights reserved.
+; BefOS Kernel
+; $Id$
+; (c)1999-2010 Cat's-Eye Technologies.  All rights reserved.
 
 ;--- NOTES ---------------------------------------------------;
 
 %include "video.s"
 %include "keyboard.s"
 %include "disk.s"
-; %include "comm.s"
 
 %include "screen.s"
 %include "digit.s"

src/kernel/comm.s

-;--- BEGIN ---------------------------------------------------;
-
-;--- CONSTANTS -----------------------------------------------;
-
-;--- DATA ----------------------------------------------------;
-
-SEGMENT	.data
-
-;--- BSS -----------------------------------------------------;
-
-SEGMENT	.bss
-
-combuf:		RESB 2048	; communications port buffer
-comhandle:	RESW 1
-
-;--- CODE ----------------------------------------------------;
-
-SEGMENT	.text
-
-;--- END -----------------------------------------------------;

src/kernel/copypaste.s

 		mov	al, [coybyte]
 		mov	[cbuffer + di], al
 		mov	cl, al
-		jmp	ShowByte
+		call	ShowByte
+                jmp     Advance
 
 ;--- END -----------------------------------------------------;

src/kernel/memory.s

 
 ;--- DATA ----------------------------------------------------;
 
-SEGMENT	.data
-
-;--- Global Descriptor Table (GDT) ---------------------------;
-	
-gdt:		times 16 db 0
-srclen:		dw 0
-srcaddr:	dw 0
-		db 0
-srcacc:		db 93h
-srchigh:	dw 0
-destlen:	dw 0
-destaddr:	dw 0
-		db 0
-destacc:	db 93h
-desthigh:	dw 0
-gdtpad:		times 16 db 0
-
 ;--- BSS -----------------------------------------------------;
 
 SEGMENT	.bss
 		
 		ret
 
-
-StoreExtPage:	push	es
-		call	WorkLight
-
-		mov	[srclen], word 2048
-		mov	[srcaddr], word cbuffer
-		mov	ax, ds
-		shl	ax, 4
-		add	[srcaddr], ax
-		mov	ax, ds
-		shr	ax, 12
-		mov	[srcaddr+2], al
-
-		mov	[destlen], word 2048
-		mov	[destaddr], word 0
-		mov	[destaddr+2], byte 10h
-
-		mov	ax, ds
-		mov	es, ax
-		mov	ah, 87h
-		mov	cx, 1024
-		mov	si, gdt
-		int	15h
-
-		jc	.Error
-		pop	es
-		jmp	OKLight
-.Error:		pop	es
-		jmp	BadLight
-
-
-RetrieveExtPage:push	es
-		call	WorkLight
-
-		mov	[srclen], word 2048
-		mov	[srcaddr], word 0
-		mov	[srcaddr+2], byte 10h
-
-		mov	[destlen], word 2048
-		mov	[destaddr], word cbuffer
-		mov	ax, ds
-		shl	ax, 4
-		add	[destaddr], ax
-		mov	ax, ds
-		shr	ax, 12
-		mov	[destaddr+2], al
-
-		mov	ax, ds
-		mov	es, ax
-		mov	ah, 87h
-		mov	cx, 1024
-		mov	si, gdt
-		int	15h
-
-		jc	.Error
-		pop	es
-		call	OKLight
-		jmp	DisplayPage
-.Error:		pop	es
-		jmp	BadLight
-
 ;--- END -----------------------------------------------------;

src/kernel/pageedit.s

 		jmp	UpdateCurByte
 
 
-		; InsertByte
-		; ax,si,di=DESTROYED
-InsByte:	nop
-
-;		mov	di, 0
-;@@Draw:		mov	ax, di
-;		shl	ax, 1
-;		mov	si, ax			; si = di * 2
-;		mov	ah, 12h
-;		mov	al, [cbuffer + di]
-;		add	si, [hoffs]
-;		mov	[es:si], ax
-;		inc	di
-;		mov	ax, 4000
-;		cmp	si, ax
-;		jne	@@Draw
-		jmp	DisplayProperties
-
-
-		; DeleteByte
-		; ax,si,di=DESTROYED
-DelByte:	nop
-
-;		mov	di, 0
-;@@Draw:		mov	ax, di
-;		shl	ax, 1
-;		mov	si, ax			; si = di * 2
-;		mov	ah, 12h
-;		mov	al, [cbuffer + di]
-;		add	si, [hoffs]
-;		mov	[es:si], ax
-;		inc	di
-;		mov	ax, 4000
-;		cmp	si, ax
-;		jne	@@Draw
-		jmp	DisplayProperties
-
-
 ;--- END -----------------------------------------------------;

src/kernel/statusbar.s

 		;;--------------------------------------------;
 		;; Returns from caller if there are not enough
 		;: status bar lines visible on the screen.
-		;; Also switches to text mode if there are.
 		;; ah: -> GARBAGE
 		;; al: minimum number of lines showing -> GARBAGE
 		;; dx: -> GARBAGE

src/kernel/syscall.s

 		call	TextVidBase
 		ret
 
-
-
-BindFunc:	nop
-
-; es:si -> null-terminated string, naming the desired function
-; returns bx = BefOS function pointer
-
-; 1 treeptr x = root;
-
-		; mov	bx, offset root
-
-; 2 if x == NULL abort
-
-.Loop:		cmp	bx, 0
-		jne	.SallyForth
-		mov	bx, Unimp
-		ret
-
-.SallyForth:	
-
-; 3 mov di, x->key
-
-		mov	di, [bx + 6]
-
-; 4 strcmp es:si, ds:di
-
-		mov	al, [es:si]
-		mov	dl, [ds:di]
-		cmp	al, dl
-		ja	.Right
-		; ...
-
-; 5 if si < di, x = x->left, goto 2
-
-		mov	bx, [bx]
-		jmp	.Loop
-
-; 6 if si > di, x = x->right, goto 2
-
-.Right:		mov	bx, [bx + 2]
-		jmp	.Loop
-
-; return x->functionptr
-
-		mov	bx, [bx + 2]
-		ret
-
 ;--- END -----------------------------------------------------;

src/page/Makefile

 OBJDIR=../../obj
 BINDIR=../../bin
 
-all: $(OBJDIR)/welcome.bin $(OBJDIR)/legend.bin
+all: $(OBJDIR)/welcome.bin $(OBJDIR)/legend.bin $(OBJDIR)/keybind.bin
 
 $(OBJDIR)/welcome.bin: welcome.txt
-	$(BINDIR)/txt2page < welcome.txt > $(.TARGET)
+	$(BINDIR)/txt2page < welcome.txt > $@
 
 $(OBJDIR)/legend.bin: legend.bin
-	$(CP) legend.bin $(.TARGET)
+	$(CP) legend.bin $@
+
+$(OBJDIR)/keybind.bin: ../inc/befkeys.inc
+	$(BINDIR)/mkkeypg.pl < ../inc/befkeys.inc | column -c 79 | expand | $(BINDIR)/txt2page > $@
 
 clean:
 	rm -f $(OBJDIR)/*.bin

Binary file modified.

src/tools/Makefile

 
 all: $(BINDIR)/amalgam8 $(BINDIR)/extract8 \
      $(BINDIR)/txt2page \
-     $(BINDIR)/mkbfinc.pl
+     $(BINDIR)/mkbfinc.pl \
+     $(BINDIR)/mkkeypg.pl
 
 $(BINDIR)/amalgam8: amalgam8.c
-	$(CC) -o $(.TARGET) amalgam8.c
+	$(CC) -o $@ amalgam8.c
 
 $(BINDIR)/extract8: extract8.c
-	$(CC) -o $(.TARGET) extract8.c
+	$(CC) -o $@ extract8.c
 
 $(BINDIR)/txt2page: txt2page.c
-	$(CC) -o $(.TARGET) txt2page.c
+	$(CC) -o $@ txt2page.c
 
 $(BINDIR)/mkbfinc.pl: mkbfinc.pl
-	$(CP) mkbfinc.pl $(.TARGET)
-	$(CHMOD) 755 $(.TARGET)
+	$(CP) mkbfinc.pl $@
+	$(CHMOD) 755 $@
+
+$(BINDIR)/mkkeypg.pl: mkkeypg.pl
+	$(CP) mkkeypg.pl $@
+	$(CHMOD) 755 $@
 
 clean:
 	rm -f $(BINDIR)/*

src/tools/extract8.c

 /*
  * extract8 - extract binary images from given pages
  * on a BefOS boot disk.
+ * Usage: extract8 befos.flp legend.bin 9 1
  */
 int
 main(int argc, char **argv)

src/tools/mkkeypg.pl

+#!/usr/bin/perl
+
+my %binding = ();
+while(defined($line = <STDIN>)) {
+    chomp $line;
+    if ($line =~ /^\s*dw\s+(\S+)\s*\;\s*(\S+)\s*(\S+).*?$/) {
+        my $command = $1;
+        my $scancode = $2;
+        my $key = $3;
+        $binding{$key} = $command;
+    }
+}
+
+foreach $key (sort keys %binding) {
+    next if $binding{$key} eq 'Unimp';
+    printf "%-10s => %s\n", $key, $binding{$key};
+}

src/turbo/befterm.tasm

-IDEAL
-P8086
-MODEL TINY
-
-DATASEG
-
-status		dw	?
-keyhit		dw	?
-
-CODESEG
-ORG 0100h
-PROC		MAIN
-INCLUDE		"..\bekernel.inc"
-		call	BefTermScreen
-
-		; mov	cx, 19200
-		mov	bx, BefOS_InitCom
-		call	BefOS
-
-		mov	bx, BefOS_PlugCom
-		call	BefOS
-
-PollLoop:	mov	bx, BefOS_ReadCom
-		call	BefOS
-
-		cmp	ch, 0
-		je	CheckKey
-		jmp	ReadData
-
-CheckKey:	mov	bx, BefOS_ReadKey
-		call	BefOS
-
-		cmp	cx, 0
-		je	PollLoop
-		mov	[word keyhit], cx	; else retrieve
-		mov	ax, cx
-
-FinalAlt:	cmp	ax, 1000h	; Alt-Q
-		jne	RealKey
-
-		mov	bx, BefOS_UnplugCom
-		call	BefOS
-
-		mov	bx, BefOS_TextVid
-		call	BefOS
-		retf
-
-RealKey:	cmp	al, 0
-		jne	ASCIIKey
-
-ASCIIKey:	
-		mov	bx, BefOS_WorkLight
-		call	BefOS
-
-		mov	cx, [word keyhit]
-		mov	bx, BefOS_WriteCom
-		call	BefOS
-
-		mov	bx, BefOS_OKLight
-		call	BefOS
-
-		jmp	PollLoop
-
-ReadData:	mov	al, cl
-
-		;mov	bx, BefOS_EditLight
-		;call	BefOS
-
-		cmp	al, 13
-		jne	NotReturn
-
-		mov	bx, BefOS_LeftMarg
-		call	BefOS
-		jmp	CheckKey
-
-NotReturn:	cmp	al, 10
-		jne	NotLineFeed
-
-		mov	bx, BefOS_LineFeed
-		call	BefOS
-		jmp	CheckKey
-
-NotLineFeed:	cmp	al, 12
-		jne	NotFormFeed
-
-		call	BefTermScreen
-		jmp	CheckKey
-
-NotFormFeed:	xor	cx, cx
-		mov	cl, al
-		mov	bx, BefOS_WriteByte
-		call	BefOS
-		mov	bx, BefOS_BufRight
-		call	BefOS
-
-SkipRead:	jmp	CheckKey
-
-ENDP
-
-PROC		BefTermScreen
-
-		mov	cx, 0
-		mov	bx, BefOS_MoveCrsr
-		call	BefOS
-		mov	cl, 6dh
-		mov	bx, BefOS_ClrScreen
-		call	BefOS
-		mov	bx, BefOS_RefreshStatus
-		jmp	BefOS
-
-ENDP
-
-END		MAIN

src/turbo/bekernel.tasm

-; BefOS Kernel BEKERNEL.COM v1999.03.28 (c)1999 Cat's-Eye Technologies.
-
-IDEAL
-P8086
-MODEL TINY
-
-WORK_LIGHT	EQU	0ee0ah
-OK_LIGHT	EQU	02a0ah
-BAD_LIGHT	EQU	0cc0ah
-EDIT_LIGHT	EQU	099b0h
-
-DATASEG
-	;---------WORK----------;
-cluster		dw 0010h	; current cluster
-bufptr		dw 0000h	; current byte in the current cluster
-bdevice		dw 0000h	; current illogical device number
-lastmove	dw BufRight	; last direction cursor moved
-	;--------OPTIONS--------;
-bits		db 00h		; 01 bit 0 - Edit Mode
-				; 02 bit 1
-				; 04 bit 2 - High if under DOS
-				; 08 bit 3 - Stringmode
-				; 10 bit 4
-				; 20 bit 5
-				; 40 bit 6
-				; 80 bit 7
-vpage		db 00
-coybyte		db 01
-beeblequit	db 00
-hoffs		dw 160		; number of heading lines displayed, in offset (1 line = 160)
-timerSegment	dw 0
-timerOffset	dw 0
-comSegment	dw 0
-comOffset	dw 0
-breakSegment	dw 0
-breakOffset	dw 0
-prtscSegment	dw 0
-prtscOffset	dw 0
-
-	;---------VIDEO---------;
-ALIGN
-vbase		dw 0b800h	; next page = 0b900h?
-pixbase		dw 0a000h
-	;---------GDT-----------;
-ALIGN
-gdt		db 16 dup (0)
-srclen		dw 0
-srcaddr		dw 0
-		db 0
-srcacc		db 93h
-srchigh		dw 0
-destlen		dw 0
-destaddr	dw 0
-		db 0
-destacc		db 93h
-desthigh	dw 0
-gdtpad		db 16 dup (0)
-	;-----BefOS "STACK"-----;
-ossp		dw 0
-	;-----Key Bindings------;
-
-INCLUDE "inc/befkeys.inc"
-
-	;-----Beeblebrox Bindings---;
-
-INCLUDE "inc/beeble.inc"
-
-; variables used by line
-; int i,dx,dy,sdx,sdy,dxabs,dyabs,x,y,px,py;  
-ldx		dw	0
-ldy		dw	0
-lsdx		dw	0
-lsdy		dw	0
-ldxabs		dw	0
-ldyabs		dw	0
-lx		dw	0
-ly		dw	0
-lpx		dw	0
-lpy		dw	0
-lcol		db	0
-
-	;----------DISK---------;
-sectrk		dw 18		; sectors per track
-bytesec 	dw 512		; bytes per sector
-numhead		dw 2		; number of heads
-	;---------BUFFERS-------;
-cbuffer 	db 2000 dup (?)	; cluster data buffer
-cheader		db 48 dup (?)   ; cluster header buffer
-bbuffer 	db 2048 dup (?)	; backup cluster buffer
-obuffer		db 2048 dup (?) ; memory copy of colour buffer
-combuf		db 2048 dup (?)	; communications port buffer
-	;-------KEYBOARD--------;
-keyhit		dw ?		; BIOS code for last key hit
-shiftflags	dw ?		; shift flags for last key hit
-	;----------RAM----------;
-basek		dw ?		; non-extended kilobytes
-extk		dw ?		; extended kilobytes
-	;-----SYSTEM STACK------;
-osstack		dw 256 dup (?) ; BefOS system stack
-
-comhandle	dw ?
-temp		dw ?
-temp2		dw ?
-templen		dw ?
-attr		db ?
-
-CODESEG
-ORG 0100h  ; strictly necessary
-
-PROC    MAIN
-Start:
-;-FIX DATA SEGMENT----------------------;
-		jmp	short	GoBefOS
-
-		jmp	BindFunc	; always at cs:0102h
-
-GoBefOS:	mov	ax, cs
-		mov	ds, ax		; fix data segment
-		mov	ss, ax		; fix stack segment
-		mov	sp, 0fffeh
-
-		mov	ax, 1200h
-		int	2fh
-		cmp	al, 0ffh		; not if there's no DOS!
-		je	@@DOS
-		jmp	@@Video
-
-@@DOS:		or	[byte bits], 04h	; notify BefOS
-		mov	ax, cs			; allocate some memory
-		add	ax, 400h		; main prog/data = 16K
-		mov	[word runseg+3], ax	; modify the far call!
-
-;-VIDEO---------------------------------;
-@@Video:	mov	ax, 0500h
-		int	10h
-		mov	ah, 15
-		int	10h
-		cmp	al, 7
-		jne	@@SPSH
-		mov	[word vbase], 0b000h
-;-SPLASH--------------------------------;
-@@SPSH:		call	TextVid
-		mov	cl, 2fh
-		call	ClrScreen
-
-;-RAM-----------------------------------;
-@@RAM:		int	12h			; get avail base mem in k
-		mov	[word basek], ax
-
-		mov	ax, 8800h
-		int	15h			; SYSTEM - GET EXTENDED MEMORY SIZE (286+)
-		mov	[word extk], ax
-
-		call	RefreshStatus
-		call	LoadClust
-		call	MoveCursor
-
-;-ISRs----------------------------------;
-
-		call	PlugBreak
-		call	PlugPrtSc
-
-;-SELECT--------------------------------;
-
-@@Select:	call	GetKey
-
-		mov	ax, [word keyhit]
-		cmp	al, 0
-		jne	@@ASCIIKey
-		cmp	ah, 3
-		je	@@ASCIIKey		; Ctrl-2!
-		xor	bx, bx
-		mov	bl, ah
-		shl	bx, 1
-		mov	si, bx
-		mov	ax, [word keytab + si]
-		call	ax
-		jmp	@@Select
-
-@@ASCIIKey:	test	[byte bits], 01h
-		jz	@@NoWrite
-		mov	cx, [word keyhit]
-		call	WriteByte
-		call	Advance
-		jmp	@@Select
-
-@@NoWrite:	call	BadLight
-		jmp	@@Select
-
-ENDP