mirror of
https://github.com/codebur/a2-chemi-gs-1993.git
synced 2025-03-18 07:31:14 +00:00
initial commit
This commit is contained in:
parent
2f054cef89
commit
902d43f0e7
BIN
CodeBurger.image.zip
Normal file
BIN
CodeBurger.image.zip
Normal file
Binary file not shown.
18
README.md
Normal file
18
README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# ChemiGS
|
||||
## Drawing Program for Chemical Structures (unfinished)
|
||||
|
||||
- Author: Urs Hochstrasser
|
||||
- Date: 1993
|
||||
- Platform: Apple IIgs
|
||||
- Language: 65816 Assembly
|
||||
- IDE used: ORCA/M
|
||||
|
||||
As usual, this project got stuck in the basics, namely coding of a well behaved GS/OS 5/6 application with Mac-like behaviour. Anyway, someone might have some use for the code :-)
|
||||
|
||||
I provide the code as is. I haven’t touched it for decades. Have fun!
|
||||
|
||||
**Files**
|
||||
|
||||
- ``*.asm`` source files for the projects. I don’t remember how everything adds up, but everything should be there
|
||||
- ``gen, mak`` some workflow automation files
|
||||
- ``CodeBurger.image.zip`` Zipped disk image file containg the ChemiGS program and some sample files.
|
1
equates.asm
Normal file
1
equates.asm
Normal file
@ -0,0 +1 @@
|
||||
****************************************************************
* ChemiGS *
****************************************************************
* A Drawing Program for Chemical Structures *
* (c) 1992 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* GLOBAL EQUATES
****************************************************************
*
* INCLUDE ...
*
copy 13:Ainclude:E16.CONTROL
copy 13:Ainclude:E16.DIALOG
copy 13:Ainclude:E16.EVENT
copy 13:Ainclude:E16.MEMORY
copy 13:Ainclude:E16.MISCTOOL
copy 13:Ainclude:E16.QDAUX
copy 13:Ainclude:E16.QUICKDRAW
copy 13:Ainclude:E16.RESOURCES
copy 13:Ainclude:E16.SCRAP
copy 13:Ainclude:E16.TYPES
copy 13:Ainclude:E16.WINDOW
copy 13:Ainclude:E16.PRINT
copy 13:Ainclude:E16.MENU
copy 13:Ainclude:E16.STDFILE
****************************************************************
*
* CONST
*
kTools gequ 1 Resource IDs
kMBarID gequ 1
kAboutWID gequ $FFA
kDataWID gequ $FF9
kToolWID gequ $FF8
kEasterWID gequ $FF7
kPrefWID gequ $FF6
kHelpWID gequ $FF5
kAlertRO gequ 1
kSaveChID gequ 2
kRevertID gequ 3
kToolPicID gequ 2
kButtonBarID gequ 3 formerly 5...
kChFontID gequ 1
kPicResID gequ $8002
rCursor gequ $8027
rFont gequ $C003
ptr GEQU 4
invalidAccess gequ $4E
kAppleM gequ 1 Apple Menu IDs
kFileM gequ 2 File Menu IDs
kEditM gequ 3 Edit Menu IDs
TextToolID gequ 12
TEditID gequ 20 Line Edit Cntl ID (In fact it's a TEdit)
hScrlID gequ 5 hor. scroll bar ID
vScrlID gequ 6 vert. scroll bar ID
MountnID gequ 8 display size control ID
SizeBxID gequ 9 size box control ID
TBarCID gequ 7 inactive ToolBar ctl ID
kDataWidth gequ 640
kDataHeigth gequ 400
kWInfoSize gequ 6 Window Information Block
segSize GEQU 32
FInfoSize gequ 116 used in GLOBALS, WINDOWS, FILE
miniFInfo gequ 56 used in DRAW, see also GLOBALS
kRulerH gequ 18
|
1
globals.asm
Normal file
1
globals.asm
Normal file
File diff suppressed because one or more lines are too long
1
mak
Normal file
1
mak
Normal file
@ -0,0 +1 @@
|
||||
set keeptype s16
* copy -c {1}.asm {1}.bak
* cp {1}.asm {1}.bak
edit {1}.asm
macgen {1}.asm {1}.macros 13:Orcainclude:m=
assemble +E {1}.asm
link main menu globals sys6 windows file print tools xform draw text keep=Chemix
filetype Chemix s16 $DB07
|
1
menu.asm
Normal file
1
menu.asm
Normal file
@ -0,0 +1 @@
|
||||
keep MENU
****************************************************************
* ChemiGS *
****************************************************************
* A Drawing Program for Chemical Structures *
* (c) 1992-93 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* Module MENU
****************************************************************
*
* USES ...
*
mcopy Menu.macros
copy equates.asm
****************************************************************
*
* SUBROUTINES
*
HandleMenu start
using Globals
lda gTaskDta get Menu Item ID
sec turn into index by substracting 250
sbc #250
asl a and multiplying by 2
tax
jsr (menuTable,x) call the routine
~HiliteMenu #0,gTaskDta+2 hilite the selected menu
rts
menuTable dc i2'Ignore' Undo (250)
dc i2'Ignore' Cut (251)
dc i2'Ignore' Copy (252)
dc i2'Ignore' Paste (253)
dc i2'Ignore' Clear (254)
dc i2'DoClose' Close (255)
dc i2'DoAbout' About... (256)
dc i2'DoQuit' Quit (257)
dc i2'DoNew' New (258)
dc i2'DoOpen' Open (259)
dc i2'DoSave' Save (260)
dc i2'DoSaveAs' Save As... (261)
dc i2'DoRevert' Revert (262)
dc i2'DoPSetup' Page Setup... (263)
dc i2'DoPrint' Print... (264)
dc i2'Ignore' Select All (265) ???????
dc i2'Ignore' Bring To Front (266)
dc i2'Ignore' Choose Font (267)
dc i2'Ignore' Show Clipboard (268)
dc i2'Ignore' Send To Back (269)
dc i2'Ignore' Group (270)
dc i2'Ignore' Ungroup (271)
dc i2'Ignore' Size (272)
dc i2'DoPrefs' Preferences (273)
dc i2'Test' Grid (274)
dc i2'Test' Select All (275)
dc i2'DoHelp' Help (276)
dc i2'Test' Test Beep
end
|
1
sys6.asm
Normal file
1
sys6.asm
Normal file
@ -0,0 +1 @@
|
||||
keep SYS6
****************************************************************
* ChemiGS *
****************************************************************
* (c) 1992-93 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* Module Sys6: System 6 specific calls
mcopy Sys6.macros
CheckSystem start test for system 6
using Globals
clc
lda fSys5
beq isSys6
sec
pla return to previous caller if sys5
isSys6 anop
rts
end
HndlDiskInsert start
jsr CheckSystem
pha
pha
~HandleDiskInsert #$C000,#0
pla
pla
rts
end
*SetMinGrow start
* using Globals
* jsr CheckSystem
* ph4 #0
* ~GetAuxWindInfo gDataWin
* sta gToolErr
* pl4 WInfoPtr
* jsr Error
* move4 WInfoPtr,0
* ldy #$14
* lda #68
* sta [0],y
* iny
* iny
* lda #204
* sta [0],y
* rts
*WInfoPtr ds 4
* end
|
1
text.asm
Normal file
1
text.asm
Normal file
@ -0,0 +1 @@
|
||||
keep TEXT
****************************************************************
* ChemiGS *
****************************************************************
* A Drawing Program for Chemical Structures *
* (c) 1992-93 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* Module TEXT
****************************************************************
*
* USES ...
*
mcopy text.macros
copy equates.asm
KeyFilter start
using Globals
oteH equ 8 Offset to the teH Input Parm
otype equ 4 Offset to the type Input Parm
phd save current DP
tsc
tcd switch to DP in stack
ldy #0 *** new: save InfoRect into gInfoRect
lda #0 ***
sta $E0C034 ***
lda [oteH],y
sta teH
iny
iny
lda [oteH],y
sta teH+2
lda [otype],y
sta type
* ------------------- individual routine -----------------
inc gaga ***
lda gaga ***
inc a ***
sta $E0C034 ***
lda $E0C030
~HandToPtr teH,#teRec,#$106
ldx #$D8
lda teRec,x
sta theChar
* do conversion stuff
lda theChar example...
and #$005F
sta outChar
~PtrToHand #outChar,outH,#2
ldx #$DC keyRecord.theInputHandle
lda outH
sta teRec,x
lda outH+2
sta teRec+2,x
ldx #$E4 keyRecord.theOpcode
stz teRec,x
~PtrToHand #teRec,teH,#106
* ------------------- Remove input parameters from stack
ply pull original DP, save in y
lda 2,s Move RTL addr down over inp parms
sta 8,s
lda 0,s
sta 6,s
tsc now move SP over inp parms
clc
adc #6 add number input parm bytes to SP
tcs and reset stack
tya restore original DP
tcd
* lda #2 ***
* sta $E0C034 ***
rtl back to Window Mgr
teH ds 4
type ds 2
tePtr ds 4
theChar ds 2
outChar ds 2
gaga ds 2
end
|
1
windows.asm
Normal file
1
windows.asm
Normal file
File diff suppressed because one or more lines are too long
1
xform.asm
Normal file
1
xform.asm
Normal file
@ -0,0 +1 @@
|
||||
keep XFORM
****************************************************************
* ChemiGS *
****************************************************************
* A Drawing Program for Chemical Structures *
* (c) 1992-93 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* Module XFORM
****************************************************************
*
* USES ...
*
mcopy xform.macros
copy equates.asm
************************************************************************
* Display procedures
*
* Make Matrix: rotation and stretching of stored primitives, as
* ------------ hatched and dotted lines, wedges etc.
*
* x' = x * TM11 + y * TM12; TM11 = S * cos theta, TM12 = -S * sin theta
* y' = x * TM21 + y * TM22; TM21 = S * sin theta, TM22 = S * cos theta
*
* Transform: transform points in primitive definition with
* ---------- Transformation Matrix
*
MakeMatrix start
using Globals
using TransData
ph4 #0 Create a FIXed '2'
~Long2Fix #2
pl4 Fix_2
ph4 #0
~Long2Fix #-2 Create a FIXed '-2'
pl4 Fix_Neg2
sub2 xx2,xx,dx
sub2 yy2,yy,dy
DIV2 dx,#2 dx/2, then stretch later (for asp. rat)
ph4 #0
~Multiply dx,dx (dx/2)^2 -> dx2
pl4 dx2
ph4 #0
~Multiply dy,dy dy^2 -> dy2
pl4 dy2
ADD4 dx2,dy2,L sum of it -> L
SQRT4 L Square root of L into L
ph4 #0
~FixRatio L,ex L/ex -> S (only loWrd of L)
pl4 S
ph4 #0
~FixRatio dx,L dx/L -> cos_th
pl4 cos_th
ph4 #0
~FixRatio dy,L dy/L -> sin_th
pl4 sin_th
ph4 #0
~FixMul S,cos_th
pl4 tm22 S * cos_th -> tm22
ph4 #0
~FixMul tm22,Fix_2
pl4 tm11 S * cos_th * 2 -> tm11
ph4 #0
~FixMul S,sin_th
pl4 tm21 S * sin_th -> tm21
ph4 #0
~FixMul tm21,Fix_Neg2
pl4 tm12 S * sin_th * -2 -> tm12
rts
Transform entry
ph4 #0
~FixMul px,tm11
pl4 temp
ph4 #0
~FixMul py,tm12
pl4 temp2
ADD4 temp,temp2
ph4 #0
~Fix2Long temp
pl4 temp
add2 temp,xx,pxx
ph4 #0
~FixMul px,tm21
pl4 temp
ph4 #0
~FixMul py,tm22
pl4 temp2
ADD4 temp,temp2
ph4 #0
~Fix2Long temp
pl4 temp
add2 temp,yy,pyy
rts
Fix_2 ds 4
Fix_Neg2 ds 4
temp ds 4
temp2 ds 4
dx ds 2
dx2 ds 4
dy ds 2
dy2 ds 4
L ds 4 LONG, INTEGER
ex dc i2'16' INTEGER
s ds 4 FIX
cos_th ds 4 FIX
sin_th ds 4 FIX
end
TransData data
tm11 ds 4 FIX
tm12 ds 4 FIX
tm21 ds 4 FIX
tm22 ds 4 FIX
px ds 4 FIXed points from primitive def
py ds 4
pxx ds 2 Integer Results from Transform Proc
pyy ds 2
count ds 2
doubleBData dc i2'2'
dc i2'0,0,0,-1,0,16,0,-1' FIX '0,-1,16,-1'
dc i2'0,0,0, 1,0,16,0, 1' FIX '0, 1,16, 1'
hatchData dc i2'9' number of line segments
dc i2'0, 0,0,-1,0, 0,0,1' FIX ' 0,-1, 0,1'
dc i2'0, 2,0,-1,0, 2,0,1' FIX ' 2,-1, 2,1'
dc i2'0, 4,0,-1,0, 4,0,1' FIX ' 4,-1, 4,1'
dc i2'0, 6,0,-1,0, 6,0,1' FIX ' 6,-1, 6,1'
dc i2'0, 8,0,-1,0, 8,0,1' FIX ' 8,-1, 8,1'
dc i2'0,10,0,-1,0,10,0,1' FIX '10,-1,10,1'
dc i2'0,12,0,-1,0,12,0,1' FIX '12,-1,12,1'
dc i2'0,14,0,-1,0,14,0,1' FIX '14,-1,14,1'
dc i2'0,16,0,-1,0,16,0,1' FIX '16,-1,16,1'
wedgeBData dc i2'3'
dc i2'0,0,0,0,0,16,0,-2'
dc i2'0,16,0,2,0,0,0,0'
dottedBData dc i2'4'
dc i2'0, 0,0,0,0, 2,0,0' FIX ' 0,0, 2,0'
dc i2'0, 4,0,0,0, 6,0,0' FIX ' 4,0, 6,0'
dc i2'0, 8,0,0,0,10,0,0' FIX ' 8,0,10,0'
dc i2'0,12,0,0,0,14,0,0' FIX '12,0,14,0'
tripleBData dc i2'3'
dc i2'0,0,0,-2,0,16,0,-2' FIX '0,-2,16,-2'
dc i2'0,0,0, 0,0,16,0, 0' FIX '0, 0,16, 0'
dc i2'0,0,0, 2,0,16,0, 2' FIX '0, 2,16, 2'
wHatchData dc i2'9'
dc i2'0,0,0,0,0,0,0,0'
dc i2'0,2,$C000,-1,0,2,$4000,0'
dc i2'0,4,$8000,-1,0,4,$8000,0'
dc i2'0,6,$4000,-1,0,6,$C000,0'
dc i2'0,8,0,-1,0,8,0,1'
dc i2'0,10,$C000,-2,0,10,$4000,1'
dc i2'0,12,$8000,-2,0,12,$8000,1'
dc i2'0,14,$4000,-2,0,14,$C000,1'
dc i2'0,16,0,-2,0,16,0,2'
cchainData dc i2'2' ...not really a c chain any more...
dc i2'0,0,0,0,0,16,0,0' FIX '0,0,16,0'
dc i2'0,3,0,3,0,13,$FF00,2' FIX '3,3,13,2.9'
end
|
Loading…
x
Reference in New Issue
Block a user