Initial commit

This commit is contained in:
InvisibleUp 2019-07-22 22:50:34 -04:00
commit 48676c4abf
133 changed files with 107293 additions and 0 deletions

345
COPYING.txt Normal file
View File

@ -0,0 +1,345 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

21
README.txt Normal file
View File

@ -0,0 +1,21 @@
MnvM_b36: README
Paul C. Pratt
www.gryphel.com
July 27, 2005
MnvM_b36 is the build system for Mini vMac,
a miniature Macintosh emulator.
Further information may be found at
"https://www.gryphel.com/c/minivmac/".
You can redistribute MnvM_b36 and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. See the included file COPYING.
MnvM_b36 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.

View File

@ -0,0 +1,32 @@
Mini vMac: mydriver/README
Paul C. Pratt
www.gryphel.com
February 23, 2002
The mydriver folder contains source code
for a replacement disk driver that is patched
into the emulated rom.
The compiled driver is already in ROMEMDEV.c
(the initialization of sony_driver variable),
so this source code is not needed for building
Mini vMac. It is only needed if you want
to change this driver.
To compile the driver, use MPW commands
such as:
set srcdir hd4:Topaz:MinivMac:mydriver:
asm -case on {srcdir}mydriver.a -o {srcdir}mydriver.a.o
c {srcdir}mydriver.c -r -b -mbg off -opt full -o {srcdir}mydriver.c.o
link {srcdir}mydriver.a.o {srcdir}mydriver.c.o -rt DRVR=128 -o {srcdir}mydriver
Then you can use ResEdit to copy the hex data out
of the DRVR 128 resource, format it a bit, and
replace the initialization data of the variable
sony_driver in the file ROMEMDEV.c
(note: this is using the old c compiler, to use
the current c compiler, use:
SC {srcdir}mydriver.c -w 17 -proto strict -b -mbg off -opt all -o {srcdir}mydriver.c.o
)

View File

@ -0,0 +1,302 @@
; mydriver.a
;
; Copyright (C) 2004 Paul C. Pratt
;
; You can redistribute this file and/or modify it under the terms
; of version 2 of the GNU General Public License as published by
; the Free Software Foundation. You should have received a copy
; of the license along with this file; see the file COPYING.
;
; This file is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; license for more details.
; most of this is adapted from sample source code from Apple.
FakeSonyDriver MAIN EXPORT
BLANKS ON
STRING ASIS
kqLink EQU 0
kqType EQU 4
kioTrap EQU 6
kioCmdAddr EQU 8
kioCompletion EQU 12
kioResult EQU 16
kioNamePtr EQU 18
kioVRefNum EQU 22
kioRefNum EQU 24
kcsCode EQU 26
kcsParam EQU 28
kioBuffer EQU 32 ; Buffer to store data into
kioReqCount EQU 36 ; Requested Number of Bytes
kioActCount EQU 40 ; Actual Number of Bytes obtained
kioPosMode EQU 44 ; Positioning Mode
kioPosOffset EQU 46 ; Position Offset
killCode EQU 1 ; KillIO requested
noQueueBit EQU 9 ; trap word modifier
JIODone EQU $08FC
kCmndSonyPrime EQU $0001
kCmndSonyControl EQU $0002
kCmndSonyStatus EQU $0003
kCmndSonyClose EQU $0004
kCmndSonyOpenA EQU $0005
kCmndSonyOpenB EQU $0006
kCmndSonyOpenC EQU $0007
kCmndSonyMount EQU $0008
DHeader
DFlags DC.W $4F00 ; need lock, responds to all requests
DDelay DC.W 0 ; none
DEMask DC.W 0 ; DA event mask
DMenu DC.W 0 ; no menu
DC.W DOpen - DHeader ; offset to Open
DC.W DPrime - DHeader ; offset to Prime
DC.W DControl - DHeader ; offset to Control
DC.W DStatus - DHeader ; offset to Status
DC.W DClose - DHeader ; offset to Close
Name DC.B 5 ; length of name
DC.B '.Sony'
ALIGN 2 ; word alignment
DPrime
MOVEM.L A0-A1, -(SP) ; push ParmBlkPtr, DCtlPtr for C
SUBQ #2, A7 ; result code
MOVE.W #kCmndSonyPrime, -(A7)
BRA.B DPrimeStatusCommon
DControl
MOVEM.L A0-A1, -(SP) ; push ParmBlkPtr, DCtlPtr for C
SUBQ #2, A7 ; result code
MOVE.W #kCmndSonyControl, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; save result code
MOVEM.L (SP)+, A0-A1 ; restore ParmBlkPtr, DCtlPtr
CMPI.W #killCode,kcsCode(A0) ; test for KillIO call (special case)
BNE.B IOReturn
RTS ; KillIO must always return via RTS
DStatus
MOVEM.L A0-A1, -(SP) ; push ParmBlkPtr, DCtlPtr for C
SUBQ #2, A7 ; result code
MOVE.W #kCmndSonyStatus, -(A7)
DPrimeStatusCommon
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; save result code
MOVEM.L (SP)+, A0-A1 ; restore ParmBlkPtr, DCtlPtr
IOReturn
MOVE.W kioTrap(A0),D1
BTST #noQueueBit,D1 ; immediate calls are not queued, and must RTS
BEQ.B @Queued ; branch if queued
@NotQueued
TST.W D0 ; test asynchronous return result
BLE.B @ImmedRTS ; result must be <= 0
CLR.W D0 ; "in progress" result (> 0) not passed back
@ImmedRTS
MOVE.W D0,kioResult(A0) ; for immediate calls you must explicitly
; place the result in the ioResult field
RTS
@Queued
TST.W D0 ; test asynchronous return result
BLE.B @MyIODone ; I/O is complete if result <= 0
CLR.W D0 ; "in progress" result (> 0) not passed back
RTS
@MyIODone
MOVE.L JIODone,-(SP) ; push IODone jump vector onto stack
RTS
DClose
MOVEM.L A0-A1, -(SP) ; push ParmBlkPtr, DCtlPtr for C
SUBQ #2, A7 ; result code
MOVE.W #kCmndSonyClose, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; save result code
MOVEM.L (SP)+, A0-A1 ; restore ParmBlkPtr, DCtlPtr
RTS
DUpdate
MOVEM.L D0-D2/A0-A1,-(SP)
MOVE.L 20(A7),D0 ; data = what was on top of stack before 5 registers pushed
SUBQ #4, A7 ; room for eventMsg
MOVE.L D0,-(A7) ; data
SUBQ #2, A7 ; room for result code
MOVE.W #kCmndSonyMount, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D1 ; result code
ADDQ #4, A7 ; skip over data
MOVE.L (A7)+, D0 ; eventMsg
TST.W D1 ; result code
BNE.S @1
MOVEA.W #$0007,A0
DC.W $A02F ; _PostEvent
@1
MOVEM.L (SP)+,D0-D2/A0-A1
ADDA.W #4,A7 ; remove arguments from stack
RTE
MyAddDrive64k
; This is only needed for the 64k ROM.
DrvQHdr EQU 776
RomBase EQU $00400000
Move.L D0,6(A0)
Lea.L (DrvQHdr),A1
Jmp (RomBase + 2848)
NullTaskProc
RTS
DOpen
MOVEM.L D3-D7/A3,-(A7)
MOVEM.L A0-A1, -(SP) ; push ParmBlkPtr, DCtlPtr for C
SUBQ #6, A7 ; room for result code, L
MOVE.W #kCmndSonyOpenA, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; result code
MOVE.L (A7)+, D7 ; L
CMPI.W #$FFCF,D0
BNE.S @1
; driver already open, change to no error and leave
CLR.W D0
BRA @2
@1
TST.W D0
BNE @2
MOVE.L D7,D0
DC.W $A71E ; _NewPtr ,Sys,Clear
MOVEA.L A0,A3
MOVE.L A3,D0
BEQ @6
SUBA #16, A7 ; room for various results
MOVE.L A3, -(A7)
MOVE.L D7, -(A7)
SUBQ #2, A7 ; room for result code
MOVE.W #kCmndSonyOpenB, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; result code
ADDA.W #8, A7
MOVE.L (A7)+, D7 ; dvl
MOVEQ #$00, D3
MOVE.W (A7)+, D3 ; step
MOVE.W (A7)+, D4 ; n
MOVE.W (A7)+, D6 ; i
MOVE.W (A7)+, D5 ; driver
MOVEA.L (A7)+, A3 ; NullTask
TST.W D0
BNE.S @2
MOVE.L A3,D0
BEQ.S @3
; There is apparently a bug in the time manager
; in System 6.0.8, which will cause a crash
; if there are no installed time
; tasks. So create a time task, since
; real disk driver does.
LEA NullTaskProc,A0 ; id: 102
MOVE.L A0,$0006(A3)
MOVEA.L A3,A0
DC.W $A058 ; _InsTime
BRA.S @4
@3
LEA MyAddDrive64k,A0 ; id: 106
MOVE.W #$A04E,D0
DC.W $A047 ; _SetTrapAddress
BRA.S @4
@5
MOVEA.L D7,A0
MOVE.W D6,D0 ; drive number in high word
SWAP D0
MOVE.W D5,D0 ; driver in low word
DC.W $A04E ; _AddDrive
ADD.L D3,D7
ADDQ.W #$1,D6
@4
DBF D4, @5
PEA DUpdate
SUBQ #2, A7 ; room for result code
MOVE.W #kCmndSonyOpenC, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; result code
ADDA.W #4, A7
@2
; result code should be in D0 when reach here
MOVEM.L (A7)+, A0-A1 ; restore ParmBlkPtr, DCtlPtr
MOVEM.L (A7)+, D3-D7/A3
RTS ; open is always immediate, must return via RTS
@6
; _NewPtr failed
MOVE.W #-1, D0
BRA.S @2
TailData
ENDMAIN
END

View File

@ -0,0 +1,277 @@
STRING C
MACHINE MC68020
PRINT OFF
INCLUDE 'SlotEqu.a'
INCLUDE 'VideoEqu.a'
INCLUDE 'Traps.a'
INCLUDE 'SysEqu.a'
INCLUDE 'SysErr.a'
PRINT ON
VideoDeclROM MAIN
;========================================================================================
; General Directives
BLANKS ON
STRING ASIS
kCmndVideoSetIntEnbl EQU $0003
kCmndVideoClearInt EQU $0004
kCmndVideoStatus EQU $0005
kCmndVideoControl EQU $0006
;========================================================================================
; Local Vars, definitions, etc...
;========================================================================================
;This is device storage, a handle to which is stored in the dCtlStorage field of the DCE.
saveSQElPtr EQU 0 ; the SQ element pointer (for
; _SIRemove
dCtlSize EQU saveSQElPtr+4 ; size of the dCtlStorage
;========================================================================================
; Video Driver Header
;========================================================================================
VidDrvr
DC.W $4C00 ; ctl,status,needsLock
DC.W 0, 0, 0 ; not an ornament
;Entry point offset table
DC.W VideoOpen - VidDrvr ; open routine
DC.W VidDrvr - VidDrvr ; no prime
DC.W VideoCtl - VidDrvr ; control
DC.W VideoStatus - VidDrvr ; status
DC.W VideoClose - VidDrvr ; close
VideoTitle
STRING Pascal
DC.W '.Display_Video_Sample'
STRING ASIS
ALIGN 2 ; make sure we're aligned
DC.W 0 ; version-0
;========================================================================================
;VideoOpen allocates private storage for the device in the DCE and locks
; it down for perpetuity. It installs the interrupt handler and enables
; the interrupts. It also sets the default gamma table included in the driver.
;
;Entry:
; A0 = param block pointer
; A1 = DCE pointer
;
;Locals:
; A2 = Saved param block pointer
; A3 = Saved DCE pointer
; A4 = Saved interrupt handler ptr
;========================================================================================
;Save registers
VideoOpen
MOVE.L A0, A2 ; A2 <- param block pointer
MOVE.L A1, A3 ; A3 <- DCE pointer
;Allocate private storage
MOVEQ #dCtlSize, D0 ; get size of parameters
_ResrvMem ,SYS ; make room as low as possible
MOVEQ #dCtlSize, D0 ; get size of parameters
_NewHandle ,SYS,CLEAR ; get some memory for private
; storage
BNE OpError ;=> return an error in open
MOVE.L A0, dCtlStorage(A3) ; saved returned handle in DCE
_HLock ; and lock it down
;Get and install the interrupt handler
LEA BeginIH, A4 ; Save point to interrupt handler
MOVEQ #SlotIntQElement.sqHDSize,D0 ; allocate a slot queue element
_NewPtr ,SYS,CLEAR ; get it from system heap cleared
BNE OpError
MOVE.W #SIQType, SlotIntQElement.sqType(A0) ; setup queue ID
MOVE.L A4, SlotIntQElement.sqAddr(A0) ; setup int routine address
MOVE.L A3, SlotIntQElement.sqParm(A0) ; save slot base addr as A3 parm
CLR.L D0
MOVE.B dctlSlot(A3), D0 ; setup slot #
_SIntInstall ; and do install
BNE.S OpError
;Save SQElPtr for removal
MOVE.L dCtlStorage(A3), A1 ; Get point to private storage
MOVE.L (A1), A1
MOVE.L A0, saveSQElPtr(A1) ; Save the SQ element pointer
;Enable interrupts
MOVE.W #1, -(A7) ; enabled
SUBQ #2, A7 ; result code
MOVE.W #kCmndVideoSetIntEnbl, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #10, A7
MOVEQ #0, D0 ; no error
BRA.S EndOpen
; Error
OpError
MOVE.L #openErr, D0 ; say can't open driver
EndOpen
RTS
;========================================================================================
; The interrupt handler for the board
;========================================================================================
; On entry A1 contains DCE
; wrong! : "D0-D3/A0-A3 have been preserved."
; (comment from Apples sample code.)
; must preserve registers except A1/D0
BeginIH
MOVE.L A0, -(A7)
; clear interrupt from card
SUBQ #2, A7 ; result code
MOVE.W #kCmndVideoClearInt, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDQ.W #8, A7
MOVE.L dctlDevBase(A1), D0 ; D0 = $Fsxxxxxx
ROL.L #8, D0 ; D0 <- $xxxxxxFs Convert the
; address into
AND #$0F, D0 ; D0 <- $xxxx000x the slot
; number
MOVE.L JVBLTask, A0 ; call the VBL task manager
JSR (A0) ; with slot # in D0
MOVE.L (A7)+, A0
MOVEQ #1, D0 ; signal that int was serviced
RTS ; and return to caller
;========================================================================================
;
;VideoClose releases the device's private storage.
;
;Entry:
; A0 = param block pointer
; A1 = DCE pointer
;
;Locals:
; A2 = Saved param block pointer
; A3 = Saved DCE pointer
; A4 = Temporary
;
;========================================================================================
VideoClose
MOVE.L A3, -(A7) ; save
MOVE.L dCtlStorage(A1), A3; Get pointer to private storage
MOVE.W #0, -(A7) ; disabled
SUBQ #2, A7 ; result code
MOVE.W #kCmndVideoSetIntEnbl, -(A7)
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #10, A7
MOVE.L (A3), A0
MOVE.L saveSQElPtr(A0), A0 ; Get the SQ element pointer
_SIntRemove ; Remove the interrupt handler
MOVE.L A3, A0 ; Dispose of the private storage
_DisposHandle
MOVEQ #0, D0 ; get error into D0
MOVE.L (A7)+, A3 ; restore A3
RTS ; return to caller
;========================================================================================
;
;Video Driver Control Call Handler.
;
; Entry:
; A0 = param block pointer
; A1 = DCE pointer
; Uses:
; A2 = cs paramaters (i.e. A2 <- csParam(A0)) (must be preserved)
; A3 = scratch (doesn't need to be preserved)
; A4 = scratch (must be preserved)
; D0-D3 = scratch (don't need to be preserved)
;
; Exit: D0 = error code
;
;========================================================================================
;Decode the call
VideoCtl
MOVE.L A0, -(A7)
SUBQ #2, A7 ; result code
MOVE.W #kCmndVideoControl, -(A7)
BRA.S VideoStatusControlCommon
;========================================================================================
;
;Video DriverStatus Call Handler. Right now there are three calls:
;
; (2) GetMode
; (4) GetPage
; (5) GetPageBase
;
; Entry:
; A0 = param block
; A1 = DCE pointer
; Uses:
; A2 = cs paramaters (i.e. A2 <- csParam(A0)) (must be preserved)
; A3 = scratch (doesn't need to be preserved)
; D0-D3 = scratch (don't need to be preserved)
;
; Exit: D0 = error code
;
;========================================================================================
VideoStatus
MOVE.L A0, -(A7)
SUBQ #2, A7 ; result code
MOVE.W #kCmndVideoStatus, -(A7)
VideoStatusControlCommon
LEA TailData, A0
MOVE.L (A0)+, -(A7)
MOVEA.L (A0), A0
MOVE.L A7, (A0)
ADDA.W #6, A7
MOVE.W (A7)+, D0 ; save result code
MOVE.L (A7)+, A0 ; restore A0
;========================================================================================
; Exit from control or status
;========================================================================================
BTST #NoQueueBit,ioTrap(A0) ;no queue bit set?
BEQ.S GoIODone ;=> no, not immediate
RTS ;otherwise, it was an immediate call
GoIODone
MOVE.L JIODone,A0 ;get the IODone address
JMP (A0)
TailData
ENDP
END

32
extras/trans.txt Normal file
View File

@ -0,0 +1,32 @@
# Some source files are simple transformations of other source
# files. Here are some MPW scripts to help keep them in sync.
Set x "rd:t1.txt"
Catenate "{my_project_d}"data:src:VIAEMDEV.c > "{x}"
Open "{x}"
Set CaseSensitive 1
Find ¥ "{x}"
Replace -c ° /'VIA1'/ 'VIA2' "{x}"
Find ¥ "{x}"
Replace -c ° /'VIAEMDEV'/ 'VIA2EMDV' "{x}"
Find ¥ "{x}"
Replace -c ° /'0x04'([0-9A-FX][0-9A-FX])¨1/ '0x05'¨1 "{x}"
Unset SearchType
Compare "{my_project_d}"data:src:VIA2EMDV.c "{x}"
Catenate "{my_project_d}"data:src:VIA2EMDV.c > "{x}"
Open "{x}"
Set CaseSensitive 1
Find ¥ "{x}"
Replace -c ° /'VIA2EMDV'/ 'VIAEMDEV' "{x}"
Find ¥ "{x}"
Replace -c ° /'VIA2'/ 'VIA1' "{x}"
Find ¥ "{x}"
Replace -c ° /'0x05'([0-9A-FX][0-9A-FX])¨1/ '0x04'¨1 "{x}"
Unset SearchType
Compare "{my_project_d}"data:src:VIAEMDEV.c "{x}"

1216
setup/BLDUTIL3.i Normal file

File diff suppressed because it is too large Load Diff

299
setup/BLDUTIL4.i Normal file
View File

@ -0,0 +1,299 @@
/*
BLDUTIL4.i
Copyright (C) 2009 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
BuiLD system UTILities part 4
*/
LOCALPROC WriteOutDummyContents(void)
{
WriteDestFileLn(
"This file is here because some archive extraction");
WriteDestFileLn("software will not create an empty directory.");
}
LOCALPROC WriteMakeOutputDirectories(void)
{
if ((gbk_ide_xcd == cur_ide) && (! UseCmndLine)) {
} else
if (gbk_ide_mw8 == cur_ide) {
} else {
WriteSectionCommentDestFile("make output directory");
MakeSubDirectory("my_obj_d", "my_project_d", obj_d_name, "");
WriteADstFile1("my_obj_d",
"dummy", ".txt", "Dummy",
WriteOutDummyContents);
}
}
LOCALPROC WriteIdeSpecificFiles(void)
{
#if gbk_ide_mpw == cur_ide
WriteMPWSpecificFiles();
#endif
#if gbk_ide_mvc == cur_ide
WriteMVCSpecificFiles();
#endif
#if (gbk_ide_bgc == cur_ide) \
|| (gbk_ide_cyg == cur_ide) \
|| (gbk_ide_mgw == cur_ide) \
|| (gbk_ide_dkp == cur_ide)
WriteBashGccSpecificFiles();
#endif
#if gbk_ide_mw8 == cur_ide
WriteMetrowerksSpecificFiles();
#endif
#if gbk_ide_snc == cur_ide
WriteSncSpecificFiles();
#endif
#if gbk_ide_msv == cur_ide
WriteMsvSpecificFiles();
#endif
#if gbk_ide_lcc == cur_ide
if (UseCmndLine) {
WriteLccW32clSpecificFiles();
} else {
WriteLccW32SpecificFiles();
}
#endif
#if gbk_ide_dvc == cur_ide
if (UseCmndLine) {
WriteBashGccSpecificFiles();
} else {
WriteDevCSpecificFiles();
}
#endif
#if gbk_ide_xcd == cur_ide
if (UseCmndLine) {
WriteBashGccSpecificFiles();
} else {
WriteXCDSpecificFiles();
}
#endif
#if gbk_ide_dmc == cur_ide
WriteDMCSpecificFiles();
#endif
#if gbk_ide_plc == cur_ide
if (UseCmndLine) {
WritePLCclSpecificFiles();
} else {
WritePLCSpecificFiles();
}
#endif
#if gbk_ide_ccc == cur_ide
WriteCccSpecificFiles();
#endif
}
LOCALPROC ResetAllCommandLineParameters(void)
{
GNResetCommandLineParameters();
GNDevResetCommandLineParameters();
#ifdef Have_SPBLDOPT
SPResetCommandLineParameters();
#endif
olv_cur = 1;
OnlyUserOptions = falseblnr;
}
LOCALFUNC tMyErr TryAsAtOptionNot(void)
{
tMyErr err;
if (! CurArgIsCStr_v2("@")) {
err = kMyErrNoMatch;
} else
if (OnlyUserOptions) {
err = ReportParseFailure("Already have @");
} else
if (kMyErr_noErr != (err = AdvanceTheArg())) {
/* fail */
} else
{
OnlyUserOptions = trueblnr;
err = kMyErr_noErr;
}
return err;
}
LOCALFUNC tMyErr TryAsXClmOptionNot(void)
{
tMyErr err;
if (! CurArgIsCStr_v2("!")) {
err = kMyErrNoMatch;
} else
if (kMyErr_noErr != (err = AdvanceTheArg())) {
/* fail */
} else
{
err = kMyErr_noErr;
++olv_cur;
}
return err;
}
LOCALFUNC tMyErr ReportUnknownSwitch(void)
{
MyPStr t0;
MyPStr t;
GetCurArgAsPStr(t0);
PStrFromCStr(t, "unknown switch : ");
PStrAppend(t, t0);
return ReportParseFailPStr(t);
}
LOCALFUNC tMyErr ProcessCommandLineArguments(void)
{
tMyErr err;
err = kMyErr_noErr;
while ((! The_arg_end) && (kMyErr_noErr == err)) {
if (kMyErrNoMatch == (err = TryAsGNOptionNot()))
if (kMyErrNoMatch == (err = TryAsGNDevOptionNot()))
#ifdef Have_SPBLDOPT
if (kMyErrNoMatch == (err = TryAsSPOptionNot()))
#endif
if (kMyErrNoMatch == (err = TryAsAtOptionNot()))
if (kMyErrNoMatch == (err = TryAsXClmOptionNot()))
{
err = ReportUnknownSwitch();
}
}
return err;
}
LOCALPROC DoDocTypeAddToMainRC(void)
{
WriteBgnDestFileLn();
WriteUnsignedToOutput(256 + DocTypeCounter);
WriteCStrToDestFile(
" ICON DISCARDABLE ");
WriteQuoteToDestFile();
WriteDocTypeIconFileName();
WriteQuoteToDestFile();
WriteEndDestFileLn();
}
LOCALPROC WriteWinMainRCcontents(void)
{
DoAllDocTypesWithSetup(DoDocTypeAddToMainRC);
}
LOCALPROC WriteWinMainRC(void)
{
WriteADstFile1("my_config_d",
"main", ".rc", "Resource Configuration file",
WriteWinMainRCcontents);
}
LOCALPROC WriteConfigFiles(void)
{
WriteAppSpecificConfigFiles();
if (HaveMacRrscs) {
WriteCommonCNFGRSRC();
}
if (gbk_apifam_win == gbo_apifam) {
WriteWinMainRC();
}
}
LOCALPROC MakeConfigFolder(void)
{
WriteSectionCommentDestFile("make configuration folder");
MakeSubDirectory("my_config_d", "my_project_d", cfg_d_name, "");
}
#if WantWriteVarName
LOCALPROC WriteAppVariationStr1(void)
{
WriteBgnDestFileLn();
WriteAppVariationStr();
WriteEndDestFileLn();
}
#endif
#if WantWriteBldOpts
LOCALPROC WriteBldOpts1(void)
{
WriteBgnDestFileLn();
WriteBldOpts();
WriteEndDestFileLn();
}
#endif
LOCALFUNC tMyErr DoTheCommand(void)
{
tMyErr err;
ResetAllCommandLineParameters();
if (kMyErr_noErr == (err = ProcessCommandLineArguments()))
if (kMyErr_noErr == (err = AutoChooseGNSettings()))
if (kMyErr_noErr == (err = AutoChooseGNDevSettings()))
#ifdef Have_SPBLDOPT
if (kMyErr_noErr == (err = AutoChooseSPSettings()))
#endif
{
WriteScriptLangHeader();
WriteMakeOutputDirectories();
MakeConfigFolder();
WriteConfigFiles();
if (CurPrintCFiles) {
WriteCFilesList();
}
#if WantWriteVarName
WriteADstFile1("my_project_d",
"var_name", "", "variation name",
WriteAppVariationStr1);
#endif
#if WantWriteBldOpts
WriteADstFile1("my_project_d",
"bld_opts", "", "build options",
WriteBldOpts1);
#endif
WriteIdeSpecificFiles();
}
return err;
}

101
setup/CMDARGT1.i Normal file
View File

@ -0,0 +1,101 @@
/*
CMDARGT1.i
Copyright (C) 2009 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
CoMmandD ARGument Tool part 1
allows code used with CMDARGW1 to also be
used to make an MPW tool.
*/
LOCALVAR int The_argc;
LOCALVAR int The_argi;
typedef char **The_argvt;
LOCALVAR The_argvt The_argv;
LOCALVAR char *Cur_args;
LOCALVAR blnr The_arg_end;
GLOBALFUNC tMyErr AdvanceTheArg(void)
{
++The_argi;
if (The_argi < The_argc) {
Cur_args = The_argv[The_argi];
} else {
The_arg_end = trueblnr;
}
return kMyErr_noErr;
}
GLOBALFUNC blnr CurArgIsCStr_v2(char *s)
{
/* warning : assumes (! The_arg_end) */
return CStrEq(Cur_args, s);
}
GLOBALFUNC tMyErr CurArgIsCStrAdvance_v2(char *s)
{
tMyErr err;
/* warning : assumes (! The_arg_end) */
if (! CurArgIsCStr_v2(s)) {
err = kMyErrNoMatch;
} else {
err = AdvanceTheArg();
}
return err;
}
GLOBALPROC GetCurArgAsCStr(char *s, uimr MaxN)
{
/* warning : assumes (! The_arg_end) */
if (CStrLength(Cur_args) > MaxN) {
s[0] = 0;
} else {
CStrCopy(s, Cur_args);
}
}
GLOBALPROC GetCurArgAsPStr(ps3p s)
{
/* warning : assumes (! The_arg_end) */
PStrFromCStr(s, Cur_args);
}
GLOBALPROC BeginParseCommandLineArguments(int argc, The_argvt argv)
{
The_argi = 0;
The_argc = argc;
The_argv = argv;
The_arg_end = falseblnr;
(void) AdvanceTheArg();
}
GLOBALFUNC tMyErr ReportParseFailure(char *s)
{
fprintf(stderr, "%s\n", s);
return kMyErrReported;
}
GLOBALFUNC tMyErr ReportParseFailPStr(ps3p s)
{
char t[256];
CStrFromPStr(s, t);
return ReportParseFailure(t);
}

91
setup/CNFGDLFT.i Normal file
View File

@ -0,0 +1,91 @@
/*
CNFGDLFT.i
Copyright (C) 2018 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
CoNFiGuration DeFauLTs
set default values for things not set in CONFIGUR.i
*/
#ifndef kMaintainerName
#define kMaintainerName "unknown"
#endif
#ifndef kStrHomePage
#define kStrHomePage "(unknown)"
#endif
#ifndef cur_ide
#ifdef applec
#define cur_ide gbk_ide_mpw
#else
#define cur_ide gbk_ide_bgc
#endif
#endif /* cur_ide */
#ifndef ide_vers
#if gbk_ide_xcd == cur_ide
#define ide_vers 9410
#elif gbk_ide_msv == cur_ide
#define ide_vers 15000
#else
#define ide_vers 1
#endif
#endif /* ide_vers */
#ifndef UseCmndLine
#define UseCmndLine 0
#endif
#ifndef NeedSegmenting
#if gbk_ide_mpw == cur_ide
#define NeedSegmenting 1
#else
#define NeedSegmenting 0
#endif
#endif /* NeedSegmenting */
#ifndef gbo_script
#if gbk_ide_mpw == cur_ide
#define gbo_script gbk_script_mpw
#else
#define gbo_script gbk_script_bash
#endif
#endif /* gbo_script */
#ifndef WantWriteVarName
#define WantWriteVarName 0
#endif
#ifndef WantWriteBldOpts
#define WantWriteBldOpts 0
#endif

48
setup/CNFGOPTS.i Normal file
View File

@ -0,0 +1,48 @@
/*
CNFGOPTS.i
Copyright (C) 2018 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
CoNFiGuration OPTionS
choices that can be used in CONFIGUR.i
*/
/* choices for cur_ide */
#define gbk_ide_mpw 1 /* Macintosh Programmers Workshop */
#define gbk_ide_mw8 2 /* Metrowerks CodeWarrior */
#define gbk_ide_bgc 3 /* Gnu tools */
#define gbk_ide_snc 4 /* Sun tools */
#define gbk_ide_msv 5 /* Microsoft Visual C++ */
#define gbk_ide_lcc 6 /* lcc-win32 - Jacob Navia */
#define gbk_ide_dvc 7 /* Bloodshed Dev-C++ */
#define gbk_ide_xcd 8 /* Apple XCode */
/* previously Apple Project Builder */
#define gbk_ide_dmc 9 /* Digital Mars Compiler */
#define gbk_ide_plc 10 /* Pelles C Compiler */
#define gbk_ide_mgw 11 /* MinGW */
#define gbk_ide_cyg 12 /* Cygwin */
#define gbk_ide_dkp 13 /* devkitpro */
#define gbk_ide_ccc 14 /* Generic command line c compiler */
#define gbk_ide_mvc 15 /* Mini vMac C (a specific version of gcc) */
/* choices for gbo_script */
#define gbk_script_mpw 1
#define gbk_script_applescript 2
#define gbk_script_bash 3
#define gbk_script_xp 4
#define gbk_script_vbscript 5

10
setup/CONFIGUR.i Normal file
View File

@ -0,0 +1,10 @@
/*
CONFIGUR.i
*/
/*
CONFIGURation file
see CNFGDLFT.i and CNFGOPTS.i for things
that can go here.
*/

90
setup/COREDEFS.i Normal file
View File

@ -0,0 +1,90 @@
/*
COREDEFS.i
Copyright (C) 2018 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
CORE DEFinitionS
*/
typedef unsigned long ui5b;
typedef unsigned short ui4b;
typedef unsigned char ui3b;
typedef signed long si5b;
typedef signed short si4b;
typedef signed char si3b;
typedef ui5b ui5r;
typedef ui4b ui4r;
typedef ui3b ui3r;
typedef si5b si5r;
typedef si4b si4r;
typedef si3b si3r;
typedef si3b *si3p;
typedef ui3b *ui3p;
typedef si4b *si4p;
typedef ui4b *ui4p;
typedef si5b *si5p;
typedef ui5b *ui5p;
typedef ui5p *ui5h;
typedef ui4p *ui4h;
typedef ui3p *ui3h;
/*
define the largest supported
representation types.
*/
#define uimbl2sz 5
typedef si5r simr;
typedef ui5r uimr;
typedef ui3b blnb;
typedef ui3r blnr;
#define trueblnr 1
#define falseblnr 0
typedef si4r tMyErr;
typedef unsigned char MyPStr[256];
typedef unsigned char *ps3p;
typedef unsigned char MyCharR;
typedef MyCharR *MyCharPtr;
typedef unsigned char MyByte;
typedef MyByte *MyPtr;
#define nullpr ((void *) 0)
#define DISCARDVAL (void)
#define LOCALFUNC static
#define GLOBALFUNC static
#define EXPORTFUNC static
#define TYPEDEFFUNC typedef
#define LOCALPROC LOCALFUNC void
#define GLOBALPROC GLOBALFUNC void
#define EXPORTPROC EXPORTFUNC void
#define TYPEDEFPROC TYPEDEFFUNC void
#define LOCALVAR static
#define GLOBALVAR static
#define EXPORTVAR static
GLOBALVAR MyPtr pDt;

64
setup/DFFILDEF.i Normal file
View File

@ -0,0 +1,64 @@
/*
DFFILDEF.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
DEFinitions for program SPecific FILe DEFinitions
*/
#define kDepDirCSrc 0
#define kDepDirCnfg 1
typedef void (*tDoOneDepends)(int DepDir, char *s);
typedef void (*tDoDependsForC)(tDoOneDepends p);
typedef void (*tDoOneCFile)(char *s, int DepDir, long Flgm,
tDoDependsForC depends);
typedef void (*tWriteOneExtension)(char *s);
typedef void (*tWriteExtensionList)(tWriteOneExtension p);
typedef void (*tWriteOneDocType)(
char *ShortName,
char *MacType,
char *LongName,
tWriteExtensionList WriteExtensionList);
#if 0
#define kCSrcFlagAsmAvail 0
#define kCSrcFlagAltSrc 1
#endif
#define kCSrcFlagSkip 1
#define kCSrcFlagUseAPI 2
#define kCSrcFlagSortFirst 3
#define kCSrcFlagNoSource 4
#define kCSrcFlagNoHeader 5
#define kCSrcFlagOjbc 6
#define kCSrcFlgmNone 0
#if 0
#define kCSrcFlgmAltSrc (1 << kCSrcFlagAltSrc)
#endif
#define kCSrcFlgmSkip (1 << kCSrcFlagSkip)
#define kCSrcFlgmUseAPI (1 << kCSrcFlagUseAPI)
#define kCSrcFlgmSortFirst (1 << kCSrcFlagSortFirst)
#define kCSrcFlgmNoSource (1 << kCSrcFlagNoSource)
#define kCSrcFlgmNoHeader (1 << kCSrcFlagNoHeader)
#define kCSrcFlgmOjbc (1 << kCSrcFlagOjbc)
#define CSrcFlagsUseIf(b) ((b) ? kCSrcFlgmNone : kCSrcFlgmSkip)
#define CSrcFlagsUseHdrIf(b) (CSrcFlagsUseIf(b) | kCSrcFlgmNoSource)
#define CSrcFlagsUseSrcIf(b) (CSrcFlagsUseIf(b) | kCSrcFlgmNoHeader)

1573
setup/GNBLDOPT.i Normal file

File diff suppressed because it is too large Load Diff

34
setup/SPBASDEF.i Normal file
View File

@ -0,0 +1,34 @@
/*
SPBASDEF.i
Copyright (C) 2009 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
program SPecific BASic DEFinitions
*/
#define kStrAppName "Mini vMac"
#define kStrAppAbbrev "minivmac" /* [a-z0-9_]{1,8} */
#define MajorVersion 36
#define MinorVersion 04
#define kStrCopyrightYear "2018"
#define kMacCreatorSig "MnvM"
#define kBundleIdentifier "com.gryphel.minivmac"
#define kShortDescription "miniature Macintosh emulator"
#define Have_SPBLDOPT 1
#define Have_SPCNFGGL 1
#define Have_SPCNFGAP 1
#define UseOpenGLinOSX 1

3944
setup/SPBLDOPT.i Normal file

File diff suppressed because it is too large Load Diff

286
setup/SPCNFGAP.i Normal file
View File

@ -0,0 +1,286 @@
/*
SPCNFGAP.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
program SPecific CoNFiGuration of API users
(that is, configuration settings that are used
only by platform specific code)
*/
LOCALPROC WriteAppSpecificCNFGRAPIoptions(void)
{
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define RomFileName \"");
switch (cur_mdl) {
case gbk_mdl_Twig43:
WriteCStrToDestFile("Twig43.ROM");
break;
case gbk_mdl_Twiggy:
WriteCStrToDestFile("Twiggy.ROM");
break;
case gbk_mdl_128K:
WriteCStrToDestFile("Mac128K.ROM");
break;
case gbk_mdl_SE:
WriteCStrToDestFile("MacSE.ROM");
break;
case gbk_mdl_SEFDHD:
WriteCStrToDestFile("SEFDHD.ROM");
break;
case gbk_mdl_Classic:
WriteCStrToDestFile("Classic.ROM");
break;
case gbk_mdl_PB100:
WriteCStrToDestFile("PB100.ROM");
break;
case gbk_mdl_II:
WriteCStrToDestFile("MacII.ROM");
break;
case gbk_mdl_IIx:
WriteCStrToDestFile("MacIIx.ROM");
break;
case gbk_mdl_512Ke:
case gbk_mdl_Plus:
default:
WriteCStrToDestFile("vMac.ROM");
break;
}
WriteCStrToDestFile("\"");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kCheckSumRom_Size ");
if (gbk_mdl_Classic == cur_mdl) {
WriteCStrToDestFile("0x040000"); /* 256 KB */
} else {
WriteCStrToDestFile("0x");
WriteHexLongToOutput(1UL << cur_RomSize);
}
WriteEndDestFileLn();
switch (cur_mdl) {
case gbk_mdl_Twig43:
WriteDestFileLn("#define kRomCheckSum1 0x27F4E04B");
break;
case gbk_mdl_Twiggy:
WriteDestFileLn("#define kRomCheckSum1 0x2884371D");
break;
case gbk_mdl_128K:
WriteDestFileLn("#define kRomCheckSum1 0x28BA61CE");
WriteDestFileLn("#define kRomCheckSum2 0x28BA4E50");
break;
case gbk_mdl_SE:
WriteDestFileLn("#define kRomCheckSum1 0xB2E362A8");
break;
case gbk_mdl_SEFDHD:
WriteDestFileLn("#define kRomCheckSum1 0xB306E171");
break;
case gbk_mdl_Classic:
WriteDestFileLn("#define kRomCheckSum1 0xA49F9914");
break;
case gbk_mdl_PB100:
WriteDestFileLn("#define kRomCheckSum1 0x96645F9C");
break;
case gbk_mdl_II:
WriteDestFileLn("#define kRomCheckSum1 0x9779D2C4");
WriteDestFileLn("#define kRomCheckSum2 0x97221136");
break;
case gbk_mdl_IIx:
WriteDestFileLn("#define kRomCheckSum1 0x97221136");
break;
case gbk_mdl_512Ke:
case gbk_mdl_Plus:
default:
WriteDestFileLn("#define kRomCheckSum1 0x4D1EEEE1");
/* Mac Plus ROM v 1, 'Lonely Hearts' */
WriteDestFileLn("#define kRomCheckSum2 0x4D1EEAE1");
/* Mac Plus ROM v 2, 'Lonely Heifers' */
WriteDestFileLn("#define kRomCheckSum3 0x4D1F8172");
/* Mac Plus ROM v 3, 'Loud Harmonicas' */
break;
}
if (! WantCheckRomCheckSum) {
WriteCompCondBool("CheckRomCheckSum", WantCheckRomCheckSum);
}
WriteCompCondBool("RomStartCheckSum", (cur_mdl >= gbk_mdl_Twiggy));
if (DbgLogHAVE) {
WriteDefineUimr("dbglog_buflnsz", dbglog_buflnsz);
}
if (gbk_targfam_wnce == gbo_targfam) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define EnableShellLinks 0");
WriteDestFileLn("#define EnableDragDrop 0");
WriteDestFileLn("#define UseTimerThread 0");
} else if (gbk_targfam_lnds == gbo_targfam) {
WriteDestFileLn("#define EnableDragDrop 0");
} else {
WriteDestFileLn("#define EnableDragDrop 1");
}
WriteCompCondBool("SaveDialogEnable", gbo_SaveDialogEnable);
WriteCompCondBool("EnableAltKeysMode", WantAltKeysMode);
{
uimr i;
for (i = 0; i < kNumSrcKeyNames; ++i) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define MKC_formac_");
WriteCStrToDestFile(GetSrcKeyMapName(i));
WriteCStrToDestFile(" MKC_");
WriteCStrToDestFile(GetDstKeyMapName(gbo_keymap[i]));
WriteEndDestFileLn();
}
}
if (gbk_keynam_Control == ControlModeKey) {
/* kStrCntrlKyName */
} else {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kControlModeKey \"");
WriteCStrToDestFile(GetSrcKeyMapName(ControlModeKey));
WriteCStrToDestFile("\"");
WriteEndDestFileLn();
}
if (gbk_keynam_Control == gbo_EKTMap) {
/* kStrCntrlKyName */
} else {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kUnMappedKey \"");
WriteCStrToDestFile(GetDstKeyMapName(gbo_EKTMap));
WriteCStrToDestFile("\"");
WriteEndDestFileLn();
}
WriteBgnDestFileLn();
WriteCStrToDestFile("#define MKC_UnMappedKey ");
WriteCStrToDestFile(" MKC_");
WriteCStrToDestFile(GetDstKeyMapName(gbo_EKTMap));
WriteEndDestFileLn();
WriteCompCondBool("VarFullScreen", WantVarFullScreen);
if (WantVarFullScreen) {
WriteCompCondBool("WantInitFullScreen", WantInitFullScreen);
}
WriteCompCondBool("MayFullScreen",
WantVarFullScreen || WantInitFullScreen);
WriteCompCondBool("MayNotFullScreen",
WantVarFullScreen || ! WantInitFullScreen);
WriteCompCondBool("WantInitMagnify", WantInitMagnify);
WriteCompCondBool("EnableMagnify", 1 != cur_MagFctr);
if (1 != cur_MagFctr) {
WriteDefineUimr("MyWindowScale", cur_MagFctr);
}
if (nanblnr != WantColorImage) {
WriteCompCondBool("UseColorImage", WantColorImage);
}
WriteCompCondBool("WantInitRunInBackground", WantInitBackground);
WriteCompCondBool("WantInitNotAutoSlow", ! WantInitAutoSlow);
WriteBgnDestFileLn();
WriteCStrToDestFile("#define WantInitSpeedValue ");
if (gbk_speed_AllOut == CurInitSpeed) {
WriteCStrToDestFile("-1");
} else {
WriteUnsignedToOutput(CurInitSpeed - 1);
}
WriteEndDestFileLn();
if (WantScreenVSync) {
WriteDestFileLn("#define UseAGLdoublebuff 1");
}
if (WantGraphicsSwitching) {
WriteDestFileLn("#define WantGraphicsSwitching 1");
}
if (! WantGrabKeysFS) {
WriteDestFileLn("#define GrabKeysFullScreen 0");
}
WriteCompCondBool("WantEnblCtrlInt", WantEnblCtrlInt);
WriteCompCondBool("WantEnblCtrlRst", WantEnblCtrlRst);
WriteCompCondBool("WantEnblCtrlKtg", WantEnblCtrlKtg);
WriteCompCondBool("NeedRequestInsertDisk",
(gbk_apifam_gtk == gbo_apifam)
|| (gbk_apifam_mac == gbo_apifam)
|| (gbk_apifam_win == gbo_apifam)
|| (gbk_apifam_osx == gbo_apifam)
|| (gbk_apifam_cco == gbo_apifam)
);
if (WantInsertIthDisk) {
WriteDestFileLn("#define NeedRequestIthDisk 1");
}
WriteCompCondBool("NeedDoMoreCommandsMsg",
(gbk_apifam_gtk == gbo_apifam)
|| (gbk_apifam_mac == gbo_apifam)
|| (gbk_apifam_win == gbo_apifam)
|| (gbk_apifam_osx == gbo_apifam)
|| (gbk_apifam_cco == gbo_apifam)
);
WriteCompCondBool("NeedDoAboutMsg",
(gbk_apifam_gtk == gbo_apifam)
|| (gbk_apifam_mac == gbo_apifam)
|| (gbk_apifam_win == gbo_apifam)
|| (gbk_apifam_osx == gbo_apifam)
|| (gbk_apifam_cco == gbo_apifam)
);
WriteCompCondBool("UseControlKeys", trueblnr);
WriteCompCondBool("UseActvCode", WantActvCode);
WriteCompCondBool("EnableDemoMsg", WantDemoMsg);
if (WantActvCode) {
int i;
WriteBlankLineToDestFile();
for (i = 0; i < NumKeyCon; ++i) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define KeyCon");
WriteUnsignedToOutput(i);
WriteSpaceToDestFile();
WriteUnsignedToOutput(KeyCon[i]);
WriteEndDestFileLn();
}
}
WriteBlankLineToDestFile();
WriteDestFileLn("/* version and other info to display to user */");
WriteBlankLineToDestFile();
WriteCompCondBool("NeedIntlChars",
(gbk_lang_eng != gbo_lang) || NeedIntl);
if (gbk_apifam_win == gbo_apifam) {
WriteCompCondBool("ItnlKyBdFix", ItnlKyBdFix);
}
WriteCDefQuote("kStrAppName", WriteStrAppUnabrevName);
WriteCDefQuote("kAppVariationStr", WriteAppVariationStr);
WriteCDefQuote("kStrCopyrightYear", WriteAppCopyrightYearStr);
WriteCDefQuote("kMaintainerName", WriteMaintainerName);
WriteCDefQuote("kStrHomePage", WriteHomePage);
}

103
setup/SPCNFGGL.i Normal file
View File

@ -0,0 +1,103 @@
/*
SPCNFGGL.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
program SPecific CoNFiGuration GLobals
*/
LOCALPROC WriteAppSpecificCNFGGLOBoptions(void)
{
WriteBlankLineToDestFile();
WriteCompCondBool("MySoundRecenterSilence", falseblnr);
WriteDefineUimr("kLn2SoundSampSz", cur_SoundSampSz);
WriteBlankLineToDestFile();
#if 0 /* not used currently */
WriteCompCondBool("Debug", gbk_dbg_off != gbo_dbg);
#endif
WriteCompCondBool("dbglog_HAVE", DbgLogHAVE);
WriteCompCondBool("WantAbnormalReports", gbo_AbnormalReports);
WriteBlankLineToDestFile();
WriteDefineUimr("NumDrives", cur_numdrives);
WriteCompCondBool("IncludeSonyRawMode", (! WantMinExtn)
&& (gbk_apifam_nds != gbo_apifam));
WriteCompCondBool("IncludeSonyGetName",
(! WantMinExtn) && (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam)
&& (gbk_apifam_sdl != gbo_apifam)
&& (gbk_apifam_sd2 != gbo_apifam));
WriteCompCondBool("IncludeSonyNew",
(! WantMinExtn) && (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_sdl != gbo_apifam)
&& (gbk_apifam_sd2 != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam));
WriteCompCondBool("IncludeSonyNameNew",
(! WantMinExtn) && (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_sdl != gbo_apifam)
&& (gbk_apifam_sd2 != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam));
WriteBlankLineToDestFile();
WriteDefineUimr("vMacScreenHeight", cur_vres);
WriteDefineUimr("vMacScreenWidth", cur_hres);
WriteDefineUimr("vMacScreenDepth", cur_ScrnDpth);
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kROM_Size ");
WriteCStrToDestFile("0x");
WriteHexLongToOutput(1UL << cur_RomSize);
WriteEndDestFileLn();
WriteBlankLineToDestFile();
WriteCompCondBool("IncludePbufs",
1 /* ((! WantMinExtn) || WantActvCode || WantDemoMsg) */
&& (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam));
WriteDefineUimr("NumPbufs", 4);
WriteBlankLineToDestFile();
WriteCompCondBool("EnableMouseMotion", MyMouseMotion);
WriteBlankLineToDestFile();
WriteCompCondBool("IncludeHostTextClipExchange",
1 /* ((! WantMinExtn) || WantActvCode || WantDemoMsg) */
&& (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_sdl != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam));
WriteDestFileLn("#define EnableAutoSlow 1");
WriteCompCondBool("EmLocalTalk", WantLocalTalk);
WriteCompCondBool("AutoLocation", WantAutoLocation);
WriteCompCondBool("AutoTimeZone", WantAutoTimeZone);
}

290
setup/SPFILDEF.i Normal file
View File

@ -0,0 +1,290 @@
/*
SPFILDEF.i
Copyright (C) 2012 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
program SPecific FILe DEFinitions
*/
/* --- list of source files --- */
static void DoMYOSGLUEdepends(tDoOneDepends p)
{
{
char *s = nullpr;
switch (gbo_lang) {
case gbk_lang_eng:
s = "STRCNENG.h";
break;
case gbk_lang_fre:
s = "STRCNFRE.h";
break;
case gbk_lang_ita:
s = "STRCNITA.h";
break;
case gbk_lang_ger:
s = "STRCNGER.h";
break;
case gbk_lang_dut:
s = "STRCNDUT.h";
break;
case gbk_lang_spa:
s = "STRCNSPA.h";
break;
case gbk_lang_pol:
s = "STRCNPOL.h";
break;
case gbk_lang_ptb:
s = "STRCNPTB.h";
break;
case gbk_lang_cat:
s = "STRCNCAT.h";
break;
case gbk_lang_cze:
s = "STRCNCZE.h";
break;
case gbk_lang_srl:
s = "STRCNSRL.h";
break;
}
if (nullpr != s) {
p(kDepDirCSrc, s);
}
}
p(kDepDirCnfg, "STRCONST.h");
p(kDepDirCSrc, "INTLCHAR.h");
p(kDepDirCSrc, "COMOSGLU.h");
if (WantLocalTalk) {
p(kDepDirCSrc, "BPFILTER.h");
}
if (WantAltKeysMode) {
p(kDepDirCSrc, "ALTKEYSM.h");
}
p(kDepDirCSrc, "CONTROLM.h");
if (gbk_sndapi_none != gbo_sndapi) {
{
char *s = nullpr;
switch (gbo_sndapi) {
case gbk_sndapi_alsa:
s = "SGLUALSA.h";
break;
case gbk_sndapi_ddsp:
s = "SGLUDDSP.h";
break;
}
if (nullpr != s) {
p(kDepDirCSrc, s);
}
}
p(kDepDirCnfg, "SOUNDGLU.h");
}
}
static void DoMINEM68Kdepends(tDoOneDepends p)
{
if (cur_mIIorIIX) {
p(kDepDirCSrc, "FPMATHEM.h");
p(kDepDirCSrc, "FPCPEMDV.h");
}
}
static void DoROMEMDEVdepends(tDoOneDepends p)
{
if (NeedScrnHack) {
p(kDepDirCSrc, "SCRNHACK.h");
}
if (gbk_AHM_none != cur_AltHappyMac) {
p(kDepDirCSrc, "HPMCHACK.h");
}
}
static void DoAllSrcFiles(tDoOneCFile p)
{
blnr WantSCRNMAPR = (gbk_apifam_osx == gbo_apifam)
|| (gbk_apifam_mac == gbo_apifam)
|| (gbk_apifam_cco == gbo_apifam)
|| (gbk_apifam_xwn == gbo_apifam)
|| (gbk_apifam_sdl == gbo_apifam)
|| (gbk_apifam_sd2 == gbo_apifam);
blnr WantSCRNTRNS = WantSCRNMAPR && (cur_ScrnDpth != 0);
p("CNFGRAPI", kDepDirCnfg, kCSrcFlgmNoSource, nullpr);
p("CNFGGLOB", kDepDirCnfg, kCSrcFlgmNoSource, nullpr);
p("SYSDEPNS", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("ENDIANAC", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("MYOSGLUE", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("STRCNENG", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_eng == gbo_lang), nullpr);
p("STRCNFRE", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_fre == gbo_lang), nullpr);
p("STRCNITA", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_ita == gbo_lang), nullpr);
p("STRCNGER", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_ger == gbo_lang), nullpr);
p("STRCNDUT", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_dut == gbo_lang), nullpr);
p("STRCNSPA", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_spa == gbo_lang), nullpr);
p("STRCNPOL", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_pol == gbo_lang), nullpr);
p("STRCNPTB", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_ptb == gbo_lang), nullpr);
p("STRCNCAT", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_cat == gbo_lang), nullpr);
p("STRCNCZE", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_cze == gbo_lang), nullpr);
p("STRCNSRL", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_lang_srl == gbo_lang), nullpr);
p("STRCONST", kDepDirCnfg, kCSrcFlgmNoSource, nullpr);
p("INTLCHAR", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("COMOSGLU", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("BPFILTER", kDepDirCSrc,
CSrcFlagsUseHdrIf(WantLocalTalk), nullpr);
p("ALTKEYSM", kDepDirCSrc,
CSrcFlagsUseHdrIf(WantAltKeysMode), nullpr);
p("ACTVCODE", kDepDirCSrc,
CSrcFlagsUseHdrIf(WantActvCode), nullpr);
p("CONTROLM", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("PBUFSTDC", kDepDirCSrc,
CSrcFlagsUseHdrIf((gbk_apifam_xwn == gbo_apifam)
|| (gbk_apifam_sd2 == gbo_apifam)
|| (gbk_apifam_sdl == gbo_apifam)
),
nullpr);
p("SCRNMAPR", kDepDirCSrc,
CSrcFlagsUseHdrIf(WantSCRNMAPR), nullpr);
p("SCRNTRNS", kDepDirCSrc,
CSrcFlagsUseHdrIf(WantSCRNTRNS), nullpr);
p("DATE2SEC", kDepDirCSrc, kCSrcFlgmNoSource, nullpr);
p("SGLUALSA", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_sndapi_alsa == gbo_sndapi), nullpr);
p("SGLUDDSP", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_sndapi_ddsp == gbo_sndapi), nullpr);
p("SOUNDGLU", kDepDirCnfg,
CSrcFlagsUseHdrIf(gbk_sndapi_none != gbo_sndapi), nullpr);
p("OSGLUMAC", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_mac == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUOSX", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_osx == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUWIN", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_win == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUXWN", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_xwn == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUNDS", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_nds == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUGTK", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_gtk == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUSDL", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_sdl == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUSD2", kDepDirCSrc,
kCSrcFlgmUseAPI
| CSrcFlagsUseSrcIf(gbk_apifam_sd2 == gbo_apifam),
DoMYOSGLUEdepends);
p("OSGLUCCO", kDepDirCSrc,
kCSrcFlgmUseAPI | kCSrcFlgmOjbc
| CSrcFlagsUseSrcIf(gbk_apifam_cco == gbo_apifam),
DoMYOSGLUEdepends);
p("EMCONFIG", kDepDirCnfg, kCSrcFlgmNoSource, nullpr);
p("GLOBGLUE", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("M68KITAB", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("DISAM68K", kDepDirCSrc, CSrcFlagsUseIf(WantDisasm), nullpr);
p("FPMATHEM", kDepDirCSrc,
CSrcFlagsUseHdrIf(cur_mIIorIIX),
nullpr);
p("FPCPEMDV", kDepDirCSrc,
CSrcFlagsUseHdrIf(cur_mIIorIIX),
nullpr);
p("MINEM68K", kDepDirCSrc, kCSrcFlgmSortFirst, DoMINEM68Kdepends);
/*
Put the most speed critical part of the
program first, to help ensure consistent
alignment for it, regardless of changes
to rest of program.
Speed can depend subtly, basically
randomly, on how code is aligned.
*/
p("VIAEMDEV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("VIA2EMDV", kDepDirCSrc, CSrcFlagsUseIf(EmVIA2), nullpr);
p("IWMEMDEV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("SCCEMDEV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("RTCEMDEV", kDepDirCSrc, CSrcFlagsUseIf(EmRTC), nullpr);
p("SCRNHACK", kDepDirCSrc,
CSrcFlagsUseHdrIf(NeedScrnHack), nullpr);
p("HPMCHACK", kDepDirCSrc,
CSrcFlagsUseHdrIf(gbk_AHM_none != cur_AltHappyMac), nullpr);
p("ROMEMDEV", kDepDirCSrc, kCSrcFlgmNone, DoROMEMDEVdepends);
p("SCSIEMDV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("SONYEMDV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("SCRNEMDV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("VIDEMDEV", kDepDirCSrc, CSrcFlagsUseIf(EmVidCard), nullpr);
p("MOUSEMDV", kDepDirCSrc, kCSrcFlgmNone, nullpr);
p("KBRDEMDV", kDepDirCSrc, CSrcFlagsUseIf(EmClassicKbrd), nullpr);
p("ADBSHARE", kDepDirCSrc,
CSrcFlagsUseHdrIf(cur_mdl >= gbk_mdl_SE), nullpr);
p("ADBEMDEV", kDepDirCSrc, CSrcFlagsUseIf(EmADB), nullpr);
p("PMUEMDEV", kDepDirCSrc, CSrcFlagsUseIf(EmPMU), nullpr);
p("ASCEMDEV", kDepDirCSrc, CSrcFlagsUseIf(EmASC), nullpr);
p("SNDEMDEV", kDepDirCSrc,
CSrcFlagsUseIf((! EmASC) && (gbk_mdl_PB100 != cur_mdl)
&& MySoundEnabled),
nullpr);
p("PROGMAIN", kDepDirCSrc, kCSrcFlgmNone, nullpr);
}
/* --- list of document types --- */
static void WriteRomExtensions(tWriteOneExtension p)
{
p("rom");
}
static void WriteDskExtensions(tWriteOneExtension p)
{
p("dsk");
}
static void DoAllDocTypes(tWriteOneDocType p)
{
p("ROM", "ROM!", "Rom image", WriteRomExtensions);
p("DSK", "MvIm", "Disk image", WriteDskExtensions);
}

903
setup/SPOTHRCF.i Normal file
View File

@ -0,0 +1,903 @@
/*
SPOTHRCF.i
Copyright (C) 2008 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
program SPecific write OTHer ConFiguration files
*/
LOCALPROC WriteAppCNFGGLOBContents(void)
{
WriteCommonCNFGGLOBContents();
if (cur_mIIorIIX) {
Write64bitConfig();
}
WriteBlankLineToDestFile();
WriteDestFileLn(
"/* capabilities provided by platform specific code */");
WriteBlankLineToDestFile();
WriteCompCondBool("MySoundEnabled", MySoundEnabled);
WriteAppSpecificCNFGGLOBoptions();
}
LOCALPROC WriteBldOpts(void)
{
Branch = MajorVersion;
WrtOptGNSettings();
WrtOptSPSettings();
}
LOCALPROC WriteAppCNFGRAPIContents(void)
{
WriteCommonCNFGRAPIContents();
WriteAppSpecificCNFGRAPIoptions();
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kBldOpts \"");
WriteBldOpts();
WriteCStrToDestFile("\"");
WriteEndDestFileLn();
}
LOCALPROC WriteOneWire(char *a, char *b)
{
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("\tWire_");
WriteCStrToDestFile(a);
WriteCStrToDestFile("_");
WriteCStrToDestFile(b);
WriteCStrToDestFile(",");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define ");
WriteCStrToDestFile(b);
WriteCStrToDestFile(" (Wires[Wire_");
WriteCStrToDestFile(a);
WriteCStrToDestFile("_");
WriteCStrToDestFile(b);
WriteCStrToDestFile("])");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define ");
WriteCStrToDestFile(a);
WriteCStrToDestFile(" (Wires[Wire_");
WriteCStrToDestFile(a);
WriteCStrToDestFile("_");
WriteCStrToDestFile(b);
WriteCStrToDestFile("])");
WriteEndDestFileLn();
}
LOCALPROC WriteConfigureWires(void)
{
WriteDestFileLn(
"/* the Wire variables are 1/0, not true/false */");
WriteBlankLineToDestFile();
WriteDestFileLn("enum {");
if (cur_mIIorIIX) {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_unknown_SoundDisable,");
WriteDestFileLn(
"#define SoundDisable (Wires[Wire_unknown_SoundDisable])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_unknown_SoundVolb0,");
WriteDestFileLn(
"#define SoundVolb0 (Wires[Wire_unknown_SoundVolb0])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_unknown_SoundVolb1,");
WriteDestFileLn(
"#define SoundVolb1 (Wires[Wire_unknown_SoundVolb1])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_unknown_SoundVolb2,");
WriteDestFileLn(
"#define SoundVolb2 (Wires[Wire_unknown_SoundVolb2])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iA0_unknown,");
WriteDestFileLn(
"#define VIA1_iA0 (Wires[Wire_VIA1_iA0_unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iA1_unknown,");
WriteDestFileLn(
"#define VIA1_iA1 (Wires[Wire_VIA1_iA1_unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iA2_unknown,");
WriteDestFileLn(
"#define VIA1_iA2 (Wires[Wire_VIA1_iA2_unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn(
"\tWire_VIA1_iB7_unknown,"
" /* for compatibility with SoundDisable */");
WriteDestFileLn(
"#define VIA1_iB7 (Wires[Wire_VIA1_iB7_unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_InterruptRequest,");
WriteDestFileLn(
"#define VIA2_InterruptRequest"
" (Wires[Wire_VIA2_InterruptRequest])");
WriteDestFileLn(
"#define VIA2_interruptChngNtfy VIAorSCCinterruptChngNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_iA7_unknown,");
WriteDestFileLn(
"#define VIA2_iA7 (Wires[Wire_VIA2_iA7_unknown])");
WriteDestFileLn(
"#define VIA2_iA7_ChangeNtfy Addr32_ChangeNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_iA6_unknown,");
WriteDestFileLn(
"#define VIA2_iA6 (Wires[Wire_VIA2_iA6_unknown])");
WriteDestFileLn(
"#define VIA2_iA6_ChangeNtfy Addr32_ChangeNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_iB7_unknown,");
WriteDestFileLn(
"#define VIA2_iB7 (Wires[Wire_VIA2_iB7_unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_iCB2_unknown,");
WriteDestFileLn(
"#define VIA2_iCB2 (Wires[Wire_VIA2_iCB2_unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_iB2_PowerOff,");
WriteDestFileLn(
"#define VIA2_iB2 (Wires[Wire_VIA2_iB2_PowerOff])");
WriteDestFileLn(
"#define VIA2_iB2_ChangeNtfy PowerOff_ChangeNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA2_iB3_Addr32,");
WriteDestFileLn(
"#define VIA2_iB3 (Wires[Wire_VIA2_iB3_Addr32])");
WriteDestFileLn(
"#define Addr32 (Wires[Wire_VIA2_iB3_Addr32])");
WriteDestFileLn(
"#define VIA2_iB3_ChangeNtfy Addr32_ChangeNtfy");
}
if (cur_mdl <= gbk_mdl_Classic) {
WriteOneWire("VIA1_iA0", "SoundVolb0");
WriteOneWire("VIA1_iA1", "SoundVolb1");
WriteOneWire("VIA1_iA2", "SoundVolb2");
}
if ((cur_mdl <= gbk_mdl_Plus) || cur_mIIorIIX)
{
WriteOneWire("VIA1_iA4", "MemOverlay");
WriteDestFileLn(
"#define VIA1_iA4_ChangeNtfy MemOverlay_ChangeNtfy");
} else {
if (cur_mdl <= gbk_mdl_Classic) {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iA4_DriveSel,");
WriteDestFileLn(
"#define VIA1_iA4 (Wires[Wire_VIA1_iA4_DriveSel])");
}
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_MemOverlay,");
WriteDestFileLn("#define MemOverlay (Wires[Wire_MemOverlay])");
}
if (cur_mdl <= gbk_mdl_Classic) {
WriteOneWire("VIA1_iA6", "SCRNvPage2");
}
if (gbk_mdl_PB100 == cur_mdl) {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_SCCwaitrq,");
WriteDestFileLn("#define SCCwaitrq (Wires[Wire_SCCwaitrq])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iA0_PmuBus0,");
WriteDestFileLn("\tWire_VIA1_iA1_PmuBus1,");
WriteDestFileLn("\tWire_VIA1_iA2_PmuBus2,");
WriteDestFileLn("\tWire_VIA1_iA3_PmuBus3,");
WriteDestFileLn("\tWire_VIA1_iA4_PmuBus4,");
WriteDestFileLn("\tWire_VIA1_iA5_PmuBus5,");
WriteDestFileLn("\tWire_VIA1_iA6_PmuBus6,");
WriteDestFileLn("\tWire_VIA1_iA7_PmuBus7,");
WriteBlankLineToDestFile();
WriteDestFileLn(
"#define VIA1_iA0 (Wires[Wire_VIA1_iA0_PmuBus0])");
WriteDestFileLn(
"#define VIA1_iA1 (Wires[Wire_VIA1_iA1_PmuBus1])");
WriteDestFileLn(
"#define VIA1_iA2 (Wires[Wire_VIA1_iA2_PmuBus2])");
WriteDestFileLn(
"#define VIA1_iA3 (Wires[Wire_VIA1_iA3_PmuBus3])");
WriteDestFileLn(
"#define VIA1_iA4 (Wires[Wire_VIA1_iA4_PmuBus4])");
WriteDestFileLn(
"#define VIA1_iA5 (Wires[Wire_VIA1_iA5_PmuBus5])");
WriteDestFileLn(
"#define VIA1_iA6 (Wires[Wire_VIA1_iA6_PmuBus6])");
WriteDestFileLn(
"#define VIA1_iA7 (Wires[Wire_VIA1_iA7_PmuBus7])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB0_PmuToReady,");
WriteDestFileLn(
"#define VIA1_iB0 (Wires[Wire_VIA1_iB0_PmuToReady])");
WriteDestFileLn(
"#define PmuToReady (Wires[Wire_VIA1_iB0_PmuToReady])");
WriteDestFileLn(
"#define VIA1_iB0_ChangeNtfy PmuToReady_ChangeNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB1_PmuFromReady,");
WriteDestFileLn(
"#define VIA1_iB1 (Wires[Wire_VIA1_iB1_PmuFromReady])");
WriteDestFileLn(
"#define PmuFromReady (Wires[Wire_VIA1_iB1_PmuFromReady])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB2_Unknown,");
WriteDestFileLn(
"#define VIA1_iB2 (Wires[Wire_VIA1_iB2_Unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB3_Unknown,");
WriteDestFileLn(
"#define VIA1_iB3 (Wires[Wire_VIA1_iB3_Unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB4_Unknown,");
WriteDestFileLn(
"#define VIA1_iB4 (Wires[Wire_VIA1_iB4_Unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB5_Unknown,");
WriteDestFileLn(
"#define VIA1_iB5 (Wires[Wire_VIA1_iB5_Unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB6_Unknown,");
WriteDestFileLn(
"#define VIA1_iB6 (Wires[Wire_VIA1_iB6_Unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB7_Unknown,");
WriteDestFileLn(
"#define VIA1_iB7 (Wires[Wire_VIA1_iB7_Unknown])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iCB2_Unknown,");
WriteDestFileLn(
"#define VIA1_iCB2 (Wires[Wire_VIA1_iCB2_Unknown])");
} else {
WriteOneWire("VIA1_iA5", "IWMvSel");
WriteOneWire("VIA1_iA7", "SCCwaitrq");
WriteOneWire("VIA1_iB0", "RTCdataLine");
WriteDestFileLn(
"#define VIA1_iB0_ChangeNtfy RTCdataLine_ChangeNtfy");
WriteOneWire("VIA1_iB1", "RTCclock");
WriteDestFileLn(
"#define VIA1_iB1_ChangeNtfy RTCclock_ChangeNtfy");
WriteOneWire("VIA1_iB2", "RTCunEnabled");
WriteDestFileLn(
"#define VIA1_iB2_ChangeNtfy RTCunEnabled_ChangeNtfy");
if (cur_mdl <= gbk_mdl_Plus) {
WriteOneWire("VIA1_iA3", "SoundBuffer");
WriteOneWire("VIA1_iB3", "MouseBtnUp");
WriteOneWire("VIA1_iB4", "MouseX2");
WriteOneWire("VIA1_iB5", "MouseY2");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iCB2_KybdDat,");
WriteDestFileLn(
"#define VIA1_iCB2 (Wires[Wire_VIA1_iCB2_KybdDat])");
WriteDestFileLn(
"#define VIA1_iCB2_ChangeNtfy Kybd_DataLineChngNtfy");
} else {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iA3_SCCvSync,");
WriteDestFileLn(
"#define VIA1_iA3 (Wires[Wire_VIA1_iA3_SCCvSync])");
WriteOneWire("VIA1_iB3", "ADB_Int");
WriteOneWire("VIA1_iB4", "ADB_st0");
WriteDestFileLn(
"#define VIA1_iB4_ChangeNtfy ADBstate_ChangeNtfy");
WriteOneWire("VIA1_iB5", "ADB_st1");
WriteDestFileLn(
"#define VIA1_iB5_ChangeNtfy ADBstate_ChangeNtfy");
WriteOneWire("VIA1_iCB2", "ADB_Data");
WriteDestFileLn(
"#define VIA1_iCB2_ChangeNtfy ADB_DataLineChngNtfy");
}
}
if (cur_mdl <= gbk_mdl_Plus) {
WriteOneWire("VIA1_iB6", "SCRNbeamInVid");
} else if (cur_mdl <= gbk_mdl_Classic) {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_iB6_SCSIintenable,");
WriteDestFileLn(
"#define VIA1_iB6 (Wires[Wire_VIA1_iB6_SCSIintenable])");
}
if (cur_mdl <= gbk_mdl_Classic) {
WriteOneWire("VIA1_iB7", "SoundDisable");
}
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VIA1_InterruptRequest,");
WriteDestFileLn(
"#define VIA1_InterruptRequest"
" (Wires[Wire_VIA1_InterruptRequest])");
WriteDestFileLn(
"#define VIA1_interruptChngNtfy VIAorSCCinterruptChngNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_SCCInterruptRequest,");
WriteDestFileLn(
"#define SCCInterruptRequest"
" (Wires[Wire_SCCInterruptRequest])");
WriteDestFileLn(
"#define SCCinterruptChngNtfy VIAorSCCinterruptChngNtfy");
if (cur_mdl <= gbk_mdl_Plus) {
} else {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_ADBMouseDisabled,");
WriteDestFileLn(
"#define ADBMouseDisabled (Wires[Wire_ADBMouseDisabled])");
}
if (cur_mIIorIIX) {
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VBLinterrupt,");
WriteDestFileLn(
"#define Vid_VBLinterrupt (Wires[Wire_VBLinterrupt])");
WriteDestFileLn("#define VIA2_iA0 (Wires[Wire_VBLinterrupt])");
WriteBlankLineToDestFile();
WriteDestFileLn("\tWire_VBLintunenbl,");
WriteDestFileLn(
"#define Vid_VBLintunenbl (Wires[Wire_VBLintunenbl])");
}
WriteBlankLineToDestFile();
WriteDestFileLn("\tkNumWires");
WriteDestFileLn("};");
}
LOCALPROC WriteConfigureVIA1(void)
{
WriteDestFileLn("/* VIA configuration */");
if (gbk_mdl_Classic == cur_mdl) {
WriteDestFileLn("#define VIA1_ORA_FloatVal 0xF7");
} else if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA1_ORA_FloatVal 0xBF");
WriteDestFileLn(
"\t/* bit 6 used to check version of hardware */");
} else {
WriteDestFileLn("#define VIA1_ORA_FloatVal 0xFF");
}
WriteDestFileLn("#define VIA1_ORB_FloatVal 0xFF");
if (cur_mdl <= gbk_mdl_Classic) {
WriteDestFileLn("#define VIA1_ORA_CanIn 0x80");
WriteDestFileLn("#define VIA1_ORA_CanOut 0x7F");
} else if (gbk_mdl_PB100 == cur_mdl) {
WriteDestFileLn("#define VIA1_ORA_CanIn 0xFF");
WriteDestFileLn("#define VIA1_ORA_CanOut 0xFF");
} else if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA1_ORA_CanIn 0x80");
WriteDestFileLn("#define VIA1_ORA_CanOut 0x3F");
} else {
WriteDestFileLn("#define VIA1_ORA_CanIn 0x00");
WriteDestFileLn("#define VIA1_ORA_CanOut 0x00");
}
if (cur_mdl <= gbk_mdl_Plus) {
WriteDestFileLn("#define VIA1_ORB_CanIn 0x79");
WriteDestFileLn("#define VIA1_ORB_CanOut 0x87");
} else if (cur_mdl <= gbk_mdl_Classic) {
WriteDestFileLn("#define VIA1_ORB_CanIn 0x09");
WriteDestFileLn("#define VIA1_ORB_CanOut 0xF7");
} else if (gbk_mdl_PB100 == cur_mdl) {
WriteDestFileLn("#define VIA1_ORB_CanIn 0x02");
WriteDestFileLn("#define VIA1_ORB_CanOut 0xFD");
} else if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA1_ORB_CanIn 0x09");
WriteDestFileLn("#define VIA1_ORB_CanOut 0xB7");
} else {
WriteDestFileLn("#define VIA1_ORB_CanIn 0x00");
WriteDestFileLn("#define VIA1_ORB_CanOut 0x00");
}
if (cur_mdl <= gbk_mdl_Plus) {
WriteDestFileLn("#define VIA1_IER_Never0 (1 << 1)");
WriteDestFileLn(
"#define VIA1_IER_Never1 ((1 << 3) | (1 << 4))");
} else if (cur_mdl <= gbk_mdl_Classic) {
WriteDestFileLn("#define VIA1_IER_Never0 0x00");
WriteDestFileLn(
"#define VIA1_IER_Never1 ((1 << 3) | (1 << 4))");
} else if (gbk_mdl_PB100 == cur_mdl) {
WriteDestFileLn("#define VIA1_IER_Never0 0x00");
WriteDestFileLn("#define VIA1_IER_Never1 0x0C");
} else if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA1_IER_Never0 0x00");
WriteDestFileLn("#define VIA1_IER_Never1 0x58");
} else {
WriteDestFileLn("#define VIA1_IER_Never0 0xFF");
WriteDestFileLn("#define VIA1_IER_Never1 0xFF");
}
if (gbk_mdl_PB100 == cur_mdl) {
WriteDestFileLn("#define VIA1_CB2modesAllowed 0x03");
WriteDestFileLn("#define VIA1_CA2modesAllowed 0x03");
} else {
WriteDestFileLn("#define VIA1_CB2modesAllowed 0x01");
WriteDestFileLn("#define VIA1_CA2modesAllowed 0x01");
}
}
LOCALPROC WriteConfigureVIA2(void)
{
WriteDestFileLn("/* VIA 2 configuration */");
WriteDestFileLn("#define VIA2_ORA_FloatVal 0xFF");
WriteDestFileLn("#define VIA2_ORB_FloatVal 0xFF");
if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA2_ORA_CanIn 0x01");
WriteDestFileLn("#define VIA2_ORA_CanOut 0xC0");
} else {
WriteDestFileLn("#define VIA2_ORA_CanIn 0x00");
WriteDestFileLn("#define VIA2_ORA_CanOut 0x00");
}
if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA2_ORB_CanIn 0x00");
WriteDestFileLn("#define VIA2_ORB_CanOut 0x8C");
} else {
WriteDestFileLn("#define VIA2_ORB_CanIn 0x00");
WriteDestFileLn("#define VIA2_ORB_CanOut 0x00");
}
if (cur_mIIorIIX) {
WriteDestFileLn("#define VIA2_IER_Never0 0x00");
WriteDestFileLn("#define VIA2_IER_Never1 0xED");
} else {
WriteDestFileLn("#define VIA2_IER_Never0 0xFF");
WriteDestFileLn("#define VIA2_IER_Never1 0xFF");
}
WriteDestFileLn("#define VIA2_CB2modesAllowed 0x01");
WriteDestFileLn("#define VIA2_CA2modesAllowed 0x01");
}
LOCALPROC WriteAppSTRCONSTcontents(void)
{
char *s;
switch (gbo_lang) {
case gbk_lang_eng:
s = "ENG";
break;
case gbk_lang_fre:
s = "FRE";
break;
case gbk_lang_ita:
s = "ITA";
break;
case gbk_lang_ger:
s = "GER";
break;
case gbk_lang_dut:
s = "DUT";
break;
case gbk_lang_spa:
s = "SPA";
break;
case gbk_lang_pol:
s = "POL";
break;
case gbk_lang_ptb:
s = "PTB";
break;
case gbk_lang_cat:
s = "CAT";
break;
case gbk_lang_cze:
s = "CZE";
break;
case gbk_lang_srl:
s = "SRL";
break;
default:
s = "???";
break;
}
WriteBgnDestFileLn();
WriteCStrToDestFile("#include ");
WriteQuoteToDestFile();
WriteCStrToDestFile("STRCN");
WriteCStrToDestFile(s);
WriteCStrToDestFile(".h");
WriteQuoteToDestFile();
WriteEndDestFileLn();
}
LOCALPROC WriteAppSOUNDGLUcontents(void)
{
char *s;
switch (gbo_sndapi) {
case gbk_sndapi_alsa:
s = "ALSA";
break;
case gbk_sndapi_ddsp:
s = "DDSP";
break;
default:
s = "???";
break;
}
WriteBgnDestFileLn();
WriteCStrToDestFile("#include ");
WriteQuoteToDestFile();
WriteCStrToDestFile("SGLU");
WriteCStrToDestFile(s);
WriteCStrToDestFile(".h");
WriteQuoteToDestFile();
WriteEndDestFileLn();
}
LOCALPROC WriteAppEMCONFIGcontents(void)
{
WriteDestFileLn("/*");
++DestFileIndent;
WriteDestFileLn(
"Configuration options used by platform independent code.");
WriteConfigurationWarning();
--DestFileIndent;
WriteDestFileLn("*/");
WriteBlankLineToDestFile();
WriteCompCondBool("EmClassicKbrd", EmClassicKbrd);
WriteCompCondBool("EmADB", EmADB);
WriteCompCondBool("EmRTC", EmRTC);
WriteCompCondBool("EmPMU", EmPMU);
WriteCompCondBool("EmVIA2", EmVIA2);
WriteCompCondBool("Use68020", em_cpu_vers >= 2);
WriteCompCondBool("EmFPU",
cur_mIIorIIX);
WriteCompCondBool("EmMMU", falseblnr);
WriteCompCondBool("EmASC", EmASC);
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define CurEmMd kEmMd_");
WriteCStrToDestFile(GetModelName(cur_mdl));
WriteEndDestFileLn();
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kMyClockMult ");
if (cur_mIIorIIX) {
WriteCStrToDestFile("2");
} else {
WriteCStrToDestFile("1");
}
WriteEndDestFileLn();
WriteBlankLineToDestFile();
WriteCompCondBool("WantCycByPriOp", timingacc != 0);
WriteCompCondBool("WantCloserCyc", timingacc >= 2);
if (gbk_ide_mvc == cur_ide) {
if (gbk_cpufam_x64 == gbo_cpufam) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define r_pc_p \"r15\"");
WriteDestFileLn("#define r_MaxCyclesToGo \"r14\"");
WriteDestFileLn("#define r_pc_pHi \"r13\"");
}
if (gbk_cpufam_ppc == gbo_cpufam) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define r_regs \"r14\"");
WriteDestFileLn("#define r_pc_p \"r15\"");
WriteDestFileLn("#define r_MaxCyclesToGo \"r16\"");
WriteDestFileLn("#define r_pc_pHi \"r17\"");
}
if (gbk_cpufam_arm == gbo_cpufam) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define r_regs \"r4\"");
WriteDestFileLn("#define r_pc_p \"r5\"");
if (gbk_targ_wcar != cur_targ) {
WriteDestFileLn("#define r_MaxCyclesToGo \"r6\"");
WriteDestFileLn("#define r_pc_pHi \"r7\"");
}
}
}
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kRAMa_Size ");
WriteCStrToDestFile("0x");
WriteHexLongToOutput(1 << RAMa_Size);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kRAMb_Size ");
if (0 == RAMb_Size) {
WriteCStrToDestFile("0");
} else {
WriteCStrToDestFile("0x");
WriteHexLongToOutput(1 << RAMb_Size);
}
WriteEndDestFileLn();
WriteBlankLineToDestFile();
if (NeedScrnHack) {
WriteCompCondBool("UseLargeScreenHack", NeedScrnHack);
}
WriteCompCondBool("IncludeVidMem", NeedVidMem);
if (NeedVidMem) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kVidMemRAM_Size ");
WriteCStrToDestFile("0x");
WriteHexLongToOutput(VidMemSize);
WriteEndDestFileLn();
}
WriteBlankLineToDestFile();
WriteCompCondBool("EmVidCard", EmVidCard);
if (EmVidCard) {
WriteDestFileLn("#define kVidROM_Size 0x000800");
}
WriteBlankLineToDestFile();
if (cur_mIIorIIX) {
WriteDestFileLn("#define MaxATTListN 20");
} else {
WriteDestFileLn("#define MaxATTListN 16");
}
WriteCompCondBool("IncludeExtnPbufs",
(! WantMinExtn) && (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam));
WriteCompCondBool("IncludeExtnHostTextClipExchange",
(! WantMinExtn) && (gbk_apifam_gtk != gbo_apifam)
&& (gbk_apifam_sdl != gbo_apifam)
&& (gbk_apifam_nds != gbo_apifam));
WriteBlankLineToDestFile();
WriteCompCondBool("Sony_SupportDC42", SonySupportDC42);
WriteCompCondBool("Sony_SupportTags", SonySupportTags);
WriteCompCondBool("Sony_WantChecksumsUpdated",
SonyWantChecksumsUpdated);
WriteDestFileLn("#define Sony_VerifyChecksums 0");
WriteBgnDestFileLn();
WriteCStrToDestFile("#define CaretBlinkTime 0x");
WriteHexByteToOutput(cur_CaretBlinkTime);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define SpeakerVol 0x");
WriteHexByteToOutput(cur_SpeakerVol);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define DoubleClickTime 0x");
WriteHexByteToOutput(cur_DoubleClickTime);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define MenuBlink 0x");
WriteHexByteToOutput(cur_MenuBlink);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define AutoKeyThresh 0x");
WriteHexByteToOutput(cur_AutoKeyThresh);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define AutoKeyRate 0x");
WriteHexByteToOutput(cur_AutoKeyRate);
WriteEndDestFileLn();
if (cur_mIIorIIX) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define pr_HilColRed 0x");
WriteHexWordToOutput(cur_HilColRed);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define pr_HilColGreen 0x");
WriteHexWordToOutput(cur_HilColGreen);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define pr_HilColBlue 0x");
WriteHexWordToOutput(cur_HilColBlue);
WriteEndDestFileLn();
}
if (! WantAutoLocation) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define CurMacLatitude 0x");
WriteHexLongToOutput(cur_InitLatitude);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("#define CurMacLongitude 0x");
WriteHexLongToOutput(cur_InitLongitude);
WriteEndDestFileLn();
}
if (! WantAutoTimeZone) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define CurMacDelta 0x");
WriteHexLongToOutput(((WantTzDST ? 1UL : 0) << 31)
| (((ui5r)cur_TzDeltS) & 0x00FFFFFF));
WriteEndDestFileLn();
}
WriteBlankLineToDestFile();
WriteBlankLineToDestFile();
WriteConfigureWires();
WriteBlankLineToDestFile();
WriteBlankLineToDestFile();
WriteConfigureVIA1();
if (EmVIA2) {
WriteBlankLineToDestFile();
WriteConfigureVIA2();
}
WriteBlankLineToDestFile();
if (cur_mdl <= gbk_mdl_Plus) {
WriteDestFileLn("#define Mouse_Enabled SCC_InterruptsEnabled");
} else {
WriteDestFileLn("#define Mouse_Enabled() (! ADBMouseDisabled)");
}
WriteBlankLineToDestFile();
WriteDestFileLn(
"#define VIA1_iCA1_PulseNtfy VIA1_iCA1_Sixtieth_PulseNtfy");
WriteDestFileLn(
"#define Sixtieth_PulseNtfy VIA1_iCA1_Sixtieth_PulseNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn(
"#define VIA1_iCA2_PulseNtfy"
" VIA1_iCA2_RTC_OneSecond_PulseNtfy");
WriteDestFileLn(
"#define RTC_OneSecond_PulseNtfy"
" VIA1_iCA2_RTC_OneSecond_PulseNtfy");
if (cur_mIIorIIX) {
WriteBlankLineToDestFile();
WriteDestFileLn(
"#define VIA2_iCA1_PulseNtfy"
" VIA2_iCA1_Vid_VBLinterrupt_PulseNtfy");
WriteDestFileLn(
"#define Vid_VBLinterrupt_PulseNotify"
" VIA2_iCA1_Vid_VBLinterrupt_PulseNtfy");
WriteBlankLineToDestFile();
WriteDestFileLn(
"#define VIA2_iCB1_PulseNtfy"
" VIA2_iCB1_ASC_interrupt_PulseNtfy");
WriteDestFileLn(
"#define ASC_interrupt_PulseNtfy"
" VIA2_iCB1_ASC_interrupt_PulseNtfy");
}
WriteBlankLineToDestFile();
WriteDestFileLn("#define GetSoundInvertTime VIA1_GetT1InvertTime");
if (EmClassicKbrd) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define KYBD_ShiftInData VIA1_ShiftOutData");
WriteDestFileLn("#define KYBD_ShiftOutData VIA1_ShiftInData");
}
if (EmADB) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define ADB_ShiftInData VIA1_ShiftOutData");
WriteDestFileLn("#define ADB_ShiftOutData VIA1_ShiftInData");
}
if (! WantDisableRomCheck) {
WriteCompCondBool("DisableRomCheck", WantDisableRomCheck);
}
if (! WantDisableRamTest) {
WriteCompCondBool("DisableRamTest", WantDisableRamTest);
}
if (gbk_AHM_none != cur_AltHappyMac) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define CurAltHappyMac kAHM_");
WriteCStrToDestFile(GetAltHappyMacName(cur_AltHappyMac));
WriteEndDestFileLn();
}
WriteBlankLineToDestFile();
if (cur_mIIorIIX) {
WriteDestFileLn("#define kExtn_Block_Base 0x50F0C000");
} else {
WriteDestFileLn("#define kExtn_Block_Base 0x00F40000");
}
WriteDestFileLn("#define kExtn_ln2Spc 5");
WriteBlankLineToDestFile();
if (gbk_mdl_PB100 == cur_mdl) {
WriteDestFileLn("#define kROM_Base 0x00900000");
} else if (cur_mIIorIIX) {
WriteDestFileLn("#define kROM_Base 0x00800000");
} else {
WriteDestFileLn("#define kROM_Base 0x00400000");
}
WriteDestFileLn("#define kROM_ln2Spc 20");
WriteBlankLineToDestFile();
WriteCompCondBool("WantDisasm", WantDisasm);
WriteCompCondBool("ExtraAbnormalReports", falseblnr);
}
LOCALPROC WriteAppSpecificConfigFiles(void)
{
WriteADstFile1("my_config_d",
"CNFGGLOB", ".h", "C Configuration file",
WriteAppCNFGGLOBContents);
WriteADstFile1("my_config_d",
"CNFGRAPI", ".h", "C API Configuration file",
WriteAppCNFGRAPIContents);
WriteADstFile1("my_config_d",
"EMCONFIG", ".h", "C Platform Independent Configuration file",
WriteAppEMCONFIGcontents);
WriteADstFile1("my_config_d",
"STRCONST", ".h", "Language Configuration file",
WriteAppSTRCONSTcontents);
if (gbk_sndapi_none != gbo_sndapi) {
WriteADstFile1("my_config_d",
"SOUNDGLU", ".h", "Sound Configuration file",
WriteAppSOUNDGLUcontents);
}
}

277
setup/STRUTILS.i Normal file
View File

@ -0,0 +1,277 @@
/*
STRUTILS.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
STRing UTILitieS
Some very basic string macros and routines.
*/
#define PStrLength(s) (*(s))
#define PStrToMyCharPtr(s) ((s) + 1)
#define PStrMaxLength 255
#define SizeOfListMyChar(n) (n)
#define PStrToPtr(s) ((MyPtr)PStrToMyCharPtr(s))
#define PStrToSize(s) (SizeOfListMyChar(PStrLength(s)))
#define PStrToTotSize(s) (SizeOfListMyChar(PStrLength(s) + 1))
/* + 1 for length byte */
#define PStrClear(s) PStrLength(s) = 0
GLOBALPROC PStrCopy(ps3p r, ps3p s)
{
MyMoveBytes((MyPtr)s, (MyPtr)r, PStrToTotSize(s));
}
GLOBALPROC PStrApndChar(ps3p s, MyCharR x)
{
si4r n = s[0] + 1;
if (n <= PStrMaxLength) {
s[0] = (MyCharR)n;
s[n] = x;
}
}
GLOBALPROC PStrPrependChar(ps3p s, MyCharR x)
{
ps3p p = s;
si4r n0 = *p++;
si4r n = n0 + 1;
if (n <= PStrMaxLength) {
MyMoveBytes((MyPtr)p, (MyPtr)(p + 1), SizeOfListMyChar(n0));
s[1] = x;
s[0] = (MyCharR)n;
}
}
GLOBALPROC PStrAppend(ps3p r, ps3p s)
{
ps3p p = s;
ps3p q = r;
si4r m = *p++;
si4r n = *q++;
if (n + m > PStrMaxLength) {
m = PStrMaxLength - n;
}
*r = (MyCharR)(n + m);
MyMoveBytes((MyPtr)p, (MyPtr)(q + n), m);
}
GLOBALFUNC uimr CStrLength(char *s)
{
char *p = s;
while (0 != *p++) {
}
return p - s - 1;
}
GLOBALPROC PStrFromCStr(ps3p r, /* CONST */ char *s)
{
uimr L;
L = CStrLength(s);
if (L > PStrMaxLength) {
L = PStrMaxLength;
}
*r++ = (MyCharR)L;
MyMoveBytes((MyPtr)s, (MyPtr)r, L);
}
GLOBALPROC PStrFromChar(ps3p r, char x)
{
r[0] = 1;
r[1] = x;
}
GLOBALPROC PStrFromPtr(MyPtr p, uimr L, ps3p s)
{
uimr tL;
if (L <= PStrMaxLength) {
tL = L;
} else {
tL = PStrMaxLength;
}
s[0] = (MyCharR)tL;
MyMoveBytes(p, PStrToPtr(s), SizeOfListMyChar(tL));
}
GLOBALPROC PStrApndCStr(ps3p r, /* CONST */ char *s)
{
MyPStr t;
PStrFromCStr(t, s);
PStrAppend(r, t);
}
GLOBALFUNC blnr PStrEq(ps3p s1, ps3p s2)
{
register si4r i;
MyCharPtr p1 = s1;
MyCharPtr p2 = s2;
MyCharR n = *p1++;
MyCharR m = *p2++;
if (n != m) {
return falseblnr;
} else {
for (i = n; --i >= 0; ) {
if (*p1++ != *p2++) {
return falseblnr;
}
}
return trueblnr;
}
}
GLOBALFUNC blnr CStrEq(char *s1, char *s2)
{
MyCharR c1;
while ((c1 = *s1++) == *s2++) {
if (0 == c1) {
return trueblnr;
}
}
return falseblnr;
}
GLOBALPROC CStrFromPtr(MyPtr p, uimr L, char *s)
{
MyMoveBytes(p, (MyPtr)s, SizeOfListMyChar(L));
s[L] = (MyCharR)0;
}
GLOBALPROC CStrFromPStr(ps3p x, char *s)
{
CStrFromPtr(PStrToMyCharPtr(x), PStrLength(x), s);
}
GLOBALPROC CStrCopy(char *r, char *s)
{
while (0 != (*r++ = *s++)) {
}
}
LOCALPROC ReversePStr(ps3p s)
{
MyCharR c;
MyCharR *p1 = PStrToMyCharPtr(s);
MyCharR *p2 = p1 + PStrLength(s) - 1;
while (p1 < p2) {
c = *p1;
*p1 = *p2;
*p2 = c;
++p1;
--p2;
}
}
LOCALPROC PStrFromUimr(uimr v, ps3p s)
{
MyCharR *p = PStrToMyCharPtr(s);
uimr newv;
do {
newv = v / (uimr)10;
*p++ = '0' + (v - newv * 10);
v = newv;
} while (v != 0);
s[0] = p - PStrToMyCharPtr(s);
ReversePStr(s);
}
LOCALFUNC uimr MyCharPtrToUimr(MyCharPtr p, MyCharR n)
{
register si4r i;
uimr v = 0;
for (i = n; --i >= 0; ) {
v = (v * 10) + (*p++ - '0');
}
return v;
}
LOCALFUNC uimr PStrToUimr(ps3p s)
{
MyCharPtr p = s;
MyCharR n = *p++;
return MyCharPtrToUimr(p, n);
}
LOCALFUNC simr PStrToSimr(ps3p s)
{
simr v;
MyCharPtr p = s;
MyCharR n = *p++;
if (0 == n) {
v = 0;
} else if ('-' == p[0]) {
v = - MyCharPtrToUimr(++p, --n);
} else {
v = MyCharPtrToUimr(p, n);
}
return v;
}
LOCALPROC PStrFromSimr(simr v, ps3p s)
{
if (v < 0) {
PStrFromUimr(- v, s);
PStrPrependChar(s, '-');
} else {
PStrFromUimr(v, s);
}
}
LOCALPROC PStrFromNUimr(uimr v, ui3r n, ps3p s)
{
uimr i;
uimr newv;
MyCharR *p = PStrToMyCharPtr(s);
s[0] = n;
for (i = n + 1; 0 != --i; ) {
newv = v / (uimr)10;
*p++ = '0' + (v - newv * 10);
v = newv;
}
ReversePStr(s);
}
GLOBALPROC PStrApndNUimr(ps3p r, uimr v, ui3r n)
{
MyPStr t;
PStrFromNUimr(v, n, t);
PStrAppend(r, t);
}
#define Have_STRUTILS 1

494
setup/USFILDEF.i Normal file
View File

@ -0,0 +1,494 @@
/*
USFILDEF.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
USe program SPecific FILe DEFinitions
*/
LOCALPROC NullProc(void)
{
}
LOCALVAR unsigned int FileCounter;
struct DoSrcFile_r
{
MyPtr SavepDt;
char *s;
long Flgm;
int DepDir;
tDoDependsForC depends;
MyProc p;
};
typedef struct DoSrcFile_r DoSrcFile_r;
#define DoSrcFile_gd() ((DoSrcFile_r *)(pDt))
LOCALPROC DoASrcFileWithSetupProc0(
char *s, int DepDir, long Flgm, tDoDependsForC depends)
{
DoSrcFile_gd()->s = s;
DoSrcFile_gd()->Flgm = Flgm;
DoSrcFile_gd()->DepDir = DepDir;
DoSrcFile_gd()->depends = depends;
DoSrcFile_gd()->p();
++FileCounter;
}
LOCALPROC DoASrcFileWithSetupProc(
char *s, int DepDir, long Flgm, tDoDependsForC depends)
{
if (0 == (Flgm & kCSrcFlgmNoSource))
if (0 == (Flgm & kCSrcFlgmSkip))
{
DoASrcFileWithSetupProc0(s, DepDir, Flgm, depends);
}
}
LOCALPROC DoAllSrcFilesWithSetup(MyProc p)
{
DoSrcFile_r r;
r.SavepDt = pDt;
r.p = p;
pDt = (MyPtr)&r;
FileCounter = 0;
DoAllSrcFiles(DoASrcFileWithSetupProc);
pDt = r.SavepDt;
}
LOCALPROC DoAllSrcFilesSortWithSetup1(
char *s, int DepDir, long Flgm, tDoDependsForC depends)
{
if (0 == (Flgm & kCSrcFlgmNoSource))
if (0 == (Flgm & kCSrcFlgmSkip))
{
if (0 != (Flgm & kCSrcFlgmSortFirst)) {
DoASrcFileWithSetupProc0(s, DepDir, Flgm, depends);
} else {
++FileCounter;
}
}
}
LOCALPROC DoAllSrcFilesSortWithSetup2(
char *s, int DepDir, long Flgm, tDoDependsForC depends)
{
if (0 == (Flgm & kCSrcFlgmNoSource))
if (0 == (Flgm & kCSrcFlgmSkip))
{
if (0 == (Flgm & kCSrcFlgmSortFirst)) {
DoASrcFileWithSetupProc0(s, DepDir, Flgm, depends);
} else {
++FileCounter;
}
}
}
LOCALPROC DoAllSrcFilesSortWithSetup(MyProc p)
{
DoSrcFile_r r;
r.SavepDt = pDt;
r.p = p;
pDt = (MyPtr)&r;
FileCounter = 0;
DoAllSrcFiles(DoAllSrcFilesSortWithSetup1);
FileCounter = 0;
DoAllSrcFiles(DoAllSrcFilesSortWithSetup2);
pDt = r.SavepDt;
}
LOCALFUNC char * GetSrcFileFileXtns(void)
{
char *s;
blnr UseObjc = ((DoSrcFile_gd()->Flgm & kCSrcFlgmOjbc) != 0);
if (UseObjc) {
s = ".m";
} else {
s = ".c";
}
return s;
}
LOCALPROC WriteSrcFileFileName(void)
{
WriteCStrToDestFile(DoSrcFile_gd()->s);
WriteCStrToDestFile(GetSrcFileFileXtns());
}
LOCALPROC WriteSrcFileFilePath(void)
{
WriteFileInDirToDestFile0(Write_src_d_ToDestFile,
WriteSrcFileFileName);
}
LOCALPROC WriteSrcFileHeaderName(void)
{
WriteCStrToDestFile(DoSrcFile_gd()->s);
WriteCStrToDestFile(".h");
}
LOCALPROC WriteSrcFileHeaderPath(void)
{
WriteFileInDirToDestFile0(Write_src_d_ToDestFile,
WriteSrcFileHeaderName);
}
LOCALPROC WriteSrcFileObjName(void)
{
WriteCStrToDestFile(DoSrcFile_gd()->s);
switch (cur_ide) {
case gbk_ide_msv:
case gbk_ide_dmc:
case gbk_ide_plc:
WriteCStrToDestFile(".obj");
break;
default:
WriteCStrToDestFile(".o");
break;
}
}
LOCALPROC WriteSrcFileObjPath(void)
{
WriteFileInDirToDestFile0(Write_obj_d_ToDestFile,
WriteSrcFileObjName);
}
LOCALPROC DoAllExtraHeaders2WithSetupProc(
char *s, int DepDir, long Flgm, tDoDependsForC depends)
{
if (0 == (Flgm & kCSrcFlgmNoHeader))
if (0 != (Flgm & kCSrcFlgmNoSource))
if (0 == (Flgm & kCSrcFlgmSkip))
{
DoASrcFileWithSetupProc0(s, DepDir, Flgm, depends);
}
}
LOCALPROC DoAllExtraHeaders2WithSetup(MyProc p)
{
DoSrcFile_r r;
r.SavepDt = pDt;
r.p = p;
pDt = (MyPtr)&r;
FileCounter = 0;
DoAllSrcFiles(DoAllExtraHeaders2WithSetupProc);
pDt = r.SavepDt;
}
LOCALPROC WriteExtraHeaderFileName(void)
{
WriteCStrToDestFile(DoSrcFile_gd()->s);
WriteCStrToDestFile(".h");
}
LOCALPROC WriteExtraHeaderFilePath(void)
{
WriteFileInDirToDestFile0(
((kDepDirCnfg == DoSrcFile_gd()->DepDir)
? Write_cfg_d_ToDestFile
: Write_src_d_ToDestFile),
WriteExtraHeaderFileName);
}
LOCALVAR unsigned int DocTypeCounter;
struct DoDocType_r
{
MyPtr SavepDt;
char *ShortName;
char *MacType;
char *LongName;
tWriteExtensionList WriteExtensionList;
MyProc p;
};
typedef struct DoDocType_r DoDocType_r;
#define DoDocType_gd() ((DoDocType_r *)(pDt))
LOCALPROC DoAllDocTypesWithSetupProc(char *ShortName,
char *MacType,
char *LongName,
tWriteExtensionList WriteExtensionList)
{
DoDocType_gd()->ShortName = ShortName;
DoDocType_gd()->MacType = MacType;
DoDocType_gd()->LongName = LongName;
DoDocType_gd()->WriteExtensionList = WriteExtensionList;
DoDocType_gd()->p();
++DocTypeCounter;
}
LOCALPROC DoAppAndAllDocTypes0(tWriteOneDocType p)
{
p("APP", "APPL", "Application", NULL);
DoAllDocTypes(p);
}
LOCALPROC DoAppAndAllDocTypes(tWriteOneDocType p)
{
p("APP", "APPL", "Application", NULL);
if (WantIconMaster) {
DoAllDocTypes(p);
}
}
LOCALPROC DoAllDocTypesWithSetup(MyProc p)
{
DoDocType_r r;
r.SavepDt = pDt;
r.p = p;
pDt = (MyPtr)&r;
DocTypeCounter = 0;
DoAppAndAllDocTypes(DoAllDocTypesWithSetupProc);
pDt = r.SavepDt;
}
LOCALPROC WriteDocTypeIconShortName(void)
{
WriteCStrToDestFile(DoDocType_gd()->ShortName);
}
LOCALPROC WriteDocTypeIconFileName(void)
{
WriteCStrToDestFile("ICON");
WriteDocTypeIconShortName();
switch (gbo_targfam) {
case gbk_targfam_cmac:
WriteCStrToDestFile("M.r");
break;
case gbk_targfam_mach:
case gbk_targfam_carb:
WriteCStrToDestFile("O.icns");
break;
case gbk_targfam_mswn:
case gbk_targfam_wnce:
WriteCStrToDestFile("W.ico");
break;
}
}
LOCALPROC WriteDocTypeIconFilePath(void)
{
WriteFileInDirToDestFile0(Write_src_d_ToDestFile,
WriteDocTypeIconFileName);
}
LOCALPROC WriteDocTypeIconMacType(void)
{
WriteCStrToDestFile(DoDocType_gd()->MacType);
}
LOCALPROC WriteDocTypeCopyMachoFile(void)
{
WriteCopyFile(WriteDocTypeIconFilePath,
Write_tmachores_d_ToDestFile);
}
typedef void (*tWriteOneFrameWorkType)(char *s);
static void DoAllFrameWorks(tWriteOneFrameWorkType p)
{
if (gbk_apifam_cco == gbo_apifam) {
p("AppKit");
p("AudioUnit");
#if UseOpenGLinOSX
p("OpenGL");
#endif
} else {
p("Carbon");
#if UseOpenGLinOSX
p("OpenGL");
p("AGL");
#endif
}
}
struct DoFrameWork_r
{
MyPtr SavepDt;
char *s;
MyProc p;
};
typedef struct DoFrameWork_r DoFrameWork_r;
#define DoFrameWork_gd() ((DoFrameWork_r *)(pDt))
LOCALPROC DoAllFrameWorksWithSetupProc(char *s)
{
DoFrameWork_gd()->s = s;
DoFrameWork_gd()->p();
++FileCounter;
}
LOCALPROC DoAllFrameWorksWithSetup(MyProc p)
{
DoFrameWork_r r;
r.SavepDt = pDt;
r.p = p;
pDt = (MyPtr)&r;
FileCounter = 0;
DoAllFrameWorks(DoAllFrameWorksWithSetupProc);
pDt = r.SavepDt;
}
LOCALPROC WriteFileToCFilesList(MyProc p)
{
WriteBgnDestFileLn();
p();
WriteEndDestFileLn();
}
LOCALPROC DoSrcExtraHeaderFile(void)
{
WriteFileToCFilesList(WriteExtraHeaderFilePath);
}
LOCALPROC DoSrcFileAddToList(void)
{
WriteFileToCFilesList(WriteSrcFileHeaderPath);
WriteFileToCFilesList(WriteSrcFileFilePath);
}
LOCALPROC WriteCFilesListContents(void)
{
DoAllExtraHeaders2WithSetup(DoSrcExtraHeaderFile);
DoAllSrcFilesWithSetup(DoSrcFileAddToList);
}
LOCALPROC WriteCFilesList(void)
{
/* list of c files */
WriteADstFile1("my_project_d",
"c_files", "", "list of c files",
WriteCFilesListContents);
}
LOCALPROC Write_tmachoShell(void)
{
WriteRmDir(WriteAppNamePath);
WriteRmDir(Write_tmachobun_d_ToDestFile);
WriteMkDir(Write_tmachobun_d_ToDestFile);
WriteMkDir(Write_tmachocontents_d_ToDestFile);
WriteMkDir(Write_tmachomac_d_ToDestFile);
WriteMkDir(Write_tmachores_d_ToDestFile);
WriteMkDir(Write_tmacholang_d_ToDestFile);
DoAllDocTypesWithSetup(WriteDocTypeCopyMachoFile);
WriteCopyFile(WriteInfoPlistFilePath,
Write_tmachocontents_d_ToDestFile);
WriteEchoToNewFile(Write_tmachoLangDummyContents,
Write_tmachoLangDummyPath, trueblnr);
WriteEchoToNewFile(Write_tmachoPkgInfoContents,
Write_tmachoPkgInfoPath, falseblnr);
WriteMoveDir(Write_tmachobun_d_ToDestFile, WriteAppNamePath);
}
LOCALPROC Write_tmachoShellDeps(void)
{
WriteMakeDependFile(Write_srcAppIconPath);
}
LOCALPROC WritepDtSrcPath(void)
{
WriteFileInDirToDestFile0(Write_src_d_ToDestFile, WritepDtString);
}
LOCALPROC WritepDtCfgPath(void)
{
WriteFileInDirToDestFile0(Write_cfg_d_ToDestFile, WritepDtString);
}
LOCALPROC DoSrcDependsMakeCompile(int DepDir, char *s)
{
MyPtr SavepDt = pDt;
pDt = (MyPtr)s;
WriteMakeDependFile((kDepDirCnfg == DepDir)
? WritepDtCfgPath
: WritepDtSrcPath);
pDt = SavepDt;
}
LOCALPROC DoSrcFileMakeCompileDeps(void)
{
WriteMakeDependFile(WriteSrcFileFilePath);
if (DoSrcFile_gd()->depends != nullpr) {
DoSrcFile_gd()->depends(DoSrcDependsMakeCompile);
}
WriteMakeDependFile(WriteCNFGGLOBPath);
}
LOCALPROC DoSrcFileMakeCompileBody(void)
{
WriteCompileC(WriteSrcFileFilePath, WriteSrcFileObjPath,
(DoSrcFile_gd()->Flgm & kCSrcFlgmUseAPI) != 0);
}
LOCALPROC DoSrcFileMakeCompile(void)
{
WriteMakeRule(WriteSrcFileObjPath,
DoSrcFileMakeCompileDeps,
DoSrcFileMakeCompileBody);
}
LOCALPROC DoSrcFileStandardMakeObjects(void)
{
WriteBgnDestFileLn();
WriteSrcFileObjPath();
WriteSpaceToDestFile();
WriteBackSlashToDestFile();
WriteEndDestFileLn();
}
LOCALPROC DoAllSrcFilesStandardMakeObjects(void)
{
DoAllSrcFilesSortWithSetup(DoSrcFileStandardMakeObjects);
}
LOCALPROC DoSrcFileStandardEraseFile(void)
{
WriteRmFile(WriteSrcFileObjPath);
}
LOCALPROC DoAllSrcFilesStandardErase(void)
{
DoAllSrcFilesWithSetup(DoSrcFileStandardEraseFile);
}

492
setup/WRBGCFLS.i Normal file
View File

@ -0,0 +1,492 @@
/*
WRBGCFLS.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite Bash Gnu C specific FiLeS
*/
#define WriteXCDcallgcc WriteCompileCExec
#if 0
LOCALPROC WriteXCDcallgcc(void)
{
#if 0
if ((gbk_ide_xcd == cur_ide) && (ide_vers >= 2100)
&& (ide_vers < 2200))
{
/*
This doesn't seem to make any difference in default
Xcode 2.1 install. Current guess is that default
headers don't support MACOSX_DEPLOYMENT_TARGET,
but the ide is supporting 10.4 sdk that is
included but not installed by default.
*/
WriteCStrToDestFile("export MACOSX_DEPLOYMENT_TARGET=10.");
if (gbk_cpufam_ppc == gbo_cpufam) {
WriteCStrToDestFile("1");
} else {
WriteCStrToDestFile("4");
}
WriteCStrToDestFile(" ; ");
}
#endif
WriteCStrToDestFile("gcc");
}
#endif
LOCALPROC WriteBgcCompileAsmLinkCommonOptions(void)
{
if ((gbk_ide_xcd == cur_ide) && (ide_vers >= 2100)) {
switch (cur_targ) {
case gbk_targ_mach:
case gbk_targ_imch:
case gbk_targ_mc64:
case gbk_targ_mx11:
case gbk_targ_mi11:
case gbk_targ_mx64:
if (gbk_cpufam_x86 == gbo_cpufam) {
WriteCStrToDestFile(" -arch i386");
} else if (gbk_cpufam_x64 == gbo_cpufam) {
WriteCStrToDestFile(" -arch x86_64");
} else {
WriteCStrToDestFile(" -arch ppc");
}
break;
default:
break;
}
}
if (gbk_targfam_oind == gbo_targfam) {
if (gbk_cpufam_x64 == gbo_cpufam) {
WriteCStrToDestFile(" -m64");
}
} else if (gbk_targfam_lnds == gbo_targfam) {
WriteCStrToDestFile(" -marm -mthumb-interwork");
}
}
LOCALPROC WriteBgcLinkOSGlucompileCommonOptions(void)
{
if ((gbk_ide_xcd == cur_ide) && (ide_vers >= 2200)) {
if ((gbk_apifam_osx == gbo_apifam)
|| (gbk_apifam_cco == gbo_apifam))
{
if (gbk_cpufam_ppc == gbo_cpufam) {
WriteCStrToDestFile(" -mmacosx-version-min=10.1");
} else
if (gbk_cpufam_x64 == gbo_cpufam) {
WriteCStrToDestFile(" -mmacosx-version-min=10.5");
} else
{
WriteCStrToDestFile(" -mmacosx-version-min=10.4");
}
WriteCStrToDestFile(" -isysroot");
if (ide_vers >= 3200) {
WriteCStrToDestFile(" /Developer/SDKs/MacOSX10.6.sdk");
} else if ((ide_vers >= 3100)
|| (gbk_cpufam_x64 == gbo_cpufam))
{
WriteCStrToDestFile(" /Developer/SDKs/MacOSX10.5.sdk");
} else {
WriteCStrToDestFile(" /Developer/SDKs/MacOSX10.4u.sdk");
}
}
}
}
LOCALPROC WriteBgcCompileLinkCommonOptions(void)
{
if (gbk_dbg_on == gbo_dbg) {
WriteCStrToDestFile(" -g");
}
}
LOCALPROC WriteBgcCOptions(void)
{
WriteCStrToDestFile(
" -Wall -Wmissing-prototypes -Wno-uninitialized");
if (gbk_apifam_nds != gbo_apifam) {
WriteCStrToDestFile(" -Wundef -Wstrict-prototypes");
}
if (gbk_ide_cyg == cur_ide) {
if (gbk_targfam_cygw != gbo_targfam) {
WriteCStrToDestFile(" -mno-cygwin");
}
}
if (gbk_ide_xcd == cur_ide) {
WriteCStrToDestFile(" -fpascal-strings");
}
if (gbk_ide_xcd == cur_ide) {
switch (cur_targ) {
case gbk_targ_mach:
case gbk_targ_imch:
case gbk_targ_mc64:
case gbk_targ_mx11:
case gbk_targ_mi11:
case gbk_targ_mx64:
WriteCStrToDestFile(" -mdynamic-no-pic");
break;
}
}
WriteBgcCompileAsmLinkCommonOptions();
WriteBgcCompileLinkCommonOptions();
if (gbk_apifam_nds == gbo_apifam) {
WriteCStrToDestFile(" -march=armv5te -mtune=arm946e-s");
}
if (1 /* WantConfigDir */) {
WriteCStrToDestFile(" -I");
Write_cfg_d_ToDestFile();
WriteCStrToDestFile(" -I");
Write_src_d_ToDestFile();
}
}
LOCALPROC WriteBgcCOptOptions(void)
{
if (gbk_dbg_on != gbo_dbg) {
/* WriteCStrToDestFile(" -O3"); */
if (gbk_targfam_lnds == gbo_targfam) {
WriteCStrToDestFile(" -O2");
} else {
WriteCStrToDestFile(" -Os");
}
} else {
WriteCStrToDestFile(" -O0");
}
}
LOCALPROC DoFrameWorkBGCaddFile(void)
{
WriteCStrToDestFile(" -framework ");
WriteCStrToDestFile(DoFrameWork_gd()->s);
}
LOCALPROC Write_machoRsrcBgcDeps(void)
{
WriteMakeDependFile(WriteMainRsrcSrcPath);
WriteMakeDependFile(Write_machoAppIconPath);
}
LOCALPROC Write_machoRsrcBgcBuild(void)
{
WriteDestFileLn("/Developer/Tools/Rez \\");
++DestFileIndent;
WriteDestFileLn("-i /Developer/Headers/FlatCarbon \\");
WriteBgnDestFileLn();
WriteCStrToDestFile("\"");
WriteMainRsrcSrcPath();
WriteCStrToDestFile("\" \\");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("-o \"");
Write_machoRsrcPath();
WriteCStrToDestFile("\" \\");
WriteEndDestFileLn();
WriteDestFileLn("-useDF");
--DestFileIndent;
}
LOCALPROC WriteBashGccMakeFile(void)
{
WriteDestFileLn("# make file generated by gryphel build system");
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("mk_COptionsCommon = -c");
WriteBgcCOptions();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("mk_COptionsOSGLU = $(mk_COptionsCommon)");
WriteBgcLinkOSGlucompileCommonOptions();
WriteBgcCOptOptions();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("mk_COptions = $(mk_COptionsCommon)");
WriteBgcCOptOptions();
WriteEndDestFileLn();
WriteBlankLineToDestFile();
WriteDestFileLn(".PHONY: TheDefaultOutput clean");
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("TheDefaultOutput :");
WriteMakeDependFile(Write_machobinpath_ToDestFile);
WriteEndDestFileLn();
WriteBlankLineToDestFile();
DoAllSrcFilesWithSetup(DoSrcFileMakeCompile);
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("ObjFiles = ");
WriteBackSlashToDestFile();
WriteEndDestFileLn();
++DestFileIndent;
DoAllSrcFilesStandardMakeObjects();
WriteBlankLineToDestFile();
--DestFileIndent;
if (HaveMacBundleApp) {
WriteBlankLineToDestFile();
WriteMakeRule(Write_machoAppIconPath,
Write_tmachoShellDeps,
Write_tmachoShell);
}
if (gbk_apifam_win == gbo_apifam) {
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteMainRsrcObjPath();
WriteCStrToDestFile(": ");
WriteMainRsrcSrcPath();
WriteEndDestFileLn();
++DestFileIndent;
WriteBgnDestFileLn();
WriteCStrToDestFile("windres.exe");
WriteCStrToDestFile(" -i");
WritePathArgInMakeCmnd(WriteMainRsrcSrcPath);
WriteCStrToDestFile(" --input-format=rc -o");
WritePathArgInMakeCmnd(WriteMainRsrcObjPath);
WriteCStrToDestFile(" -O coff --include-dir SRC");
WriteEndDestFileLn();
--DestFileIndent;
WriteBlankLineToDestFile();
}
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
Write_machobinpath_ToDestFile();
WriteCStrToDestFile(" : $(ObjFiles)");
if (HaveMacBundleApp) {
WriteMakeDependFile(Write_machoAppIconPath);
}
if (HaveMacRrscs) {
WriteMakeDependFile(Write_machoRsrcPath);
}
if (gbk_apifam_win == gbo_apifam) {
WriteMakeDependFile(WriteMainRsrcObjPath);
}
WriteEndDestFileLn();
++DestFileIndent;
WriteBgnDestFileLn();
WriteXCDcallgcc();
WriteCStrToDestFile(" \\");
WriteEndDestFileLn();
++DestFileIndent;
WriteBgnDestFileLn();
WriteCStrToDestFile("-o");
if (gbk_apifam_nds == gbo_apifam) {
WritePathArgInMakeCmnd(WriteBinElfObjObjPath);
} else {
WritePathArgInMakeCmnd(Write_machobinpath_ToDestFile);
}
WriteCStrToDestFile(" \\");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("$(ObjFiles)");
if ((gbk_apifam_osx == gbo_apifam)
|| (gbk_apifam_cco == gbo_apifam))
{
DoAllFrameWorksWithSetup(DoFrameWorkBGCaddFile);
if (ide_vers >= 4000) {
WriteCStrToDestFile(" -Wl,-no_pie");
}
} else if (gbk_apifam_win == gbo_apifam) {
WritePathArgInMakeCmnd(WriteMainRsrcObjPath);
if (gbk_targ_wcar == cur_targ) {
WriteCStrToDestFile(
" -lcommctrl -lcoredll -laygshell -lmmtimer");
} else {
WriteCStrToDestFile(
" -mwindows -lwinmm -lole32 -luuid");
if (gbk_ide_cyg == cur_ide) {
WriteCStrToDestFile(" -mno-cygwin");
}
}
} else if (gbk_apifam_gtk == gbo_apifam) {
WriteCStrToDestFile(" `pkg-config --libs gtk+-2.0`");
} else if (gbk_apifam_sdl == gbo_apifam) {
if (gbk_targfam_mach == gbo_targfam) {
WriteCStrToDestFile(" -L/usr/local/lib -lSDLmain"
" -lSDL -Wl,-framework,Cocoa");
} else {
WriteCStrToDestFile(" -lSDL");
}
} else if (gbk_apifam_sd2 == gbo_apifam) {
if (gbk_targfam_mach == gbo_targfam) {
WriteCStrToDestFile(
" -Wl,-framework,Cocoa,-framework,SDL2");
} else {
WriteCStrToDestFile(" -lSDL2");
}
} else if (gbk_apifam_nds == gbo_apifam) {
WriteCStrToDestFile(" -L$(DEVKITPRO)/libnds/lib");
WriteCStrToDestFile(" -lfilesystem -lfat -lnds9");
} else {
if (gbk_targfam_slrs == gbo_targfam) {
WriteCStrToDestFile(" -lposix4");
}
#if MayUseSound
if (gbk_sndapi_alsa == gbo_sndapi) {
WriteCStrToDestFile(" -ldl");
#if 0
WriteCStrToDestFile(" -lasound");
#endif
} else if (gbk_sndapi_ddsp == gbo_sndapi) {
if ((gbk_targfam_nbsd == gbo_targfam)
|| (gbk_targfam_obsd == gbo_targfam))
{
WriteCStrToDestFile(" -lossaudio");
}
}
#endif
#if 0
WriteCStrToDestFile(" -lXext");
#endif
if (gbk_targfam_nbsd == gbo_targfam) {
WriteCStrToDestFile(" -L/usr/X11R7/lib");
WriteCStrToDestFile(" -R/usr/X11R7/lib");
} else if (gbk_targfam_dbsd == gbo_targfam) {
WriteCStrToDestFile(" -L/usr/pkg/lib");
} else if (gbk_targfam_minx == gbo_targfam) {
WriteCStrToDestFile(" -L/usr/pkg/X11R6/lib");
} else if (gbk_targfam_irix == gbo_targfam) {
WriteCStrToDestFile(" -L/usr/lib/X11");
} else {
WriteCStrToDestFile(" -L/usr/X11R6/lib");
}
WriteCStrToDestFile(" -lX11");
}
if (gbk_apifam_nds == gbo_apifam) {
WriteCStrToDestFile(" -specs=ds_arm9.specs");
}
WriteBgcCompileAsmLinkCommonOptions();
WriteBgcLinkOSGlucompileCommonOptions();
WriteBgcCompileLinkCommonOptions();
WriteEndDestFileLn();
--DestFileIndent;
if (gbk_dbg_on != gbo_dbg) {
switch (cur_ide) {
case gbk_ide_bgc:
if ((gbk_targfam_minx == gbo_targfam)
|| (gbk_targfam_linx == gbo_targfam)
|| (gbk_targfam_oind == gbo_targfam)
/*
for oi64, strip makes it larger!
but still compresses smaller.
*/
|| (gbk_targfam_fbsd == gbo_targfam)
|| (gbk_targfam_obsd == gbo_targfam)
|| (gbk_targfam_nbsd == gbo_targfam)
|| (gbk_targfam_dbsd == gbo_targfam)
)
{
WriteBgnDestFileLn();
WriteCStrToDestFile("strip --strip-unneeded");
WritePathArgInMakeCmnd(
Write_machobinpath_ToDestFile);
WriteEndDestFileLn();
} else if (gbk_targfam_irix == gbo_targfam) {
WriteBgnDestFileLn();
WriteCStrToDestFile("strip -s");
WritePathArgInMakeCmnd(
Write_machobinpath_ToDestFile);
WriteEndDestFileLn();
}
break;
case gbk_ide_xcd:
WriteBgnDestFileLn();
WriteCStrToDestFile("strip -u -r");
WritePathArgInMakeCmnd(
Write_machobinpath_ToDestFile);
WriteEndDestFileLn();
break;
case gbk_ide_dvc:
case gbk_ide_mgw:
case gbk_ide_cyg:
WriteBgnDestFileLn();
WriteCStrToDestFile("strip.exe");
WritePathArgInMakeCmnd(WriteAppNamePath);
WriteEndDestFileLn();
break;
default:
break;
}
}
if (gbk_apifam_nds == gbo_apifam) {
WriteBgnDestFileLn();
WriteCStrToDestFile(
"$(DEVKITARM)/bin/arm-eabi-objcopy.exe -O binary");
WritePathArgInMakeCmnd(WriteBinElfObjObjPath);
WritePathArgInMakeCmnd(WriteBinArmObjObjPath);
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("$(DEVKITARM)/bin/ndstool.exe -c");
WritePathArgInMakeCmnd(WriteAppNamePath);
WriteCStrToDestFile(" -9");
WritePathArgInMakeCmnd(WriteBinArmObjObjPath);
WriteCStrToDestFile(" -b $(DEVKITPRO)/libnds/icon.bmp");
WriteCStrToDestFile(
" \";www.devkitpro.org;www.drunkencoders.com\"");
WriteEndDestFileLn();
}
--DestFileIndent;
if (HaveMacRrscs) {
WriteBlankLineToDestFile();
WriteMakeRule(Write_machoRsrcPath,
Write_machoRsrcBgcDeps,
Write_machoRsrcBgcBuild);
}
WriteBlankLineToDestFile();
WriteDestFileLn("clean :");
++DestFileIndent;
WriteDestFileLn("rm -f $(ObjFiles)");
if (HaveMacBundleApp) {
WriteRmDir(WriteAppNamePath);
} else {
if (gbk_apifam_win == gbo_apifam) {
WriteRmFile(WriteMainRsrcObjPath);
} else if (gbk_apifam_nds == gbo_apifam) {
WriteRmFile(WriteBinElfObjObjPath);
WriteRmFile(WriteBinArmObjObjPath);
}
WriteRmFile(WriteAppNamePath);
}
--DestFileIndent;
}
LOCALPROC WriteBashGccSpecificFiles(void)
{
if (HaveMacBundleApp) {
WritePListData();
}
if (WantSandbox) {
WriteEntitlementsData();
}
WriteADstFile1("my_project_d",
"Makefile", "", "Make file",
WriteBashGccMakeFile);
}

89
setup/WRCCCFLS.i Normal file
View File

@ -0,0 +1,89 @@
/*
WRCCCFLS.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite generic Command line C Compiler specific FiLeS
*/
LOCALPROC WriteCccMakeFile(void)
{
WriteDestFileLn("# make file generated by gryphel build system");
WriteBlankLineToDestFile();
WriteDestFileLn("mk_COptions = -c");
WriteCStrToDestFile(" -I");
Write_cfg_d_ToDestFile();
WriteCStrToDestFile(" -I");
Write_src_d_ToDestFile();
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("TheDefaultOutput : ");
Write_machobinpath_ToDestFile();
WriteEndDestFileLn();
WriteBlankLineToDestFile();
DoAllSrcFilesWithSetup(DoSrcFileMakeCompile);
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("ObjFiles = ");
WriteBackSlashToDestFile();
WriteEndDestFileLn();
++DestFileIndent;
DoAllSrcFilesStandardMakeObjects();
WriteBlankLineToDestFile();
--DestFileIndent;
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
Write_machobinpath_ToDestFile();
WriteCStrToDestFile(" : $(ObjFiles)");
WriteEndDestFileLn();
++DestFileIndent;
WriteDestFileLn("cc \\");
++DestFileIndent;
WriteBgnDestFileLn();
WriteCStrToDestFile("-o ");
WriteQuoteToDestFile();
Write_machobinpath_ToDestFile();
WriteQuoteToDestFile();
WriteCStrToDestFile(" \\");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("$(ObjFiles)");
#if 0
WriteCStrToDestFile(" -lXext");
#endif
WriteCStrToDestFile(" -L/usr/X11R6/lib -lX11");
WriteEndDestFileLn();
--DestFileIndent;
--DestFileIndent;
WriteBlankLineToDestFile();
WriteDestFileLn("clean :");
++DestFileIndent;
WriteDestFileLn("rm -f $(ObjFiles)");
WriteRmFile(WriteAppNamePath);
--DestFileIndent;
}
LOCALPROC WriteCccSpecificFiles(void)
{
WriteADstFile1("my_project_d",
"Makefile", "", "Make file",
WriteCccMakeFile);
}

431
setup/WRCNFGAP.i Normal file
View File

@ -0,0 +1,431 @@
/*
WRCNFGAP.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite "CNFGrAPi.h"
*/
LOCALPROC WriteOSXLocalTalkCNFGRAPI(void)
{
WriteDestFileLn("#include <unistd.h>");
WriteDestFileLn("#include <netinet/in.h>");
WriteDestFileLn("#include <sys/socket.h>");
WriteDestFileLn("#include <net/if.h>");
WriteDestFileLn("#include <net/route.h>");
WriteDestFileLn("#include <net/if_dl.h>");
WriteDestFileLn("#include <arpa/inet.h>");
WriteDestFileLn("#include <sys/select.h>");
WriteDestFileLn("#include <sys/ioctl.h>");
WriteDestFileLn("#include <sys/sysctl.h>");
WriteDestFileLn("#include <net/bpf.h>");
}
LOCALPROC WriteCommonCNFGRAPIContents(void)
{
WriteDestFileLn("/*");
++DestFileIndent;
WriteDestFileLn(
"Configuration options used by platform specific code.");
WriteConfigurationWarning();
--DestFileIndent;
WriteDestFileLn("*/");
if (gbo_TstCompErr) {
WriteDestFileLn("#error \"Testing Compile Time Error\"");
}
if (gbk_ide_msv == cur_ide) {
if (ide_vers >= 8000) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define _CRT_SECURE_NO_DEPRECATE 1");
}
WriteBlankLineToDestFile();
WriteDestFileLn(
"/* ignore warning generated by system includes */");
if (ide_vers >= 6000) {
WriteDestFileLn("#pragma warning(push)");
}
WriteDestFileLn("#pragma warning(disable : 4201 4115 4214)");
}
WriteBlankLineToDestFile();
if (gbk_apifam_osx == gbo_apifam) {
if (gbk_targfam_carb == gbo_targfam) {
/* kIdeMW8 or kIdeMPW3_6_a1 */
if (gbk_ide_mw8 == cur_ide) {
WriteDestFileLn("#include <MacHeadersCarbon.h>");
} else
{
WriteDestFileLn("#include <Carbon.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
#if UseOpenGLinOSX
WriteDestFileLn("#include <agl.h>");
#endif
}
WriteDestFileLn("#define UsingCarbonLib 1");
} else {
/* kIdeMW8 or kIdeBashGcc or kIdeAPB */
if (gbk_ide_mw8 == cur_ide) {
WriteDestFileLn("#include <MSL MacHeadersMach-O.h>");
}
WriteDestFileLn("#include <Carbon/Carbon.h>");
#if UseOpenGLinOSX
WriteDestFileLn("#include <AGL/agl.h>");
#endif
#if UseMachinOSX
WriteDestFileLn("#include <mach/mach_interface.h>");
WriteDestFileLn("#include <mach/mach_port.h>");
#endif
WriteDestFileLn("#include <unistd.h>");
/* for nanosleep */
if (WantLocalTalk) {
WriteOSXLocalTalkCNFGRAPI();
}
}
} else if (gbk_apifam_cco == gbo_apifam) {
WriteDestFileLn("#import <Cocoa/Cocoa.h>");
#if MayUseSound
if (MySoundEnabled) {
WriteDestFileLn("#include <CoreAudio/CoreAudio.h>");
WriteDestFileLn("#include <AudioUnit/AudioUnit.h>");
}
#endif
#if UseOpenGLinOSX
WriteDestFileLn("#include <OpenGL/gl.h>");
#endif
WriteDestFileLn("#include <stdio.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
WriteDestFileLn("#include <sys/param.h>");
WriteDestFileLn("#include <sys/time.h>");
if (WantUnTranslocate) {
WriteDestFileLn("#include <dlfcn.h>");
}
if (WantLocalTalk) {
WriteOSXLocalTalkCNFGRAPI();
}
} else if (gbk_apifam_xwn == gbo_apifam) {
blnr HaveAppPathLink = falseblnr;
blnr HaveSysctlPath = (gbk_targfam_fbsd == gbo_targfam);
switch (gbo_targfam) {
case gbk_targfam_linx:
case gbk_targfam_nbsd:
case gbk_targfam_dbsd:
case gbk_targfam_oind:
HaveAppPathLink = trueblnr;
break;
default:
break;
}
if (gbk_targfam_minx == gbo_targfam) {
WriteDestFileLn(
"/* get nanosleep and gettimeofday. ugh */");
WriteDestFileLn("#define _POSIX_SOURCE 1");
WriteDestFileLn("#define _POSIX_C_SOURCE 200112L");
}
WriteDestFileLn("#include <stdio.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
WriteDestFileLn("#include <time.h>");
WriteDestFileLn("#include <sys/time.h>");
WriteDestFileLn("#include <sys/times.h>");
WriteDestFileLn("#include <X11/Xlib.h>");
WriteDestFileLn("#include <X11/Xutil.h>");
WriteDestFileLn("#include <X11/keysym.h>");
WriteDestFileLn("#include <X11/keysymdef.h>");
WriteDestFileLn("#include <X11/Xatom.h>");
#if 1
WriteDestFileLn("#include <fcntl.h>");
#endif
/* if (WantActvCode) */ {
/* also now used for export file */
WriteDestFileLn("#include <sys/stat.h>");
}
#if MayUseSound
if ((gbk_sndapi_alsa == gbo_sndapi)
|| (gbk_sndapi_ddsp == gbo_sndapi))
{
WriteDestFileLn("#include <errno.h>");
}
#endif
if (HaveAppPathLink /* for readlink */
#if MayUseSound
|| (gbk_sndapi_ddsp == gbo_sndapi)
#endif
) /* for write */
{
WriteDestFileLn("#include <unistd.h>");
}
if (HaveSysctlPath) {
WriteDestFileLn("#include <sys/sysctl.h>");
}
#if MayUseSound
if (MySoundEnabled) {
switch (gbo_sndapi) {
case gbk_sndapi_alsa:
WriteDestFileLn("#include <dlfcn.h>");
#if 0
WriteDestFileLn("#include <alsa/asoundlib.h>");
#endif
break;
case gbk_sndapi_ddsp:
WriteDestFileLn("#include <sys/ioctl.h>");
if (gbk_targfam_obsd == gbo_targfam) {
WriteDestFileLn("#include <soundcard.h>");
} else {
WriteDestFileLn("#include <sys/soundcard.h>");
}
break;
default:
break;
}
}
#endif
WriteBlankLineToDestFile();
WriteCompCondBool("CanGetAppPath",
HaveAppPathLink || HaveSysctlPath);
WriteCompCondBool("HaveAppPathLink", HaveAppPathLink);
if (HaveAppPathLink) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define TheAppPathLink \"");
switch (gbo_targfam) {
case gbk_targfam_nbsd:
WriteCStrToDestFile("/proc/curproc/exe");
break;
case gbk_targfam_dbsd:
WriteCStrToDestFile("/proc/curproc/file");
break;
case gbk_targfam_oind:
WriteCStrToDestFile("/proc/self/path/a.out");
break;
case gbk_targfam_linx:
default:
WriteCStrToDestFile("/proc/self/exe");
break;
}
WriteCStrToDestFile("\"");
WriteEndDestFileLn();
}
WriteCompCondBool("HaveSysctlPath", HaveSysctlPath);
#if MayUseSound
if (MySoundEnabled) {
if (gbk_sndapi_ddsp == gbo_sndapi) {
WriteBgnDestFileLn();
WriteCStrToDestFile("#define AudioDevPath \"");
switch (gbo_targfam) {
case gbk_targfam_nbsd:
case gbk_targfam_obsd:
WriteCStrToDestFile("/dev/audio");
break;
case gbk_targfam_fbsd:
case gbk_targfam_dbsd:
default:
WriteCStrToDestFile("/dev/dsp");
break;
}
WriteCStrToDestFile("\"");
WriteEndDestFileLn();
}
}
#endif
} else if (gbk_apifam_nds == gbo_apifam) {
WriteDestFileLn("#define ARM9 1");
WriteDestFileLn("#include <nds.h>");
WriteDestFileLn("#include <filesystem.h>");
WriteDestFileLn("#include <fat.h>");
WriteDestFileLn("#include <stdio.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
WriteDestFileLn("#include <time.h>");
WriteDestFileLn("#include <sys/time.h>");
WriteDestFileLn("#include <sys/times.h>");
WriteDestFileLn("#include <fcntl.h>");
WriteDestFileLn("#include <unistd.h>");
} else if (gbk_apifam_gtk == gbo_apifam) {
WriteDestFileLn("#include <gtk/gtk.h>");
WriteDestFileLn("#include <gdk/gdkkeysyms.h>");
WriteDestFileLn("#include <stdio.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
WriteDestFileLn("#include <time.h>");
WriteDestFileLn("#include <sys/time.h>");
WriteDestFileLn("#include <sys/times.h>");
} else if (gbk_apifam_sdl == gbo_apifam) {
WriteDestFileLn("#include <SDL/SDL.h>");
WriteDestFileLn("#include <stdio.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
} else if (gbk_apifam_sd2 == gbo_apifam) {
WriteDestFileLn("#include <SDL2/SDL.h>");
WriteDestFileLn("#include <stdio.h>");
WriteDestFileLn("#include <stdlib.h>");
WriteDestFileLn("#include <string.h>");
} else if (gbk_apifam_win == gbo_apifam) {
if ((gbk_ide_mvc == cur_ide)
&& (gbk_targfam_wnce == gbo_targfam))
{
WriteDestFileLn("#define WIN32 1");
WriteDestFileLn("#define _WIN32 1");
WriteDestFileLn("#define WINNT 1");
WriteDestFileLn("#define UNDER_CE 1");
WriteDestFileLn("#define __CEGCC__ 1");
WriteDestFileLn("#define __CEGCC32__ 1");
WriteDestFileLn("#define __MINGW32__ 1");
WriteDestFileLn("#define __MINGW32CE__ 1");
WriteDestFileLn("#define __COREDLL__ 1");
WriteDestFileLn("#define UNICODE 1");
WriteDestFileLn("#define _UNICODE 1");
WriteDestFileLn("#define _M_ARM 1");
WriteBlankLineToDestFile();
}
if (gbk_ide_mw8 == cur_ide) {
WriteDestFileLn("#include <Win32Headers.h>");
} else
{
WriteDestFileLn("#include <windows.h>");
WriteDestFileLn("#include <time.h>");
if (gbk_ide_lcc == cur_ide) {
WriteDestFileLn("#include <shellapi.h>");
WriteDestFileLn("#include <mmsystem.h>");
}
}
WriteDestFileLn("#include <shlobj.h>");
WriteDestFileLn("#include <tchar.h>");
if (gbk_targfam_wnce == gbo_targfam) {
WriteDestFileLn("#include <aygshell.h>");
WriteDestFileLn("#include <commdlg.h>");
}
if (gbk_ide_mvc == cur_ide) {
WriteBlankLineToDestFile();
WriteDestFileLn("#define _tWinMain WinMain");
}
if (gbk_ide_plc == cur_ide) {
WriteDestFileLn("#define _MAX_PATH MAX_PATH");
}
} else {
if (gbk_ide_mw8 == cur_ide) {
WriteDestFileLn("#include <MacHeaders.h>");
WriteDestFileLn("#include <CursorDevices.h>");
WriteDestFileLn("#define ShouldDefineQDGlobals 0");
} else
if (gbk_ide_mpw == cur_ide) {
WriteDestFileLn("#include <MacTypes.h>");
if (gbk_cpufam_68k != gbo_cpufam) {
WriteDestFileLn("#include <MixedMode.h>");
}
WriteDestFileLn("#include <Gestalt.h>");
WriteDestFileLn("#include <MacErrors.h>");
WriteDestFileLn("#include <MacMemory.h>");
WriteDestFileLn("#include <OSUtils.h>");
WriteDestFileLn("#include <QuickdrawText.h>");
WriteDestFileLn("#include <QuickDraw.h>");
if (gbk_cpufam_68k == gbo_cpufam) {
WriteDestFileLn("#include <SegLoad.h>");
}
WriteDestFileLn("#include <IntlResources.h>");
WriteDestFileLn("#include <Events.h>");
WriteDestFileLn("#include <Script.h>");
WriteDestFileLn("#include <Files.h>");
WriteDestFileLn("#include <Resources.h>");
WriteDestFileLn("#include <Fonts.h>");
WriteDestFileLn("#include <TextUtils.h>");
WriteDestFileLn("#include <FixMath.h>");
WriteDestFileLn("#include <ToolUtils.h>");
WriteDestFileLn("#include <Menus.h>");
WriteDestFileLn("#include <Scrap.h>");
WriteDestFileLn("#include <Controls.h>");
WriteDestFileLn("#include <ControlDefinitions.h>");
WriteDestFileLn("#include <AppleEvents.h>");
WriteDestFileLn("#include <Processes.h>");
WriteDestFileLn("#include <EPPC.h>");
WriteDestFileLn("#include <MacWindows.h>");
WriteDestFileLn("#include <TextEdit.h>");
WriteDestFileLn("#include <Dialogs.h>");
WriteDestFileLn("#include <Devices.h>");
WriteDestFileLn("#include <Palettes.h>");
WriteDestFileLn("#include <StandardFile.h>");
WriteDestFileLn("#include <Aliases.h>");
WriteDestFileLn("#include <Folders.h>");
WriteDestFileLn("#include <Balloons.h>");
WriteDestFileLn("#include <DiskInit.h>");
WriteDestFileLn("#include <LowMem.h>");
WriteDestFileLn("#include <Appearance.h>");
WriteDestFileLn("#include <Navigation.h>");
WriteDestFileLn("#include <Sound.h>");
WriteDestFileLn("#include <CursorDevices.h>");
WriteDestFileLn("#include <Traps.h>");
}
}
if ((gbk_ide_msv == cur_ide) && (ide_vers >= 6000)) {
WriteBlankLineToDestFile();
WriteDestFileLn("/* restore warnings */");
WriteDestFileLn("#pragma warning(pop)");
}
WriteBlankLineToDestFile();
if (gbk_cpufam_68k == gbo_cpufam) {
if (gbk_ide_mpw == cur_ide) {
WriteDestFileLn("#define ShouldUnloadDataInit 1");
WriteDestFileLn("#define Windows85APIAvail 0");
WriteDestFileLn("#define NeedLongGlue 1");
}
}
#if MayUseSound
if (MySoundEnabled) {
if (gbk_sndapi_alsa == gbo_sndapi)
if (gbk_cpufam_arm == gbo_cpufam)
{
WriteDestFileLn("#define RaspbianWorkAround 1");
}
}
#endif
if (HaveMacBundleApp) {
WriteDestFileLn("#define MyAppIsBundle 1");
}
if (gbk_apifam_cco == gbo_apifam) {
WriteCompCondBool("WantUnTranslocate",
WantUnTranslocate);
}
if (gbk_apifam_win == gbo_apifam) {
if (WantIconMaster) {
WriteDestFileLn("#define InstallFileIcons 1");
}
}
if ((gbk_apifam_mac == gbo_apifam)
|| (gbk_apifam_osx == gbo_apifam))
{
WriteBgnDestFileLn();
WriteCStrToDestFile("#define kMacCreatorSig ");
WriteSingleQuoteToDestFile();
WriteCStrToDestFile(kMacCreatorSig);
WriteSingleQuoteToDestFile();
WriteEndDestFileLn();
}
}

438
setup/WRCNFGGL.i Normal file
View File

@ -0,0 +1,438 @@
/*
WRCNFGGL.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite "CNFGGLob.h"
*/
LOCALPROC WriteConfigurationWarning(void)
{
WriteBlankLineToDestFile();
WriteDestFileLn(
"This file is automatically generated by the build system,");
WriteDestFileLn(
"which tries to know what options are valid in what");
WriteDestFileLn(
"combinations. Avoid changing this file manually unless");
WriteDestFileLn(
"you know what you're doing.");
}
LOCALPROC WriteCommonCNFGGLOBContents(void)
{
WriteDestFileLn("/*");
++DestFileIndent;
WriteDestFileLn(
"Configuration options used by both platform specific");
WriteDestFileLn(
"and platform independent code.");
WriteConfigurationWarning();
--DestFileIndent;
WriteDestFileLn("*/");
WriteBlankLineToDestFile();
WriteDestFileLn("/* adapt to current compiler/host processor */");
if (gbk_ide_mw8 == cur_ide) {
WriteDestFileLn("/* make sure this is correct CNFGGLOB */");
WriteCheckPreDef("__MWERKS__");
switch (gbo_cpufam) {
case gbk_cpufam_68k:
WriteCheckPreDef("__MC68K__");
if (gbk_targ_mfpu == cur_targ) {
WriteCheckPreDef("__MC68881__");
} else {
WriteCheckPreNDef("__MC68881__");
}
break;
case gbk_cpufam_ppc:
WriteCheckPreDef("__POWERPC__");
break;
case gbk_cpufam_x86:
WriteCheckPreDef("__INTEL__");
break;
}
} else if ((gbk_ide_bgc == cur_ide)
|| (gbk_ide_xcd == cur_ide)
|| (gbk_ide_mvc == cur_ide))
{
switch (gbo_cpufam) {
case gbk_cpufam_x86:
WriteDestFileLn("#ifdef __x86_64__");
WriteDestFileLn("#error \"source is configured for"
" 32 bit compiler\"");
WriteDestFileLn("#endif");
break;
case gbk_cpufam_x64:
WriteDestFileLn("#ifdef __i386__");
WriteDestFileLn("#error \"source is configured for"
" 64 bit compiler\"");
WriteDestFileLn("#endif");
break;
}
}
WriteBlankLineToDestFile();
#if NeedIntFormatInfo
WriteCompCondBool("MostSigByteFirst",
(gbk_cpufam_68k == gbo_cpufam)
|| (gbk_cpufam_ppc == gbo_cpufam));
WriteCompCondBool("LeastSigByteFirst",
(gbk_cpufam_x86 == gbo_cpufam)
|| (gbk_cpufam_x64 == gbo_cpufam));
WriteCompCondBool("TwosCompSigned",
(gbk_cpufam_68k == gbo_cpufam)
|| (gbk_cpufam_ppc == gbo_cpufam)
|| (gbk_cpufam_x86 == gbo_cpufam)
|| (gbk_cpufam_x64 == gbo_cpufam));
#endif
if (gbk_cpufam_68k == gbo_cpufam) {
WriteDestFileLn("#define HaveCPUfamM68K 1");
}
if ((gbk_ide_bgc == cur_ide)
|| (gbk_ide_xcd == cur_ide)
|| (gbk_ide_mvc == cur_ide)
|| (gbk_ide_cyg == cur_ide)
|| (gbk_ide_dkp == cur_ide))
{
WriteDestFileLn(
"#define MayInline inline __attribute__((always_inline))");
} else
if (gbk_ide_snc == cur_ide) {
WriteDestFileLn("#define MayInline inline");
} else
if (gbk_ide_mw8 == cur_ide) {
WriteDestFileLn("#define MayInline __inline__");
} else
if (gbk_ide_msv == cur_ide) {
if (ide_vers >= 6000) {
WriteDestFileLn("#define MayInline __forceinline");
} else {
WriteDestFileLn("#define MayInline __inline");
}
} else
{
/* WriteDestFileLn("#define MayInline"); */
}
if ((gbk_ide_bgc == cur_ide)
|| (gbk_ide_xcd == cur_ide)
|| (gbk_ide_mvc == cur_ide)
|| (gbk_ide_cyg == cur_ide)
|| (gbk_ide_dkp == cur_ide))
{
WriteDestFileLn(
"#define MayNotInline __attribute__((noinline))");
} else
if ((gbk_ide_msv == cur_ide) && (ide_vers >= 7000)) {
WriteDestFileLn("#define MayNotInline __declspec(noinline)");
} else
{
/* WriteDestFileLn("#define MayNotInline"); */
}
if (gbk_ide_mvc == cur_ide) {
if ((gbk_cpufam_68k == gbo_cpufam)
|| (gbk_cpufam_ppc == gbo_cpufam))
{
WriteDestFileLn("#define BigEndianUnaligned 1");
WriteDestFileLn("#define LittleEndianUnaligned 0");
} else if ((gbk_cpufam_x86 == gbo_cpufam)
|| (gbk_cpufam_x64 == gbo_cpufam))
{
WriteDestFileLn("#define BigEndianUnaligned 0");
WriteDestFileLn("#define LittleEndianUnaligned 1");
} else {
WriteDestFileLn("#define BigEndianUnaligned 0");
WriteDestFileLn("#define LittleEndianUnaligned 0");
}
if (gbk_cpufam_x86 == gbo_cpufam) {
WriteDestFileLn(
"#define my_reg_call __attribute__ ((regparm(3)))");
}
if (gbk_cpufam_x86 == gbo_cpufam) {
WriteDestFileLn(
"#define my_osglu_call __attribute__ "
"((force_align_arg_pointer))");
}
WriteDestFileLn("#define my_cond_rare(x) "
"(__builtin_expect(x, 0))");
WriteDestFileLn("#define Have_ASR 1");
if (gbk_cpufam_x64 == gbo_cpufam) {
WriteDestFileLn("#define HaveUi6Div 1");
}
if (gbk_targ_wcar == cur_targ) {
WriteDestFileLn("#define HaveUi5to6Mul 0");
}
if ((gbk_cpufam_x64 == gbo_cpufam)
|| (gbk_cpufam_ppc == gbo_cpufam)
|| (gbk_cpufam_arm == gbo_cpufam))
{
WriteDestFileLn("#define HaveGlbReg 1");
}
WriteDestFileLn(
"#define my_align_8 __attribute__ ((aligned (8)))");
}
WriteCompCondBool("SmallGlobals", gbk_cpufam_68k == gbo_cpufam);
if ((gbk_ide_bgc == cur_ide)
|| (gbk_ide_xcd == cur_ide)
|| (gbk_ide_mvc == cur_ide)
|| (gbk_ide_ccc == cur_ide)
|| (gbk_ide_dvc == cur_ide)
|| (gbk_ide_mgw == cur_ide)
|| (gbk_ide_dmc == cur_ide)
|| (gbk_ide_lcc == cur_ide)
|| (gbk_ide_cyg == cur_ide)
|| (gbk_ide_dkp == cur_ide)
)
{
WriteDestFileLn("#define cIncludeUnused 0");
} else {
WriteDestFileLn("#define cIncludeUnused 1");
}
if (gbk_ide_lcc == cur_ide) {
WriteDestFileLn("#define UnusedParam(x)");
} else {
WriteDestFileLn("#define UnusedParam(p) (void) p");
}
if (gbk_ide_msv == cur_ide) {
WriteBlankLineToDestFile();
WriteDestFileLn("/* --- set up compiler options --- */");
WriteBlankLineToDestFile();
WriteDestFileLn("/* ignore integer conversion warnings */");
WriteDestFileLn(
"#pragma warning(disable : 4244 4761 4018 4245 4024 4305)");
WriteBlankLineToDestFile();
WriteDestFileLn("/* ignore unused inline warning */");
WriteDestFileLn("#pragma warning(disable : 4514 4714)");
#if 0
WriteBlankLineToDestFile();
WriteDestFileLn("/* ignore type redefinition warning */");
WriteDestFileLn("#pragma warning(disable : 4142)");
#endif
WriteBlankLineToDestFile();
WriteDestFileLn(
"/* ignore unary minus operator"
" applied to unsigned type warning */");
WriteDestFileLn("#pragma warning(disable : 4146)");
if (cur_mIIorIIX
|| (em_cpu_vers >= 2))
{
/* C4127: conditional expression is constant */
/*
C4701: local variable may have been used without having
been initialized
*/
WriteBlankLineToDestFile();
WriteDestFileLn("/* more warnings */");
WriteDestFileLn("#pragma warning(disable : 4127 4701)");
}
} else if (gbk_ide_plc == cur_ide) {
WriteBlankLineToDestFile();
WriteDestFileLn("#pragma warn(disable: 2135 2137)");
}
if (gbk_ide_mw8 == cur_ide) {
if (gbk_dbg_on != gbo_dbg) {
WriteBlankLineToDestFile();
WriteDestFileLn("#ifdef OptForSpeed");
WriteDestFileLn("#pragma optimize_for_size off");
WriteDestFileLn("#endif");
}
}
WriteBlankLineToDestFile();
WriteDestFileLn("/* --- integer types ---- */");
/*
define signed and unsigned integer types
for 8 bits, 16 bits, 32 bits, and so on.
the computer might not have integer types
of a given size. in this case should define
a type of correct size, such as a structure
type, even if the computer can't directly do
integer operations on it. then set
HaveReal?i?b to 0.
*/
/* 8 bits */
/* (ui3b)0 - (ui3b)1 == (ui3b)255 */
WriteBlankLineToDestFile();
WriteDestFileLn("typedef unsigned char ui3b;");
WriteDestFileLn("#define HaveRealui3b 1");
/* sizeof(si3b) == sizeof(ui3b) */
WriteBlankLineToDestFile();
WriteDestFileLn("typedef signed char si3b;");
WriteDestFileLn("#define HaveRealsi3b 1");
/* 16 bits */
/* (ui4b)0 - (ui4b)1 == (ui4b)65535 */
WriteBlankLineToDestFile();
WriteDestFileLn("typedef unsigned short ui4b;");
WriteDestFileLn("#define HaveRealui4b 1");
/* sizeof(si4b) == sizeof(ui4b) */
WriteBlankLineToDestFile();
WriteDestFileLn("typedef short si4b;");
WriteDestFileLn("#define HaveRealsi4b 1");
/* 32 bits */
/* (ui5b)0 - (ui5b)1 == (ui5b)4294967295 */
WriteBlankLineToDestFile();
if (gbk_cpufam_x64 == gbo_cpufam) {
WriteDestFileLn("typedef unsigned int ui5b;");
} else {
WriteDestFileLn("typedef unsigned long ui5b;");
}
WriteDestFileLn("#define HaveRealui5b 1");
/* sizeof(si5b) == sizeof(ui5b) */
WriteBlankLineToDestFile();
if (gbk_cpufam_x64 == gbo_cpufam) {
WriteDestFileLn("typedef int si5b;");
} else {
WriteDestFileLn("typedef long si5b;");
}
WriteDestFileLn("#define HaveRealsi5b 1");
/* 64 bits */ /* this is mostly for illustration, not used */
#if 0
struct ui6b {
ui5b f0;
ui5b f1;
};
typedef struct ui6b ui6b;
struct si6b {
ui5b f0;
si5b f1;
};
typedef struct si6b si6b;
#endif
WriteBlankLineToDestFile();
WriteDestFileLn("#define HaveRealui6b 0");
WriteDestFileLn("#define HaveRealsi6b 0");
WriteBlankLineToDestFile();
WriteDestFileLn("/* --- integer representation types ---- */");
/*
for each integer type, define
the most efficient representation
for parameter passing and temporary
variables on the current
computer.
*/
WriteBlankLineToDestFile();
#if ModPPCi3rTypes
if (gbk_cpufam_ppc == gbo_cpufam) {
WriteDestFileLn("typedef ui5b ui3r;");
WriteDestFileLn("#define ui3beqr 0");
} else
#endif
{
WriteDestFileLn("typedef ui3b ui3r;");
WriteDestFileLn("#define ui3beqr 1");
}
WriteBlankLineToDestFile();
#if ModPPCi3rTypes
if (gbk_cpufam_ppc == gbo_cpufam) {
WriteDestFileLn("typedef si5b si3r;");
WriteDestFileLn("#define si3beqr 0");
} else
#endif
{
WriteDestFileLn("typedef si3b si3r;");
WriteDestFileLn("#define si3beqr 1");
}
WriteBlankLineToDestFile();
WriteDestFileLn("typedef ui4b ui4r;");
WriteDestFileLn("#define ui4beqr 1");
WriteBlankLineToDestFile();
WriteDestFileLn("typedef si4b si4r;");
WriteDestFileLn("#define si4beqr 1");
WriteBlankLineToDestFile();
WriteDestFileLn("typedef ui5b ui5r;");
WriteDestFileLn("#define ui5beqr 1");
WriteBlankLineToDestFile();
WriteDestFileLn("typedef si5b si5r;");
WriteDestFileLn("#define si5beqr 1");
if (gbk_ide_mvc == cur_ide) {
if (gbk_cpufam_x86 == gbo_cpufam)
{
WriteBlankLineToDestFile();
WriteDestFileLn("/* for probable register parameters */");
WriteDestFileLn("#define ui4rr ui5r");
WriteDestFileLn("#define ui3rr ui5r");
} else if (gbk_cpufam_x64 == gbo_cpufam) {
#if 0
WriteBlankLineToDestFile();
WriteDestFileLn("/* for probable register parameters */");
WriteDestFileLn("#define ui4rr unsigned long int");
WriteDestFileLn("#define ui3rr unsigned long int");
#endif
WriteDestFileLn("#define si5rr signed long");
}
WriteBlankLineToDestFile();
WriteDestFileLn(
"#define MySwapUi5r(x) ((ui5r)__builtin_bswap32(x))");
WriteDestFileLn("#define HaveMySwapUi5r 1");
}
}
LOCALPROC Write64bitConfig(void)
{
WriteBlankLineToDestFile();
if (gbk_ide_msv == cur_ide) {
WriteDestFileLn("typedef signed __int64 si6r;");
WriteDestFileLn("typedef signed __int64 si6b;");
WriteDestFileLn("typedef unsigned __int64 ui6r;");
WriteDestFileLn("typedef unsigned __int64 ui6b;");
WriteDestFileLn("#define LIT64(a) a##Ui64");
} else {
WriteDestFileLn("typedef signed long long si6r;");
WriteDestFileLn("typedef signed long long si6b;");
WriteDestFileLn("typedef unsigned long long ui6r;");
WriteDestFileLn("typedef unsigned long long ui6b;");
WriteDestFileLn("#define LIT64(a) a##ULL");
}
}

100
setup/WRDMCFLS.i Normal file
View File

@ -0,0 +1,100 @@
/*
WRDMCFLS.i
Copyright (C) 2010 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite Digital Mars Compiler specific FiLeS
*/
LOCALPROC WriteMainRsrcObjDMCbuild(void)
{
WriteBgnDestFileLn();
WriteCStrToDestFile("rcc.exe -o");
WriteMainRsrcObjPath();
WriteSpaceToDestFile();
WriteMainRsrcSrcPath();
WriteCStrToDestFile(" -I");
Write_src_d_ToDestFile();
WriteEndDestFileLn();
}
LOCALPROC WriteDMCclMakeFile(void)
{
WriteDestFileLn("# make file generated by gryphel build system");
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("mk_COptions = -c -r -WA");
/* -o+space seems to generate bad code, compiler version 8.42n */
WriteCStrToDestFile(" -I");
Write_cfg_d_ToDestFile();
WriteCStrToDestFile(" -I");
Write_src_d_ToDestFile();
WriteEndDestFileLn();
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("TheDefaultOutput:");
WriteMakeDependFile(WriteAppNamePath);
WriteEndDestFileLn();
WriteBlankLineToDestFile();
WriteBlankLineToDestFile();
DoAllSrcFilesWithSetup(DoSrcFileMakeCompile);
WriteBlankLineToDestFile();
WriteDestFileLn("ObjFiles = \\");
++DestFileIndent;
DoAllSrcFilesStandardMakeObjects();
WriteBlankLineToDestFile();
--DestFileIndent;
WriteBlankLineToDestFile();
WriteMakeRule(WriteMainRsrcObjPath,
WriteMainRsrcObjMSCdeps, WriteMainRsrcObjDMCbuild);
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteAppNamePath();
WriteCStrToDestFile(": $(ObjFiles) ");
WriteMainRsrcObjPath();
WriteEndDestFileLn();
++DestFileIndent;
WriteBgnDestFileLn();
WriteCStrToDestFile(
"dmc.exe -L/exet:nt/su:windows:4.0 $(ObjFiles) ");
WriteMainRsrcObjPath();
WriteCStrToDestFile(" -o\"");
WriteAppNamePath();
WriteCStrToDestFile(
"\" winmm.lib ole32.lib uuid.lib comdlg32.lib shell32.lib"
" gdi32.lib");
WriteEndDestFileLn();
--DestFileIndent;
WriteBlankLineToDestFile();
WriteDestFileLn("clean:");
++DestFileIndent;
DoAllSrcFilesStandardErase();
WriteRmFile(WriteMainRsrcObjPath);
WriteRmFile(WriteAppNamePath);
--DestFileIndent;
}
LOCALPROC WriteDMCSpecificFiles(void)
{
WriteADstFile1("my_project_d",
"Makefile", "", "Make file",
WriteDMCclMakeFile);
}

170
setup/WRDVCFLS.i Normal file
View File

@ -0,0 +1,170 @@
/*
WRDVCFLS.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite bloodshed DeV-C++ specific FiLeS
*/
static void DoSrcFileDvcAddFile(void)
{
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("[Unit");
WriteUnsignedToOutput(FileCounter + 1);
WriteCStrToDestFile("]");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("FileName=");
WriteSrcFileFilePath();
WriteEndDestFileLn();
WriteDestFileLn("CompileCpp=0");
WriteBgnDestFileLn();
WriteCStrToDestFile("Folder=");
WriteAppVariationStr();
WriteEndDestFileLn();
WriteDestFileLn("Compile=1");
WriteDestFileLn("Link=1");
WriteDestFileLn("Priority=1000");
WriteDestFileLn("OverrideBuildCmd=0");
WriteDestFileLn("BuildCmd=");
}
LOCALPROC WriteDevCProjectFile(void)
{
WriteDestFileLn("[Project]");
WriteBgnDestFileLn();
WriteCStrToDestFile("FileName=");
WriteStrAppAbbrev();
WriteCStrToDestFile(".dev");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("Name=");
WriteAppVariationStr();
WriteEndDestFileLn();
DoAllSrcFilesWithSetup(NullProc);
++FileCounter; /* main.rc */
WriteBgnDestFileLn();
WriteCStrToDestFile("UnitCount=");
WriteUnsignedToOutput(FileCounter);
WriteEndDestFileLn();
WriteDestFileLn("Type=0");
WriteDestFileLn("Ver=1");
WriteBgnDestFileLn();
WriteCStrToDestFile("Includes=");
Write_cfg_d_ToDestFile();
WriteCStrToDestFile(" ");
Write_src_d_ToDestFile();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("PrivateResource=");
WriteAppVariationStr();
WriteCStrToDestFile("_private.rc");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("ResourceIncludes=");
Write_src_d_ToDestFile();
WriteEndDestFileLn();
WriteDestFileLn("IsCpp=0");
WriteBgnDestFileLn();
WriteCStrToDestFile("ObjectOutput=");
Write_obj_d_ToDestFile();
WriteEndDestFileLn();
WriteDestFileLn("OverrideOutput=1");
WriteBgnDestFileLn();
WriteCStrToDestFile("OverrideOutputName=");
WriteAppNamePath();
WriteEndDestFileLn();
WriteDestFileLn("IncludeVersionInfo=0");
WriteDestFileLn("CompilerSet=0");
if (gbk_dbg_on == gbo_dbg) {
WriteDestFileLn("CompilerSettings=000000000000000100");
WriteDestFileLn(
"Compiler= -Wall -Wstrict-prototypes"
" -Wno-uninitialized -O0_@@_");
} else {
WriteDestFileLn("CompilerSettings=000000000000000000");
WriteDestFileLn(
"Compiler= -Wall -Wstrict-prototypes"
" -Wno-uninitialized -Os_@@_");
}
WriteDestFileLn("Linker=-lwinmm -lole32 -luuid_@@_");
WriteBlankLineToDestFile();
WriteDestFileLn("[VersionInfo]");
WriteDestFileLn("Major=0");
WriteDestFileLn("Minor=1");
WriteDestFileLn("Release=1");
WriteDestFileLn("Build=1");
WriteDestFileLn("LanguageID=1033");
WriteDestFileLn("CharsetID=1252");
WriteDestFileLn("CompanyName=");
WriteDestFileLn("FileVersion=");
WriteDestFileLn("FileDescription=Developed using the Dev-C++ IDE");
WriteDestFileLn("InternalName=");
WriteDestFileLn("LegalCopyright=");
WriteDestFileLn("LegalTrademarks=");
WriteDestFileLn("OriginalFilename=");
WriteDestFileLn("ProductName=");
WriteDestFileLn("ProductVersion=");
WriteDestFileLn("AutoIncBuildNr=0");
DoAllSrcFilesWithSetup(DoSrcFileDvcAddFile);
WriteBlankLineToDestFile();
WriteBgnDestFileLn();
WriteCStrToDestFile("[Unit");
WriteUnsignedToOutput(++FileCounter);
WriteCStrToDestFile("]");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("FileName=");
WriteMainRsrcSrcPath();
WriteEndDestFileLn();
WriteDestFileLn("CompileCpp=0");
WriteBgnDestFileLn();
WriteCStrToDestFile("Folder=");
WriteAppVariationStr();
WriteEndDestFileLn();
WriteDestFileLn("Compile=1");
WriteDestFileLn("Link=0");
WriteDestFileLn("Priority=1000");
WriteDestFileLn("OverrideBuildCmd=0");
WriteDestFileLn("BuildCmd=");
WriteBlankLineToDestFile();
}
LOCALPROC WriteDevCSpecificFiles(void)
{
WriteADstFile1("my_project_d",
vStrAppAbbrev, ".dev", "Project file",
WriteDevCProjectFile);
}

252
setup/WRLCCFLS.i Normal file
View File

@ -0,0 +1,252 @@
/*
WRLCCFLS.i
Copyright (C) 2007 Paul C. Pratt
You can redistribute this file and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. You should have received a copy
of the license along with this file; see the file COPYING.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license for more details.
*/
/*
WRite LCC-win32 specific FiLeS
*/
LOCALPROC DoSrcFileLccAddFile(void)
{
WriteBgnDestFileLn();
WriteCStrToDestFile("File");
WriteUnsignedToOutput(FileCounter + 1);
WriteCStrToDestFile("=");
WriteSrcFileFilePath();
WriteEndDestFileLn();
}
LOCALPROC WriteLccErrFileName(void)
{
WriteStrAppAbbrev();
WriteCStrToDestFile(".err");
}
LOCALPROC WriteLccErrFilePath(void)
{
WriteFileInDirToDestFile0(Write_obj_d_ToDestFile,
WriteLccErrFileName);
}
LOCALPROC WriteLccW32WorkSpaceFile(void)
{
WriteDestFileLn("; Wedit project file. Syntax: Name = value");
WriteBgnDestFileLn();
WriteCStrToDestFile("[");
WriteAppVariationStr();
WriteCStrToDestFile("]");
WriteEndDestFileLn();
DoAllSrcFilesWithSetup(NullProc);
++FileCounter; /* main.rc */
WriteBgnDestFileLn();
WriteCStrToDestFile("PrjFiles=");
WriteUnsignedToOutput(FileCounter);
WriteEndDestFileLn();
DoAllSrcFilesWithSetup(DoSrcFileLccAddFile);
WriteBgnDestFileLn();
WriteCStrToDestFile("File");
WriteUnsignedToOutput(++FileCounter);
WriteCStrToDestFile("=");
WriteMainRsrcSrcPath();
WriteEndDestFileLn();
WriteDestFileLn("ProjectFlags=0");
WriteBgnDestFileLn();
WriteCStrToDestFile("Name=");
WriteAppVariationStr();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("ProjectPath=");
WriteCStrToDestFile("c:\\output");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("SourcesDir=");
/* setting it to my_c_src_d does not work */
WriteCStrToDestFile("c:\\output");
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("Includes=");
Write_cfg_d_ToDestFile();
WriteCStrToDestFile(" ");
Write_src_d_ToDestFile();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("MakeDir=");
Write_obj_d_ToDestFile();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("Exe=");
WriteAppNamePath();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("DbgExeName=");
WriteAppNamePath();
WriteEndDestFileLn();
WriteBgnDestFileLn();
WriteCStrToDestFile("DbgDir=");
Write_obj_d_ToDestFile();
WriteEndDestFileLn();
switch