mirror of
https://github.com/rigreco/Runge-Kutta-Simulation.git
synced 2025-01-13 14:29:52 +00:00
New files
This commit is contained in:
parent
a114a23ea7
commit
3add144d83
8
AppleX/AZTEC.BAT
Normal file
8
AppleX/AZTEC.BAT
Normal file
@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
if "%1" == "" set PATH=C:\WINDOWS\system32;C:\WINDOWS
|
||||
set CROOT=%1
|
||||
if "%1" == "" set CROOT=C:\APPLEX
|
||||
set CLIB65=%CROOT%\LIB\
|
||||
set INCL65=%CROOT%\INCLUDE
|
||||
set CR65=%CROOT%\R\
|
||||
set PATH=%CROOT%;%CROOT%\BIN;%CROOT%\TOOLS;%PATH%;
|
BIN
AppleX/Aztec Apple C6502 Command Prompt.lnk
Normal file
BIN
AppleX/Aztec Apple C6502 Command Prompt.lnk
Normal file
Binary file not shown.
BIN
AppleX/Aztec Apple C6502 DOSBox Prompt.lnk
Normal file
BIN
AppleX/Aztec Apple C6502 DOSBox Prompt.lnk
Normal file
Binary file not shown.
BIN
AppleX/BIN/ARCV.COM
Normal file
BIN
AppleX/BIN/ARCV.COM
Normal file
Binary file not shown.
BIN
AppleX/BIN/AS65.EXE
Normal file
BIN
AppleX/BIN/AS65.EXE
Normal file
Binary file not shown.
BIN
AppleX/BIN/ASI.EXE
Normal file
BIN
AppleX/BIN/ASI.EXE
Normal file
Binary file not shown.
BIN
AppleX/BIN/C65.EXE
Normal file
BIN
AppleX/BIN/C65.EXE
Normal file
Binary file not shown.
BIN
AppleX/BIN/CCI.EXE
Normal file
BIN
AppleX/BIN/CCI.EXE
Normal file
Binary file not shown.
BIN
AppleX/BIN/LB.EXE
Normal file
BIN
AppleX/BIN/LB.EXE
Normal file
Binary file not shown.
BIN
AppleX/BIN/LN65.EXE
Normal file
BIN
AppleX/BIN/LN65.EXE
Normal file
Binary file not shown.
BIN
AppleX/DOCS/A2TechNotes.pdf
Normal file
BIN
AppleX/DOCS/A2TechNotes.pdf
Normal file
Binary file not shown.
35
AppleX/DOCS/ERRCODES.TXT
Normal file
35
AppleX/DOCS/ERRCODES.TXT
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
ProDOS Error Codes
|
||||
|
||||
hex code Meaning
|
||||
------- --------------------------------
|
||||
00 No error
|
||||
01 Invalid number for system call
|
||||
04 Invalid param count for system call
|
||||
25 Interrupt vector table full
|
||||
27 I/O Error
|
||||
28 No device connected/detected
|
||||
2b Disk write protected
|
||||
2e Disk switched
|
||||
40 Invalid characters in pathname
|
||||
42 File control block table full
|
||||
43 Invalid reference number
|
||||
44 Directory not found
|
||||
45 Volume not found
|
||||
46 File not found
|
||||
47 Duplicate file name
|
||||
48 Volume Full
|
||||
49 Volume directory full
|
||||
4a Incompatible file format
|
||||
4b Unsupported storage type
|
||||
4c End of file encountered
|
||||
4d Position out of range
|
||||
4e File Access error; eg, file locked
|
||||
50 File is open
|
||||
51 Directory structure damaged
|
||||
52 Not a ProDOS disk
|
||||
53 Invalid system call parameter
|
||||
55 Volume control block table full
|
||||
56 Bad buffer address
|
||||
57 Duplicate volume
|
||||
5a Invalid address in bit map
|
99
AppleX/DOCS/ReadMe.txt
Normal file
99
AppleX/DOCS/ReadMe.txt
Normal file
@ -0,0 +1,99 @@
|
||||
|
||||
Aztec C65 for the Apple // ProDOS
|
||||
Version 3.2b
|
||||
Additional Information, Ed 2
|
||||
15 July 1986
|
||||
|
||||
|
||||
This document contains information about the 3.2b version of Aztec
|
||||
C65, information that was added since the release document was
|
||||
printed.
|
||||
|
||||
1. Version numbers
|
||||
|
||||
The signon message of some Aztec C65 programs say that they are
|
||||
version 3.2a. Don't worry, you have the correct software: even
|
||||
though individual programs are at version 3.2a, the product as a
|
||||
whole is at version 3.2b.
|
||||
|
||||
|
||||
2. End of Beta mode
|
||||
|
||||
With this release, Aztec C65 is no longer in beta mode, so for
|
||||
technical support, please call our technical support department at 201-
|
||||
542-1795, or call our electronic bulletin board at 201-542-2793,
|
||||
or send us a letter.
|
||||
|
||||
No changes have been made in going from version 3.2a, which was the
|
||||
last beta update, to version 3.2b.
|
||||
|
||||
|
||||
3. Compiler bugs
|
||||
|
||||
The 6502 compiler (named cc on native versions of Aztec C65, c65
|
||||
on cross development versions) doesn't allow char-to-pointer casts. At
|
||||
present, you can accomplish this by first casting the char to an int, then
|
||||
casting the int to a pointer. For example,
|
||||
|
||||
char c, *cp;
|
||||
cp = (char *)(int)c;
|
||||
|
||||
|
||||
4. Problems with the Apple // Parallel printer card
|
||||
|
||||
When a parallel printer is opened on an Apple // that's in 40
|
||||
column mode, the ROM on the Apple // parallel printer card writes an
|
||||
inverse @ character to the screen.
|
||||
|
||||
When screen echo is off and the parallel printer ROM writes a
|
||||
character to the printer, the ROM resets the CH byte in memory, (ie,
|
||||
location $24, the byte that defines the horizontal position of the screen
|
||||
cursor); thus, if a program alternately writes to the printer and to the
|
||||
screen, the characters that are written to the screen will overwrite one
|
||||
another.
|
||||
|
||||
|
||||
5. convert bug
|
||||
|
||||
It's been reported (but not verified by us here at Manx) that the
|
||||
ProDOS convert program can't convert programs larger than 27K.
|
||||
|
||||
|
||||
6. Using the ROM graphics routines
|
||||
|
||||
It's been reported (but not verified by us here at Manx) that some
|
||||
of the ROM graphics routines (HPLOT, LINE) won't work when called
|
||||
by an Aztec C-generated program.
|
||||
|
||||
|
||||
7. get_time() bug
|
||||
|
||||
The get_time() function causes a program to crash. The problem is
|
||||
that get_time calls the time function without passing it an argument
|
||||
that's needed by time.
|
||||
|
||||
|
||||
8. Don't use the same names for variables and functions
|
||||
|
||||
Using the same name for a variable and a function can lead to
|
||||
hard-to-detect problems. For example, index is the name of a library
|
||||
function that is pulled into most programs. If you use this as the name
|
||||
of an uninitialized global variable, the linker will assign the variable the
|
||||
same address as the function. And if you use this as the name of an
|
||||
initialized global variable, the linker will assume that the index function
|
||||
begins at the index variable and will not pull in the index function.
|
||||
|
||||
9. System programs
|
||||
|
||||
Many ProDOS system programs created using Aztec C65 will crash
|
||||
if they're started from the SHELL. There is no problem if they are
|
||||
started from the Basic Interpreter or automatically upon system start-up.
|
||||
|
||||
The problem arises from the facts that
|
||||
(1) the section of memory used by the SHELL's environment pages
|
||||
(0xbc00-0xbf00) is still allocated when a system program is started,
|
||||
and (2) a system program's pseudo stack grows down through the
|
||||
SHELL's environment pages. If the ProDOS MLI is told to perform an operation
|
||||
and return information on the pseudo stack,
|
||||
the MLI will not perform the operation if the information would be
|
||||
placed in the SHELL's still-allocated environment pages.
|
11
AppleX/DOCS/ReadMeFirst.txt
Normal file
11
AppleX/DOCS/ReadMeFirst.txt
Normal file
@ -0,0 +1,11 @@
|
||||
This Directory contains the two original Aztec C docs from Manx.
|
||||
|
||||
The ReadMe is essentially a bug list.
|
||||
|
||||
For additional information, you should get a copy of the Aztec C Manual which
|
||||
is available online at
|
||||
|
||||
http://www.clipshop.ca/Aztec/cat1.htm and http://www.clipshop.ca/Aztec/cat2.htm
|
||||
|
||||
This will provide you with the original text of the printed manual for the C65
|
||||
compiler
|
231
AppleX/DOCS/a2map.txt
Normal file
231
AppleX/DOCS/a2map.txt
Normal file
@ -0,0 +1,231 @@
|
||||
The comp.sys.apple2 Usenet newsgroup Apple II FAQs originate from
|
||||
the II Computing Apple II site, 1997-2012.
|
||||
|
||||
Csa2 FAQs resource file: R032MMAP128.TXT
|
||||
|
||||
128K Apple IIe Memory Map
|
||||
|
||||
|
||||
Note: To correctly view tables and diagrams on a super-res display,
|
||||
use a mono-spaced Font such as CoPilot or PCMononspaced.
|
||||
|
||||
____________________________
|
||||
|
||||
|
||||
|
||||
|
||||
128K Apple IIe Memory Map
|
||||
|
||||
by David Empson
|
||||
|
||||
|
||||
|
||||
|
||||
MAIN RAM AUX RAM I/O ROM
|
||||
|
||||
______________ ______________
|
||||
0000 |Main zero page| |Aux zero page |
|
||||
|______________| |______________|
|
||||
0100 | Main stack | | Aux stack |
|
||||
|______________| |______________|
|
||||
0200 | | | |
|
||||
| | | |
|
||||
0300 | | | |
|
||||
|______________| |______________|
|
||||
0400 | | | |
|
||||
| | | |
|
||||
| Main text/GR | | Aux text/GR |
|
||||
| | | |
|
||||
| page 1 | | page 1X |
|
||||
| | | |
|
||||
| | | |
|
||||
|______________| |______________|
|
||||
0800 | | | |
|
||||
| | | |
|
||||
| Main text/GR | | Aux text/GR |
|
||||
| | | |
|
||||
| page 2 | | page 2X |
|
||||
| | | |
|
||||
| | | |
|
||||
|______________| |______________|
|
||||
0C00 | | | |
|
||||
| | | |
|
||||
... ...
|
||||
| | | |
|
||||
|______________| |______________|
|
||||
2000 | | | |
|
||||
| | | |
|
||||
| Main Hi-res | | Aux Hi-res |
|
||||
| | | |
|
||||
| page 1 | | page 1X |
|
||||
| | | |
|
||||
| | | |
|
||||
|______________| |______________|
|
||||
4000 | | | |
|
||||
| | | |
|
||||
| Main Hi-res | | Aux Hi-res |
|
||||
| | | |
|
||||
| page 2 | | page 2X |
|
||||
| | | |
|
||||
| | | |
|
||||
|______________| |______________|
|
||||
6000 | | | |
|
||||
| | | |
|
||||
| | | |
|
||||
... ...
|
||||
| | | |
|
||||
| | | |
|
||||
BFFF |______________| |______________| _____________
|
||||
C000 | Motherboard |
|
||||
| I/O |
|
||||
|_____________|
|
||||
C090 | Slot I/O |
|
||||
| (DEVSEL) |
|
||||
|_____________| _____________
|
||||
C100 | | | |
|
||||
| Slot CX ROM | | Int CX ROM |
|
||||
| (IOSEL) | | |
|
||||
| | | |
|
||||
|_____________| |_____________|
|
||||
C300 | Slot C3 ROM | | Int C3 ROM |
|
||||
| (IOSEL) | | |
|
||||
|_____________| |_____________|
|
||||
C400 | | | |
|
||||
| | | |
|
||||
| Slot CX ROM | | Int CX ROM |
|
||||
| (IOSEL) | | |
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
|_____________| |_____________|
|
||||
C800 | | | |
|
||||
| Slot ROM | | |
|
||||
| (IOSTROBE) | | Int C3 ROM |
|
||||
| | | |
|
||||
| shared | | |
|
||||
| between | | |
|
||||
| slots | | |
|
||||
CFFF ______ ______ ______ ______ |_____________| |_____________|
|
||||
D000 | || | | || | | |
|
||||
| Main || Main | | Aux || Aux | | |
|
||||
| || | | || | | |
|
||||
| LC || LC | | LC || LC | | |
|
||||
| || | | || | | |
|
||||
| bank || bank | | bank || bank | | |
|
||||
| 1 || 2 | | 1 || 2 | | Applesoft |
|
||||
|______||______| |______||______| | |
|
||||
E000 | | | | | BASIC |
|
||||
| | | | | |
|
||||
| | | | | ROM |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
| Main | | Aux | | |
|
||||
| | | | | |
|
||||
| Language | | Language | | |
|
||||
| | | | | |
|
||||
| Card | | Card | | |
|
||||
| | | | | |
|
||||
| | | | |.............|
|
||||
F800 | | | | | Monitor |
|
||||
| | | | | |
|
||||
| | | | | ROM |
|
||||
FFFF |______________| |______________| |_____________|
|
||||
|
||||
(If you have a RAMWorks or similar bank-switched card in the auxiliary
|
||||
slot, then any 64K bank on the card can be switched into the auxiliary
|
||||
memory space. "Normal" auxiliary memory, which contains the video
|
||||
buffers, is bank 0 on the card.)
|
||||
|
||||
|
||||
The major soft-switches for bank switching control areas as follows:
|
||||
|
||||
AUXZP/MAINZP selects main or auxiliary RAM in 0000-01FF (zero page and
|
||||
stack), and in D000-FFFF (language card), for read/write access. The
|
||||
language card area is further affected by language card soft-switches
|
||||
(see later).
|
||||
|
||||
RDMAIN/RDAUX selects main or auxiliary RAM in 0200-BFFF for read access
|
||||
only. Text page 1/1X and Hi-res page 1/1X may be excluded depending on
|
||||
the state of the 80STORE and HIRES soft-switches.
|
||||
|
||||
WRMAIN/WRAUX selects main or auxiliary RAM in 0200-BFFF for write access
|
||||
only. Text page 1/1X and Hi-res page 1/1X may be excluded depending on
|
||||
the state of the 80STORE and HIRES soft-switches.
|
||||
|
||||
80STORE enables 80-column switching of text/lo-res page 1 (0400-07FF).
|
||||
The active page (main or auxiliary) is determined by the PAGE1/PAGE2
|
||||
soft switch. 80STORE gives read/write access to whichever page is
|
||||
active.
|
||||
|
||||
If 80STORE and HIRES are both enabled, then PAGE1/PAGE2 also control
|
||||
switching of hi-res page 1 (2000-3FFF).
|
||||
|
||||
There is no special bank switching support for text or hi-res page 2/2X.
|
||||
Using the double resolution modes with these pages requires using
|
||||
another bank switching technique.
|
||||
|
||||
SLOTCXROM/INTCXROM determines whether the slot address space or
|
||||
motherboard ROM is enabled for $C100-$C2FF and $C400-$C7FF.
|
||||
|
||||
SLOTC3ROM/INTC3ROM determines whether the slot address space or
|
||||
motherboard ROM is enabled for $C300-$C3FF.
|
||||
|
||||
The $C800-$CFFF area (I/O Stobe) is shared between all slots, and may be
|
||||
used by the internal ROM if INTC3ROM is active. An access to the
|
||||
$CN00-$CNFF page (N=1 to 7) enables the expansion ROM space for slot N,
|
||||
if supported by that card. An access to $CFFF disables the expansion
|
||||
ROM space for all cards.
|
||||
|
||||
|
||||
There are eight language card soft-switches to control selection of RAM
|
||||
bank 1 or 2, read enable for RAM or ROM, and write enable for RAM.
|
||||
|
||||
Handy stub routines to access the auxiliary language card area are as
|
||||
follows:
|
||||
|
||||
RDAUX1 SEI ; No interrupts!
|
||||
LDX C088 ; Read-enable language card bank 1
|
||||
STA C009 ; Switch in auxiliary language card, etc.
|
||||
LDA xxxx ; Read target location (patched)
|
||||
STA C008 ; Switch in main language card, etc.
|
||||
LDX C08A ; Switch the ROM back in
|
||||
CLI ; Enable interrupts
|
||||
RTS
|
||||
|
||||
WRAUX1 SEI ; No interrupts!
|
||||
LDX C08B ; Read/write language card bank 1
|
||||
LDX C08B ; (must access twice)
|
||||
STA C009 ; Switch in auxiliary language card, etc.
|
||||
STA xxxx ; Write target location (patched)
|
||||
STA C008 ; Switch in main language card, etc.
|
||||
LDX C08A ; Switch the ROM back in
|
||||
CLI ; Enable interrupts
|
||||
RTS
|
||||
|
||||
RDAUX2 SEI ; No interrupts!
|
||||
LDX C080 ; Read-enable language card bank 2
|
||||
STA C009 ; Switch in auxiliary language card, etc.
|
||||
LDA xxxx ; Read target location (patched)
|
||||
STA C008 ; Switch in main language card, etc.
|
||||
LDX C082 ; Switch the ROM back in
|
||||
CLI ; Enable interrupts
|
||||
RTS
|
||||
|
||||
WRAUX2 SEI ; No interrupts!
|
||||
LDX C083 ; Read/write language card bank 2
|
||||
LDX C083 ; (must access twice)
|
||||
STA C009 ; Switch in auxiliary language card, etc.
|
||||
STA xxxx ; Write target location (patched)
|
||||
STA C008 ; Switch in main language card, etc.
|
||||
LDX C082 ; Switch the ROM back in
|
||||
CLI ; Enable interrupts
|
||||
RTS
|
||||
|
||||
The C008/C009 switch controls both read and write access, unlike the
|
||||
switches for the main $0200-$BFFF area, but note the different
|
||||
instruction sequences needed to control read enable and read/write
|
||||
enable for the language card area. (You could set up the language card
|
||||
for write-only access using C081 or C089 instead of C083 or C08B, but it
|
||||
won't make the code any shorter.)
|
||||
|
||||
|
3210
AppleX/DOCS/cat1.htm
Normal file
3210
AppleX/DOCS/cat1.htm
Normal file
File diff suppressed because it is too large
Load Diff
3314
AppleX/DOCS/cat2.htm
Normal file
3314
AppleX/DOCS/cat2.htm
Normal file
File diff suppressed because it is too large
Load Diff
586
AppleX/DOCS/pcxman.txt
Normal file
586
AppleX/DOCS/pcxman.txt
Normal file
@ -0,0 +1,586 @@
|
||||
ZSoft PCX File Format Technical Reference Manual
|
||||
|
||||
|
||||
|
||||
Introduction 2
|
||||
Image File (.PCX) Format 3
|
||||
ZSoft .PCX FILE HEADER FORMAT 4
|
||||
Decoding .PCX Files 6
|
||||
Palette Information Description 7
|
||||
EGA/VGA 16 Color Palette Information 7
|
||||
VGA 256 Color Palette Information 7
|
||||
24-Bit .PCX Files 8
|
||||
CGA Color Palette Information 8
|
||||
CGA Color Map 8
|
||||
PC Paintbrush Bitmap Character Format 9
|
||||
Sample "C" Routines 10
|
||||
FRIEZE Technical Information 14
|
||||
General FRIEZE Information 14
|
||||
7.00 and Later FRIEZE 14
|
||||
FRIEZE Function Calls 15
|
||||
FRIEZE Error Codes 18
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
This booklet was designed to aid developers and users in understanding
|
||||
the technical aspects of the .PCX file format and the use of FRIEZE.
|
||||
Any comments, questions or suggestions about this booklet should be
|
||||
sent to:
|
||||
|
||||
ZSoft Corporation
|
||||
Technical Services
|
||||
ATTN: Code Librarian
|
||||
450 Franklin Rd. Suite 100
|
||||
Marietta, GA 30067
|
||||
|
||||
|
||||
|
||||
Technical Reference Manual information compiled by:
|
||||
Dean Ansley
|
||||
|
||||
|
||||
Revision 5
|
||||
|
||||
To down load additional information and the source for a complete
|
||||
Turbo Pascal program to show .PCX files on a CGA/EGA/VGA graphics
|
||||
display, call our BBS at (404)427-1045. You may use a 9600 baud
|
||||
modem or a 2400 baud standard modem. Your modem should be set for
|
||||
8 data bits, 1 stop bit, and NO parity.
|
||||
|
||||
Image File (.PCX) Format
|
||||
|
||||
If you have technical questions on the format, please do not call
|
||||
technical support. ZSoft provides this document as a courtesy to
|
||||
its users and developers. It is not the function of Technical Support
|
||||
to provide programming assistance. If something is not clear, leave a
|
||||
message on our BBS, Compuserve, or write us a letter at the above address.
|
||||
|
||||
The information in this section will be useful if you want to write a
|
||||
program to read or write PCX files (images). If you want to write a
|
||||
special case program for one particular image format you should be able
|
||||
to produce something that runs twice as fast as "Load from..." in
|
||||
PC Paintbrush.
|
||||
|
||||
Image files used by PC Paintbrush product family and FRIEZE (those with a
|
||||
.PCX extension) begin with a 128 byte header. Usually you can ignore this
|
||||
header, since your images will probably all have the same resolution. If
|
||||
you want to process different resolutions or colors, you will need to
|
||||
interpret the header correctly. The remainder of the image file consists
|
||||
of encoded graphic data. The encoding method is a simple byte oriented
|
||||
run-length technique. We reserve the right to change this method to
|
||||
improve space efficiency. When more than one color plane is stored in
|
||||
the file, each line of the image is stored by color plane (generally ordered
|
||||
red, green, blue, intensity), As shown below.
|
||||
|
||||
Scan line 0: RRR... (Plane 0)
|
||||
GGG... (Plane 1)
|
||||
BBB... (Plane 2)
|
||||
III... (Plane 3)
|
||||
Scan line 1: RRR...
|
||||
GGG...
|
||||
BBB...
|
||||
III... (etc.)
|
||||
|
||||
The encoding method is:
|
||||
FOR each byte, X, read from the file
|
||||
IF the top two bits of X are 1's then
|
||||
count = 6 lowest bits of X
|
||||
data = next byte following X
|
||||
ELSE
|
||||
count = 1
|
||||
data = X
|
||||
|
||||
Since the overhead this technique requires is, on average, 25% of
|
||||
the non-repeating data and is at least offset whenever bytes are repeated,
|
||||
the file storage savings are usually considerable.
|
||||
|
||||
ZSoft .PCX FILE HEADER FORMAT
|
||||
|
||||
Byte Item Size Description/Comments
|
||||
0 Manufacturer 1 Constant Flag, 10 = ZSoft .pcx
|
||||
1 Version 1 Version information
|
||||
0 = Version 2.5 of PC Paintbrush
|
||||
2 = Version 2.8 w/palette information
|
||||
3 = Version 2.8 w/o palette information
|
||||
4 = PC Paintbrush for Windows(Plus for
|
||||
Windows uses Ver 5)
|
||||
5 = Version 3.0 and > of PC Paintbrush
|
||||
and PC Paintbrush +, includes
|
||||
Publisher's Paintbrush . Includes
|
||||
24-bit .PCX files
|
||||
2 Encoding 1 1 = .PCX run length encoding
|
||||
3 BitsPerPixel 1 Number of bits to represent a pixel
|
||||
(per Plane) - 1, 2, 4, or 8
|
||||
4 Window 8 Image Dimensions: Xmin,Ymin,Xmax,Ymax
|
||||
12 HDpi 2 Horizontal Resolution of image in DPI*
|
||||
14 VDpi 2 Vertical Resolution of image in DPI*
|
||||
16 Colormap 48 Color palette setting, see text
|
||||
64 Reserved 1 Should be set to 0.
|
||||
65 NPlanes 1 Number of color planes
|
||||
66 BytesPerLine 2 Number of bytes to allocate for a scanline
|
||||
plane. MUST be an EVEN number. Do NOT
|
||||
calculate from Xmax-Xmin.
|
||||
68 PaletteInfo 2 How to interpret palette- 1 = Color/BW,
|
||||
2 = Grayscale (ignored in PB IV/ IV +)
|
||||
70 HscreenSize 2 Horizontal screen size in pixels. New field
|
||||
found only in PB IV/IV Plus
|
||||
72 VscreenSize 2 Vertical screen size in pixels. New field
|
||||
found only in PB IV/IV Plus
|
||||
74 Filler 54 Blank to fill out 128 byte header. Set all
|
||||
bytes to 0
|
||||
|
||||
NOTES:
|
||||
|
||||
All sizes are measured in BYTES.
|
||||
|
||||
All variables of SIZE 2 are integers.
|
||||
|
||||
*HDpi and VDpi represent the Horizontal and Vertical resolutions which the
|
||||
image was created (either printer or scanner); i.e. an image which was
|
||||
scanned might have 300 and 300 in each of these fields.
|
||||
|
||||
Decoding .PCX Files
|
||||
|
||||
First, find the pixel dimensions of the image by calculating
|
||||
[XSIZE = Xmax - Xmin + 1] and [YSIZE = Ymax - Ymin + 1]. Then calculate
|
||||
how many bytes are required to hold one complete uncompressed scan line:
|
||||
|
||||
TotalBytes = NPlanes * BytesPerLine
|
||||
|
||||
Note that since there are always an even number of bytes per scan line,
|
||||
there will probably be unused data at the end of each scan line. TotalBytes
|
||||
shows how much storage must be available to decode each scan line, including
|
||||
any blank area on the right side of the image. You can now begin decoding
|
||||
the first scan line - read the first byte of data from the file. If the
|
||||
top two bits are set, the remaining six bits in the byte show how many times
|
||||
to duplicate the next byte in the file. If the top two bits are not set,
|
||||
the first byte is the data itself, with a count of one.
|
||||
|
||||
Continue decoding the rest of the line. Keep a running subtotal of how
|
||||
many bytes are moved and duplicated into the output buffer. When the
|
||||
subtotal equals TotalBytes, the scan line is complete. There should always
|
||||
be a decoding break at the end of each scan line. But there will not be a
|
||||
decoding break at the end of each plane within each scan line. When the
|
||||
scan line is completed, there may be extra blank data at the end of each
|
||||
plane within the scan line. Use the XSIZE and YSIZE values to find where
|
||||
the valid image data is. If the data is multi-plane, BytesPerLine shows
|
||||
where each plane ends within the scan line.
|
||||
|
||||
Continue decoding the remainder of the scan lines (do not just read to
|
||||
end-of-file). There may be additional data after the end of the image
|
||||
(palette, etc.)
|
||||
|
||||
Palette Information Description
|
||||
|
||||
EGA/VGA 16 Color Palette Information
|
||||
|
||||
In standard RGB format (IBM EGA, IBM VGA) the data is stored as 16 triples.
|
||||
Each triple is a 3 byte quantity of Red, Green, Blue values. The values can
|
||||
range from 0-255, so some interpretation may be necessary. On an IBM EGA,
|
||||
for example, there are 4 possible levels of RGB for each color. Since
|
||||
256/4 = 64, the following is a list of the settings and levels:
|
||||
|
||||
Setting Level
|
||||
0-63 0
|
||||
64-127 1
|
||||
128-192 2
|
||||
193-254 3
|
||||
|
||||
VGA 256 Color Palette Information
|
||||
|
||||
ZSoft has recently added the capability to store palettes containing more
|
||||
than 16 colors in the .PCX image file. The 256 color palette is formatted
|
||||
and treated the same as the 16 color palette, except that it is substantially
|
||||
longer. The palette (number of colors x 3 bytes in length) is appended to
|
||||
the end of the .PCX file, and is preceded by a 12 decimal. Since the VGA
|
||||
device expects a palette value to be 0-63 instead of 0-255, you need to
|
||||
divide the values read in the palette by 4.
|
||||
|
||||
To access a 256 color palette:
|
||||
|
||||
First, check the version number in the header; if it contains a 5 there is
|
||||
a palette.
|
||||
|
||||
Second, read to the end of the file and count back 769 bytes. The value
|
||||
you find should be a 12 decimal, showing the presence of a 256 color palette.
|
||||
|
||||
24-Bit .PCX Files
|
||||
|
||||
24 bit images are stored as version 5 or above as 8 bit, 3 plane images.
|
||||
|
||||
24 bit images do not contain a palette.
|
||||
|
||||
Bit planes are ordered as lines of red, green, blue in that order.
|
||||
|
||||
CGA Color Palette Information
|
||||
|
||||
NOTE: This is no longer supported for PC Paintbrush IV/IV Plus.
|
||||
|
||||
For a standard IBM CGA board, the palette settings are a bit more complex.
|
||||
Only the first byte of the triple is used. The first triple has a valid
|
||||
first byte which represents the background color. To find the background,
|
||||
take the (unsigned) byte value and divide by 16. This will give a result
|
||||
between 0-15, hence the background color. The second triple has a valid
|
||||
first byte, which represents the foreground palette. PC Paintbrush supports
|
||||
8 possible CGA palettes, so when the foreground setting is encoded between
|
||||
0 and 255, there are 8 ranges of numbers and the divisor is 32.
|
||||
|
||||
CGA Color Map
|
||||
|
||||
Header Byte #16
|
||||
|
||||
Background color is determined in the upper four bits.
|
||||
|
||||
Header Byte #19
|
||||
|
||||
Only upper 3 bits are used, lower 5 bits are ignored. The first three bits
|
||||
that are used are ordered C, P, I. These bits are interpreted as follows:
|
||||
|
||||
c: color burst enable - 0 = color; 1 = monochrome
|
||||
|
||||
p: palette - 0 = yellow; 1 = white
|
||||
|
||||
i: intensity - 0 = dim; 1 = bright
|
||||
|
||||
PC Paintbrush Bitmap Character Format
|
||||
|
||||
NOTE: This format is for PC Paintbrush (up to Vers 3.7) and PC Paintbrush
|
||||
Plus (up to Vers 1.65)
|
||||
|
||||
The bitmap character fonts are stored in a particularly simple format. The
|
||||
format of these characters is as follows:
|
||||
|
||||
|
||||
Header
|
||||
|
||||
font width byte 0xA0 + character width (in pixels)
|
||||
font height byte character height (in pixels)
|
||||
|
||||
Character Width Table
|
||||
|
||||
char widths (256 bytes) each char's width + 1 pixel of kerning
|
||||
|
||||
Character Images
|
||||
|
||||
(remainder of the file) starts at char 0 (Null)
|
||||
|
||||
The characters are stored in ASCII order and as many as 256 may be provided.
|
||||
Each character is left justified in the character block, all characters take
|
||||
up the same number of bytes.
|
||||
|
||||
Bytes are organized as N strings, where each string is one scan line of the
|
||||
character.
|
||||
|
||||
For example, each character in a 5x7 font requires 7 bytes. A 9x14 font
|
||||
uses 28 bytes per character (stored two bytes per scan line in 14 sets of
|
||||
2 byte packets). Custom fonts may be any size up to the current maximum of
|
||||
10K bytes allowed for a font file. There is a maximum of 4 bytes per scan
|
||||
line.
|
||||
|
||||
Sample "C" Routines
|
||||
|
||||
The following is a simple set of C subroutines to read data from a .PCX file.
|
||||
|
||||
/* This procedure reads one encoded block from the image file and stores a
|
||||
count and data byte.
|
||||
|
||||
Return result: 0 = valid data stored, EOF = out of data in file */
|
||||
|
||||
encget(pbyt, pcnt, fid)
|
||||
int *pbyt; /* where to place data */
|
||||
int *pcnt; /* where to place count */
|
||||
FILE *fid; /* image file handle */
|
||||
{
|
||||
int i;
|
||||
*pcnt = 1; /* assume a "run" length of one */
|
||||
if (EOF == (i = getc(fid)))
|
||||
return (EOF);
|
||||
if (0xC0 == (0xC0 & i))
|
||||
{
|
||||
*pcnt = 0x3F & i;
|
||||
if (EOF == (i = getc(fid)))
|
||||
return (EOF);
|
||||
}
|
||||
*pbyt = i;
|
||||
return (0);
|
||||
}
|
||||
/* Here's a program fragment using encget. This reads an entire file and
|
||||
stores it in a (large) buffer, pointed to by the variable "bufr". "fp" is
|
||||
the file pointer for the image */
|
||||
|
||||
int i;
|
||||
long l, lsize;
|
||||
lsize = (long )hdr.BytesPerLine * hdr.Nplanes * (1 + hdr.Ymax - hdr.Ymin);
|
||||
for (l = 0; l < lsize; ) /* increment by cnt below */
|
||||
{
|
||||
if (EOF == encget(&chr, &cnt, fp))
|
||||
break;
|
||||
for (i = 0; i < cnt; i++)
|
||||
*bufr++ = chr;
|
||||
l += cnt;
|
||||
}
|
||||
|
||||
The following is a set of C subroutines to write data to a .PCX file.
|
||||
|
||||
/* Subroutine for writing an encoded byte pair (or single byte if it
|
||||
doesn't encode) to a file. It returns the count of bytes written, 0 if error */
|
||||
|
||||
encput(byt, cnt, fid)
|
||||
unsigned char byt, cnt;
|
||||
FILE *fid;
|
||||
{
|
||||
if (cnt) {
|
||||
if ((cnt == 1) && (0xC0 != (0xC0 & byt)))
|
||||
{
|
||||
if (EOF == putc((int )byt, fid))
|
||||
return(0); /* disk write error (probably full) */
|
||||
return(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EOF == putc((int )0xC0 | cnt, fid))
|
||||
return (0); /* disk write error */
|
||||
if (EOF == putc((int )byt, fid))
|
||||
return (0); /* disk write error */
|
||||
return (2);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* This subroutine encodes one scanline and writes it to a file.
|
||||
It returns number of bytes written into outBuff, 0 if failed. */
|
||||
|
||||
encLine(inBuff, inLen, fp)
|
||||
unsigned char *inBuff; /* pointer to scanline data */
|
||||
int inLen; /* length of raw scanline in bytes */
|
||||
FILE *fp; /* file to be written to */
|
||||
{
|
||||
unsigned char this, last;
|
||||
int srcIndex, i;
|
||||
register int total;
|
||||
register unsigned char runCount; /* max single runlength is 63 */
|
||||
total = 0;
|
||||
runCount = 1;
|
||||
last = *(inBuff);
|
||||
|
||||
/* Find the pixel dimensions of the image by calculating
|
||||
[XSIZE = Xmax - Xmin + 1] and [YSIZE = Ymax - Ymin + 1].
|
||||
Then calculate how many bytes are in a "run" */
|
||||
|
||||
for (srcIndex = 1; srcIndex < inLen; srcIndex++)
|
||||
{
|
||||
this = *(++inBuff);
|
||||
if (this == last) /* There is a "run" in the data, encode it */
|
||||
{
|
||||
runCount++;
|
||||
if (runCount == 63)
|
||||
{
|
||||
if (! (i = encput(last, runCount, fp)))
|
||||
return (0);
|
||||
total += i;
|
||||
runCount = 0;
|
||||
}
|
||||
}
|
||||
else /* No "run" - this != last */
|
||||
{
|
||||
if (runCount)
|
||||
{
|
||||
if (! (i = encput(last, runCount, fp)))
|
||||
return(0);
|
||||
total += i;
|
||||
}
|
||||
last = this;
|
||||
runCount = 1;
|
||||
}
|
||||
} /* endloop */
|
||||
if (runCount) /* finish up */
|
||||
{
|
||||
if (! (i = encput(last, runCount, fp)))
|
||||
return (0);
|
||||
return (total + i);
|
||||
}
|
||||
return (total);
|
||||
}
|
||||
|
||||
FRIEZE Technical Information
|
||||
|
||||
General FRIEZE Information
|
||||
|
||||
FRIEZE is a memory-resident utility that allows you to capture and save
|
||||
graphic images from other programs. You can then bring these images into
|
||||
PC Paintbrush for editing and enhancement.
|
||||
|
||||
FRIEZE 7.10 and later can be removed from memory (this can return you up
|
||||
to 90K of DOS RAM, depending on your configuration). To remove FRIEZE from
|
||||
memory, change directories to your paintbrush directory and type the word
|
||||
"FRIEZE".
|
||||
|
||||
7.00 and Later FRIEZE
|
||||
|
||||
The FRIEZE command line format is:
|
||||
|
||||
FRIEZE {PD} {Xn[aarr]} {flags} {video} {hres} {vres} {vnum}
|
||||
Where:
|
||||
{PD} Printer driver filename (without the .PDV extension)
|
||||
{Xn[aarr]}
|
||||
X=S for Serial Printer, P for Parallel Printer, D for disk file.
|
||||
(file is always named FRIEZE.PRN)
|
||||
n = port number
|
||||
aa = Two digit hex code for which return bits cause
|
||||
an abort (optional)
|
||||
rr = Two digit hex code for which return bits cause
|
||||
a retry (optional)
|
||||
NOTE: These codes represent return values from serial or
|
||||
parallel port BIOS calls. For values see and IBM
|
||||
BIOS reference (such as Ray Duncan's Advanced MS-DOS
|
||||
Programming).
|
||||
{flags}Four digit hex code
|
||||
First Digit controls Length Flag
|
||||
Second Digit controls Width Flag
|
||||
Third Digit controls Mode Flag
|
||||
Fourth Digit controls BIOS Flag
|
||||
0 - None
|
||||
1 - Dual Monitor Present
|
||||
2 - Use internal (true) B/W palette for dithering
|
||||
2 color images
|
||||
4 - Capture palette along with screen IN VGA ONLY
|
||||
Frieze 8.08 & up ONLY)
|
||||
|
||||
NOTE: The length, width and mode flags are printer driver specific.
|
||||
See PRINTERS.DAT on disk 1 (or Setup Disk) for correct use. In general
|
||||
width flag of 1 means wide carriage, and 0 means standard width. Length
|
||||
flag of 0 and mode flag of 0 means use default printer driver settings.
|
||||
|
||||
If you need to use more than one BIOS flag option, add the needed flag values
|
||||
and use the sum as the flag value.
|
||||
|
||||
{video} Video driver combination, where the leading digit signifies the
|
||||
high level video driver and the rest signifies the low
|
||||
level video driver
|
||||
Example = 1EGA - uses DRIVE1 and EGA.DEV
|
||||
{hres} Horizontal resolution of the desired graphics mode
|
||||
{vres} Vertical resolution of the desired graphics mode
|
||||
{vnum} Hardware specific parameter (usually number of color planes)
|
||||
|
||||
Note: The last four parameters can be obtained from the CARDS.DAT file,
|
||||
in your PC Paintbrush product directory.
|
||||
|
||||
|
||||
FRIEZE Function Calls
|
||||
|
||||
FRIEZE is operated using software interrupt number 10h (the video interrupt
|
||||
call).
|
||||
|
||||
To make a FRIEZE function call, load 75 (decimal) into the AH register and
|
||||
the function number into the CL register, then either load AL with the
|
||||
function argument or load ES and BX with a segment and offset which point
|
||||
to the function argument. Do an int 10h. FRIEZE will return a result code
|
||||
number in AX. All other registers are preserved. In general, a result
|
||||
code of 0 means success and other values indicate errors. However, function
|
||||
20 (get Frieze Version) behaves differently; see below.
|
||||
No. Definition Arguments
|
||||
0 Reserved
|
||||
1 Load Window
|
||||
ES:BX - string (filename to read from)
|
||||
2 Save Window
|
||||
ES:BX - string (filename to write to)
|
||||
3 Reserved
|
||||
4 Reserved
|
||||
6 Reserved
|
||||
7 Set Window Size
|
||||
ES:BX - 4 element word vector of window settings:
|
||||
Xmin, Ymin, Xmax, Ymax
|
||||
8 Reserved
|
||||
9 Set Patterns
|
||||
ES:BX - 16 element vector of byte values
|
||||
containing the screen-to-printer color correspondence
|
||||
10 Get Patterns
|
||||
ES:BX - room for 16 bytes as above
|
||||
11 Set Mode
|
||||
12,13,14 Reserved
|
||||
15 Get Window
|
||||
ES:BX - room for 4 words of the current window
|
||||
settings
|
||||
16 Set Print Options
|
||||
ES:BX - character string of printer options.
|
||||
Same format as for the FRIEZE command.
|
||||
17, 18, 19 Reserved
|
||||
20 Get FRIEZE Version.
|
||||
AH gets the whole number portion and AL gets the
|
||||
decimal portion of the version number. (eg. for
|
||||
Freize vesion 7.41, AH will contain 7 and AL will
|
||||
contain 41. If AH =0, you are calling a pre-7.0
|
||||
version of FRIEZE).
|
||||
21 Set Parameters
|
||||
ES:BX points to an 8 word table (16 bytes) of
|
||||
parameter settings: TopMargin, LeftMargin,
|
||||
HSize,VSize, Quality/Draft Mode, PrintHres,
|
||||
PrintVres, Reserved.
|
||||
Margins and sizes are specified in hundredths
|
||||
of inches.
|
||||
Q/D mode parameter values:
|
||||
0 - draft print mode
|
||||
1 - quality print mode
|
||||
Print resolutions are specified in DPI.
|
||||
Any parameter which should be left unchanged may
|
||||
be filled with a (-1) (0FFFF hex). The reserved
|
||||
settings should be filled with a (-1).
|
||||
22 Get Parameters
|
||||
ES:BX points to an 8 word table (16 bytes) where
|
||||
parameter settings are held.
|
||||
23 Get Printer Res
|
||||
ES:BX points to a 12 word table (24 bytes) that
|
||||
holds six printer resolution pairs.
|
||||
24 Reserved (versions 8.00 & up)
|
||||
|
||||
FRIEZE Error Codes
|
||||
|
||||
When FRIEZE is called using interrupt 10 hex, it will return an error code
|
||||
in the AX register. A value of zero shows that there was no error. A
|
||||
nonzero result means there was an error. These error codes are explained
|
||||
below.
|
||||
|
||||
0 No Error
|
||||
1 Printout was stopped by user with the ESC key
|
||||
2 Reserved
|
||||
3 File read error
|
||||
4 File write error
|
||||
5 File not found
|
||||
6 Invalid Header - not an image, wrong screen mode
|
||||
7 File close error
|
||||
8 Disk error - usually drive door open
|
||||
9 Printer error - printer is off or out of paper
|
||||
10 Invalid command - CL was set to call a nonexistent FRIEZE function
|
||||
11 Can't create file - write protect tab or disk is full
|
||||
12 Wrong video mode - FRIEZE cannot capture text screens.
|
||||
|
||||
Technical Reference Manual
|
||||
|
||||
Including information for:
|
||||
Publisher's Paintbrushr
|
||||
PC Paintbrush IVTM
|
||||
PC Paintbrush IV PlusTM
|
||||
PC Paintbrush PlusTM
|
||||
PC Paintbrushr
|
||||
FRIEZETM Graphics
|
||||
PaintbrushTM
|
||||
Revision 5
|
||||
|
||||
ZSoft Corporation
|
||||
450 Franklin Rd. Suite 100
|
||||
Marietta, GA 30067
|
||||
(404) 428-0008
|
||||
(404) 427-1150 Fax
|
||||
(404) 427-1045 BBS
|
||||
|
||||
Copyright c 1985, 1987, 1988, 1990, 1991, ZSoft Corporation
|
||||
All Rights Reserved
|
||||
|
||||
|
||||
|
||||
|
BIN
AppleX/GRAPHICS/Aztec Apple C6502 Command Prompt.lnk
Normal file
BIN
AppleX/GRAPHICS/Aztec Apple C6502 Command Prompt.lnk
Normal file
Binary file not shown.
73
AppleX/GRAPHICS/BARS.C
Normal file
73
AppleX/GRAPHICS/BARS.C
Normal file
@ -0,0 +1,73 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
System : Manx Aztec C65 Version 3.2b
|
||||
MS-DOS cross-development environment
|
||||
Platform : Apple IIe 128K PRODOS 8
|
||||
Program : bars.c
|
||||
Description : G2 Library Routine
|
||||
|
||||
Written by : Bill Buckels
|
||||
Revision Date: June 6, 2008
|
||||
|
||||
Licence : You may use this code for whatever you wish as long
|
||||
as you agree that Bill Buckels has no warranty or
|
||||
liability obligations whatsoever from said use.
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
/* Copyright Bill Buckels 2008 */
|
||||
|
||||
/* the following array is based on blue
|
||||
and an even column. subscript 1 must be
|
||||
used if the destination is an odd column.
|
||||
|
||||
the reverse holds true for an orange
|
||||
block.
|
||||
|
||||
I am dealing only with the blue-orange
|
||||
palette for this version.
|
||||
|
||||
since either subscript 0 or 1 will be
|
||||
used and the screen is 40 bytes wide
|
||||
the array only needs to be 41 bytes.
|
||||
|
||||
black and white are not alternating
|
||||
bytes so don't require a preformatted
|
||||
block like blue and orange.
|
||||
|
||||
see code below.
|
||||
|
||||
*/
|
||||
|
||||
unsigned char _bars[41] = {
|
||||
213,170,213,170,213,170,213,170,213,170,
|
||||
213,170,213,170,213,170,213,170,213,170,
|
||||
213,170,213,170,213,170,213,170,213,170,
|
||||
213,170,213,170,213,170,213,170,213,170,213};
|
||||
|
||||
extern unsigned HB[];
|
||||
|
||||
hbar(row,col, color,width,height)
|
||||
int row, col, color, width, height;
|
||||
{
|
||||
int bos=row+height;
|
||||
char *ptr;
|
||||
int temp;
|
||||
|
||||
ptr = (char *)&_bars[0];
|
||||
|
||||
switch(color) {
|
||||
case 3: color = 255; break;
|
||||
case 2: if (col%2 == 0) ptr = (char *)&_bars[1]; break;
|
||||
case 1: if (col%2 != 0) ptr = (char *)&_bars[1]; break;
|
||||
default: color = 128;
|
||||
|
||||
}
|
||||
|
||||
while (row < bos) {
|
||||
temp=HB[row] + col;
|
||||
if (color < 128) movmem(ptr,temp,width);
|
||||
else setmem(temp,width,color);
|
||||
row++;
|
||||
|
||||
}
|
||||
|
||||
}
|
BIN
AppleX/GRAPHICS/BARS.R
Normal file
BIN
AppleX/GRAPHICS/BARS.R
Normal file
Binary file not shown.
35
AppleX/GRAPHICS/BLOAD.C
Normal file
35
AppleX/GRAPHICS/BLOAD.C
Normal file
@ -0,0 +1,35 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
System : Manx Aztec C65 Version 3.2b
|
||||
MS-DOS cross-development environment
|
||||
Platform : Apple IIe 128K PRODOS 8
|
||||
Program : bload.c
|
||||
Description : G2 Library Routine
|
||||
For Hi-Res Mode
|
||||
|
||||
Written by : Bill Buckels
|
||||
Creation Date: June 6, 1991
|
||||
Revised : January 2013
|
||||
|
||||
Licence : You may use this code for whatever you wish as long
|
||||
as you agree that Bill Buckels has no warranty or
|
||||
liability obligations whatsoever from said use.
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
extern unsigned HB[];
|
||||
|
||||
int bload(name)
|
||||
char *name;
|
||||
{
|
||||
int fh, c=-1;
|
||||
if ((fh = open(name,O_RDONLY,0xc3))!=-1) {
|
||||
c = read(fh,(char *)HB[0],0x2000);
|
||||
close(fh);
|
||||
if (c > 8183 && c < 8193) c = 0;
|
||||
else c = -2;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
BIN
AppleX/GRAPHICS/BLOAD.R
Normal file
BIN
AppleX/GRAPHICS/BLOAD.R
Normal file
Binary file not shown.
114
AppleX/GRAPHICS/BOPEN.C
Normal file
114
AppleX/GRAPHICS/BOPEN.C
Normal file
@ -0,0 +1,114 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
System : Manx Aztec C65 Version 3.2b
|
||||
MS-DOS cross-development environment
|
||||
Platform : Apple IIe 128K PRODOS 8
|
||||
Program : bopen.c
|
||||
Description : G2 Library Routine
|
||||
|
||||
Written by : Bill Buckels
|
||||
Revision Date: May 31, 1991
|
||||
|
||||
Licence : You may use this code for whatever you wish as long
|
||||
as you agree that Bill Buckels has no warranty or
|
||||
liability obligations whatsoever from said use.
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
/* bopen.c binary open */
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <prodos.h>
|
||||
#include <errno.h>
|
||||
#include <sysfunc.h>
|
||||
#include <sgtty.h>
|
||||
#include <device.h>
|
||||
|
||||
bopen(uname, flags, mode)
|
||||
char *uname;
|
||||
{
|
||||
register int dev, err, fd;
|
||||
register struct _fil_buf *fb;
|
||||
register char *iobuf;
|
||||
register struct _name_dev *dp;
|
||||
int mflg = 0;
|
||||
char name[64];
|
||||
struct finfo f;
|
||||
char *_get_iob();
|
||||
|
||||
for (fb=_fil_tab;fb<_fil_tab+MAXFILES;fb++)
|
||||
if (fb->unit == 0)
|
||||
goto found;
|
||||
errno = EMFILE;
|
||||
return(-1);
|
||||
found:
|
||||
fb->flags = flags & 0x03;
|
||||
fd = fb - _fil_tab;
|
||||
|
||||
for (dp=&_dev_info->dev_con;dp<=&_dev_info->dev_ser;dp++) {
|
||||
if (strequ(uname, dp->dev_nam) == 0) {
|
||||
dev = dp->dev_num;
|
||||
goto gotdev;
|
||||
}
|
||||
}
|
||||
if (uname[3] == 0 && uname[2] == ':' && toupper(uname[0]) == 'S') {
|
||||
dev = uname[1] - '0';
|
||||
gotdev:
|
||||
if ((dev&0x40) == 0)
|
||||
_slot_open(&_dev_info->slots[dev&7]);
|
||||
fb->unit = dev | 0x80;
|
||||
return(fd);
|
||||
}
|
||||
|
||||
if ((iobuf = _get_iob(fd)) == 0)
|
||||
return -1;
|
||||
|
||||
if (_fixnam(uname, name))
|
||||
return(-1);
|
||||
ctop(name);
|
||||
again:
|
||||
*_sys_parm = 3;
|
||||
*(char **)(_sys_parm + 1) = name;
|
||||
*(char **)(_sys_parm + 3) = iobuf;
|
||||
if (err = _system(SYS_OPEN)) {
|
||||
if (err != 0x44 && err != 0x46) {
|
||||
xerr:
|
||||
errno = err;
|
||||
return(-1);
|
||||
}
|
||||
if ((flags&O_CREAT) == 0) {
|
||||
err = ENOENT;
|
||||
goto xerr;
|
||||
}
|
||||
|
||||
*_sys_parm = 7;
|
||||
*(char **)(_sys_parm + 1) = name;
|
||||
*(_sys_parm + 3) = 0xc3; /* enable everything */
|
||||
*(_sys_parm + 4) = 6; /* binary type file */
|
||||
*(int *)(_sys_parm + 5) = 0;
|
||||
*(_sys_parm + 7) = 1; /* file, not directory */
|
||||
*(long *)(_sys_parm + 8) = 0;
|
||||
if (err = _system(SYS_CREAT))
|
||||
goto xerr;
|
||||
flags &= ~(O_EXCL|O_CREAT|O_TRUNC);
|
||||
mflg = 1;
|
||||
goto again;
|
||||
}
|
||||
|
||||
fb->unit = _sys_parm[5];
|
||||
if ((flags&(O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) {
|
||||
close(fd);
|
||||
err = EEXIST;
|
||||
goto xerr;
|
||||
}
|
||||
if (flags & O_TRUNC)
|
||||
_seteof(fd, 0L);
|
||||
else if (flags & O_APPEND)
|
||||
lseek(fd, 0L, 2);
|
||||
if (mflg) {
|
||||
_getfinfo(uname, &f);
|
||||
f.access = mode;
|
||||
_setfinfo(uname, &f);
|
||||
}
|
||||
return(fd);
|
||||
}
|
||||
|
||||
|
BIN
AppleX/GRAPHICS/BOPEN.R
Normal file
BIN
AppleX/GRAPHICS/BOPEN.R
Normal file
Binary file not shown.
92
AppleX/GRAPHICS/BOTTOM.C
Normal file
92
AppleX/GRAPHICS/BOTTOM.C
Normal file
@ -0,0 +1,92 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
System : Manx Aztec C65 Version 3.2b
|
||||
MS-DOS cross-development environment
|
||||
Platform : Apple IIe 128K PRODOS 8
|
||||
Program : bottom.c
|
||||
Description : G2 Library Routine
|
||||
|
||||
Written by : Bill Buckels
|
||||
Revision Date: Jan 9, 2010
|
||||
|
||||
Licence : You may use this code for whatever you wish as long
|
||||
as you agree that Bill Buckels has no warranty or
|
||||
liability obligations whatsoever from said use.
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
/* some functions to output text directly to the screen */
|
||||
|
||||
|
||||
extern int textbase[24];
|
||||
|
||||
clear_text(ch, page,bottom,reverse)
|
||||
char ch;
|
||||
int page, bottom,reverse;
|
||||
{
|
||||
char *crt;
|
||||
int row, col;
|
||||
int offset = 0;
|
||||
int r1 = 0;
|
||||
|
||||
if (page !=0)offset = 1024;
|
||||
if (bottom != 0)r1 = 20;
|
||||
|
||||
ch = ch &0x7f;
|
||||
if (reverse == 0) ch += 128;
|
||||
|
||||
for (row = r1; row < 24; row++) {
|
||||
crt = (char *)(textbase[row] + offset);
|
||||
for (col = 0; col < 40; col++) {
|
||||
*crt++ = ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clear_top()
|
||||
{
|
||||
clear_text(' ',1,0,0);
|
||||
}
|
||||
|
||||
clear_bottom()
|
||||
{
|
||||
clear_text(' ',1,1,0);
|
||||
}
|
||||
|
||||
|
||||
/* row = 0,0 to 3,39 in split screen mode */
|
||||
/* I am just going directly to the text screen address */
|
||||
/* and outputting a raw ascii value */
|
||||
print_bottom(str,row,col)
|
||||
char *str;
|
||||
int row, col;
|
||||
{
|
||||
print_text(str,row,col,1,1,0);
|
||||
}
|
||||
|
||||
print_top(str,row,col)
|
||||
char *str;
|
||||
int row, col;
|
||||
{
|
||||
print_text(str,row,col,1,0,0);
|
||||
}
|
||||
|
||||
print_text(str,row,col,page,bottom,reverse)
|
||||
char *str;
|
||||
int row,col,page,bottom,reverse;
|
||||
{
|
||||
char *crt;
|
||||
char c;
|
||||
int offset = 0;
|
||||
|
||||
if (col > 39) {
|
||||
col-=40;
|
||||
reverse = 1;
|
||||
}
|
||||
if (bottom != 0)row+=20;
|
||||
if (page !=0) offset = 1024;
|
||||
if (reverse != 0)reverse = 0;
|
||||
else reverse = 128;
|
||||
|
||||
crt = (char *)(textbase[row]+offset+col);
|
||||
|
||||
while((c=*str++)!=0)*crt++=(c+reverse);
|
||||
}
|
BIN
AppleX/GRAPHICS/BOTTOM.R
Normal file
BIN
AppleX/GRAPHICS/BOTTOM.R
Normal file
Binary file not shown.
38
AppleX/GRAPHICS/BSAVE.C
Normal file
38
AppleX/GRAPHICS/BSAVE.C
Normal file
@ -0,0 +1,38 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
System : Manx Aztec C65 Version 3.2b
|
||||
MS-DOS cross-development environment
|
||||
Platform : Apple IIe 128K PRODOS 8
|
||||
Program : bsave.c
|
||||
Description : G2 Library Routine
|
||||
|
||||
Written by : Bill Buckels
|
||||
Revision Date: July 9, 1991
|
||||
|
||||
Licence : You may use this code for whatever you wish as long
|
||||
as you agree that Bill Buckels has no warranty or
|
||||
liability obligations whatsoever from said use.
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
/* bsave a file from hires screen 2 */
|
||||
#include <console.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <prodos.h>
|
||||
#include <sgtty.h>
|
||||
#include <device.h>
|
||||
#include <sysfunc.h>
|
||||
|
||||
bsave(savex)
|
||||
char *savex;
|
||||
{
|
||||
int fh;
|
||||
|
||||
if((fh=bopen(savex, O_WRONLY|O_TRUNC|O_CREAT,0xc3)) != -1)
|
||||
{
|
||||
write(fh,(char *)0x4000,0x2000);
|
||||
close(fh);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
BIN
AppleX/GRAPHICS/BSAVE.R
Normal file
BIN
AppleX/GRAPHICS/BSAVE.R
Normal file
Binary file not shown.
63
AppleX/GRAPHICS/CALL33.C
Normal file
63
AppleX/GRAPHICS/CALL33.C
Normal file
@ -0,0 +1,63 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
System : Manx Aztec C65 Version 3.2b
|
||||
MS-DOS cross-development environment
|
||||
Platform : Apple IIe 128K PRODOS 8
|
||||
Program : call33.c
|
||||
Description : G2 Library Routine
|
||||
|
||||
Written by : Bill Buckels
|
||||
Revision Date: Jan 1, 2010
|
||||
|
||||
Licence : You may use this code for whatever you wish as long
|
||||
as you agree that Bill Buckels has no warranty or
|
||||
liability obligations whatsoever from said use.
|
||||
------------------------------------------------------------------------ */
|
||||
|
||||
catalog()
|
||||
{
|
||||
#asm
|
||||
clc
|
||||
jsr $a56e
|
||||
#endasm
|
||||
}
|
||||
|
||||
reboot()
|
||||
{
|
||||
#asm
|
||||
clc
|
||||
jsr $faa6
|
||||
#endasm
|
||||
}
|
||||
|
||||
bell()
|
||||
{
|
||||
#asm
|
||||
clc
|
||||
jsr $ff3a
|
||||
#endasm
|
||||
}
|
||||
|
||||
bellerr()
|
||||
{
|
||||
#asm
|
||||
clc
|
||||
jsr $ff2d
|
||||
#endasm
|
||||
}
|
||||
|
||||
scr_apple()
|
||||
{
|
||||
#asm
|
||||
clc
|
||||
jsr $fb60
|
||||
#endasm
|
||||
}
|
||||
|
||||
loclear()
|
||||
{
|
||||
#asm
|
||||
clc
|
||||
jsr $f832
|
||||
#endasm
|
||||
}
|
||||
|
BIN
AppleX/GRAPHICS/CALL33.R
Normal file
BIN
AppleX/GRAPHICS/CALL33.R
Normal file
Binary file not shown.
58
AppleX/GRAPHICS/CIRCLE.C
Normal file
58
AppleX/GRAPHICS/CIRCLE.C
Normal file
@ -0,0 +1,58 @@
|
||||
int __x_aspect=1, __y_aspect=1;
|
||||
|
||||
circle(cx,cy,r)
|
||||
int cx,cy,r;
|
||||
{
|
||||
|
||||
int x,y,a,b,c,d,f,m,n;
|
||||
/* replaced double z=1.16 with long integer 116
|
||||
so fake floating point and divide product by 100
|
||||
|
||||
February 2013 */
|
||||
long z=116L;
|
||||
|
||||
x=r; y=0; b=1; f=0;
|
||||
|
||||
a=(-2)*x+1;
|
||||
m=__x_aspect;
|
||||
n=__y_aspect;
|
||||
|
||||
point:
|
||||
|
||||
|
||||
/* replaced double z=1.16 with long integer 116
|
||||
so fake floating point and divide product by 100
|
||||
|
||||
February 2013 */
|
||||
|
||||
c= (int)((z*x)/100);
|
||||
d= (int)((z*y)/100);
|
||||
|
||||
|
||||
plot(c*m+cx,y*n+cy);
|
||||
plot(d*m+cx,x*n+cy);
|
||||
plot(-d*m+cx,x*n+cy);
|
||||
plot(-c*m+cx,y*n+cy);
|
||||
plot(-c*m+cx,-y*n+cy);
|
||||
plot(-d*m+cx,-x*n+cy);
|
||||
plot(d*m+cx,-x*n+cy);
|
||||
plot(c*m+cx,-y*n+cy);
|
||||
|
||||
if(b>= -a)
|
||||
goto fin;
|
||||
|
||||
y+=1; f+=b;
|
||||
b+=2;
|
||||
|
||||
if(f>r)
|
||||
{
|
||||
f+=a;
|
||||
a+=2;
|
||||
x-=1;
|
||||
}
|
||||
goto point;
|
||||
|
||||
fin:
|
||||
;
|
||||
}
|
||||
|
BIN
AppleX/GRAPHICS/CIRCLE.R
Normal file
BIN
AppleX/GRAPHICS/CIRCLE.R
Normal file
Binary file not shown.
92
AppleX/GRAPHICS/CLEAR.ASM
Normal file
92
AppleX/GRAPHICS/CLEAR.ASM
Normal file
@ -0,0 +1,92 @@
|
||||
;/* ------------------------------------------------------------------------
|
||||
;System : Manx Aztec C65 Version 3.2b
|
||||
; MS-DOS cross-development environment
|
||||
;Platform : Apple IIe 128K PRODOS 8
|
||||
;Program : clear.asm
|
||||
;Description : G2 Library Routine
|
||||
;
|
||||
; HGR routine from original Aztec C distribution
|
||||
; Modified by me to use Page 2 for compatibility with
|
||||
; ProDOS SYS programs.
|
||||
;
|
||||
;Original : Dec 30, 1990
|
||||
;Probably by : Jim Goodnow
|
||||
;
|
||||
;Modified by : Bill Buckels
|
||||
;Revision Date : January 2013
|
||||
;
|
||||
;Licence : You may use this code for whatever you wish as long
|
||||
; as you agree that Bill Buckels has no warranty or
|
||||
; liability obligations whatsoever from said use.
|
||||
;------------------------------------------------------------------------ */
|
||||
|
||||
R0 equ 8
|
||||
SP equ 2
|
||||
|
||||
clr lda #0 ;store ptr in R0
|
||||
sta R0
|
||||
lda #$40
|
||||
sta R0+1
|
||||
ldy #0
|
||||
loop
|
||||
lda R0+2
|
||||
sta (R0),Y
|
||||
iny
|
||||
lda R0+3
|
||||
sta (R0),Y
|
||||
iny
|
||||
bne loop
|
||||
ldx R0+1
|
||||
inx
|
||||
stx R0+1
|
||||
txa
|
||||
cmp #$60
|
||||
bcc loop
|
||||
lda $c057 ;high res
|
||||
lda $c055 ;page 2
|
||||
lda $c052 ;full graphics
|
||||
lda $c050 ;graphics
|
||||
rts
|
||||
|
||||
public black_
|
||||
black_
|
||||
lda #0
|
||||
sta R0+2
|
||||
sta R0+3
|
||||