Added packaging directories; modified default config file to remove nonstandard path.
ghedger
4 years ago
0 | #pragma once | |
1 | ||
2 | // This file centralizes the configuration management (save files, opts.ini) | |
3 | // | |
4 | // Copyright (C) 2017 Greg Hedger | |
5 | ||
6 | #include <string> | |
7 | ||
8 | #define USER_DIRECTORY_NAME "/linapple/" | |
9 | #define CONF_DIRECTORY_NAME "/conf/" | |
10 | #define SAVED_DIRECTORY_NAME "/saved/" | |
11 | #define FTP_DIRECTORY_NAME "/ftp/" | |
12 | #define INSTALL_DIRECTORY_NAME "/etc/linapple/" | |
13 | #define MAX_FILENAME_LENGTH 255 | |
14 | ||
15 | class Config | |
16 | { | |
17 | public: | |
18 | // Constructor/Destructor | |
19 | Config(); | |
20 | ~Config() {}; | |
21 | ||
22 | void ChangeToHomeDirectory(); | |
23 | void ChangeToUserDirectory(); | |
24 | bool ValidateUserDirectory(); | |
25 | bool CopyFile(std::string source, std::string dest); | |
26 | std::string GetUserFilePath(); | |
27 | protected: | |
28 | std::string GetHomePath(); | |
29 | std::string GetInstallPath(); | |
30 | private: | |
31 | std::string m_optsFilePath; | |
32 | }; | |
33 |
0 | etc/linapple/charset40.bmp | |
1 | etc/linapple/font.bmp | |
2 | etc/linapple/splash.bmp | |
3 | etc/linapple/Printer.txt | |
4 | etc/linapple/Master.dsk | |
5 | etc/linapple/LICENSE | |
6 | etc/linapple/linapple.conf | |
7 | etc/linapple/icon.bmp |
0 | Package: linapple | |
1 | Version: 2.1 | |
2 | Maintainer: Greg Hedger | |
3 | Architecture: all | |
4 | Depends: libsdl1.2-dev, libsdl-mixer1.2-dev, libzip4, libcurl3, libcurl-ocaml-dev | |
5 | Description: A Linux emulator for Apple ][+ IIe, and enhanced //e w/Mockingboard support |
0 | LinApple version 2.1 | |
1 | 28 November 2017 | |
2 | ||
3 | !! Keyboard: Fixed caps lock bug. | |
4 | ||
5 | !! Display: Set higher default host screen resolution in windowed mode. | |
6 | ||
7 | !! Audio: Eliminated decoupling capacitor simulation. | |
8 | ||
9 | !! Audio: Fixed choppy Mockingboard sound due to incorrect cycle caculation between IRQs. | |
10 | ||
11 | For LinApple version 2.0 has been made: | |
12 | ||
13 | !! Fixed screen corruption bug for x64 systems | |
14 | ||
15 | !! Fixed gcc 4.4 compilation error lacking <strings> | |
16 | ||
17 | ++ FTP support. You can load disk images on Slots 6 (1 & 2) and Hard disks images, using FTP server such as apple.asimov.net | |
18 | Press Alt+F3, Alt+Shift+F3 for load disk image through FTP | |
19 | ||
20 | ++ Screen sizes are now flexible. You can set any screen size you wish, just be catious - not all screen sizes can work in full screen mode | |
21 | ||
22 | ++ .zip images support for FDD 140K (in read-only mode). Just first file in .zip archive will be read and inserted as an image. | |
23 | You can load .zip images directly from your file system (by F3/F4 keypress), or from FTP server (by pressing ALT+F3(F4)). | |
24 | ||
25 | -- Sound is still glitched. Needs repairing. Please help! | |
26 | ||
27 | ||
28 | For LinApple version 1.1 has been added: | |
29 | ||
30 | ++ 1. Opening of compressed .gz files - in read-only mode. Works only for FDD 140Kb drives. | |
31 | ||
32 | ++ 2. Super quick load-save states (CTRL+0..9 - quick load state, CTRL+SHIFT+0..9 - quick save it) in current states directory. | |
33 | ||
34 | ++ 3. Add Mockingboard (but not Phasor??) support, without speech, as I could take it. | |
35 | But Mockingboard works! You may test it in such games as Berzap! (you need to switch Mockingboard on after pressing Ctrl+C in the game), in Willy Byte in the Digital Dimensions, in Pitfall II(tm), in UltimaIV and few others. | |
36 | ||
37 | ++ 4. VideoBenchmark added! Run `linapple -b' to see benchmark running and its result in console. | |
38 | ||
39 | ++ 5. Parallel Printer file name can be set in linapple.conf (default was Printer.txt in working directory) |
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |
4 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Library General Public License instead.) You can apply it to | |
18 | your programs, too. | |
19 | ||
20 | When we speak of free software, we are referring to freedom, not | |
21 | price. Our General Public Licenses are designed to make sure that you | |
22 | have the freedom to distribute copies of free software (and charge for | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
31 | ||
32 | For example, if you distribute copies of such a program, whether | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
54 | ||
55 | The precise terms and conditions for copying, distribution and | |
56 | modification follow. | |
57 | ||
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
194 | this License. | |
195 | ||
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
199 | otherwise) that contradict the conditions of this License, they do not | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
238 | be similar in spirit to the present version, but may differ in detail to | |
239 | address new problems or concerns. | |
240 | ||
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
282 | ||
283 | If you develop a new program, and you want it to be of the greatest | |
284 | possible use to the public, the best way to achieve this is to make it | |
285 | free software which everyone can redistribute and change under these terms. | |
286 | ||
287 | To do so, attach the following notices to the program. It is safest | |
288 | to attach them to the start of each source file to most effectively | |
289 | convey the exclusion of warranty; and each file should have at least | |
290 | the "copyright" line and a pointer to where the full notice is found. | |
291 | ||
292 | <one line to give the program's name and a brief idea of what it does.> | |
293 | Copyright (C) <year> <name of author> | |
294 | ||
295 | This program is free software; you can redistribute it and/or modify | |
296 | it under the terms of the GNU General Public License as published by | |
297 | the Free Software Foundation; either version 2 of the License, or | |
298 | (at your option) any later version. | |
299 | ||
300 | This program is distributed in the hope that it will be useful, | |
301 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
303 | GNU General Public License for more details. | |
304 | ||
305 | You should have received a copy of the GNU General Public License | |
306 | along with this program; if not, write to the Free Software | |
307 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
308 | ||
309 | ||
310 | Also add information on how to contact you by electronic and paper mail. | |
311 | ||
312 | If the program is interactive, make it output a short notice like this | |
313 | when it starts in an interactive mode: | |
314 | ||
315 | Gnomovision version 69, Copyright (C) year name of author | |
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
317 | This is free software, and you are welcome to redistribute it | |
318 | under certain conditions; type `show c' for details. | |
319 | ||
320 | The hypothetical commands `show w' and `show c' should show the appropriate | |
321 | parts of the General Public License. Of course, the commands you use may | |
322 | be called something other than `show w' and `show c'; they could even be | |
323 | mouse-clicks or menu items--whatever suits your program. | |
324 | ||
325 | You should also get your employer (if you work as a programmer) or your | |
326 | school, if any, to sign a "copyright disclaimer" for the program, if | |
327 | necessary. Here is a sample; alter the names: | |
328 | ||
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
331 | ||
332 | <signature of Ty Coon>, 1 April 1989 | |
333 | Ty Coon, President of Vice | |
334 | ||
335 | This General Public License does not permit incorporating your program into | |
336 | proprietary programs. If your program is a subroutine library, you may | |
337 | consider it more useful to permit linking proprietary applications with the | |
338 | library. If this is what you want to do, use the GNU Library General | |
339 | Public License instead of this License. |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | # | |
1 | # linapple.conf - config file used by LinApple, Apple][ (Apple2, Apple 2) emulator for Linux and other POSIX systems with SDL support | |
2 | # | |
3 | # for linapple version 2.0 and above | |
4 | # | |
5 | # Please remember - all lines beginning with '#' are considered comments. | |
6 | # All values are CASE SENSITIVE, you should not use, for example, 'joystick 0' instead of 'Joystick 0'. | |
7 | # | |
8 | #################################################################### | |
9 | # First of all let us determine our machine type | |
10 | # that is: | |
11 | # 0 - old Apple][, right out of the hands of Steve Wozniak and Steve Jobs in far 1977? year. | |
12 | # 1 - Apple][+ - same as Apple][ with somewhat enbettered functionality | |
13 | # 2 - Apple//e - Enhanced Apple][ with 80-column mode and other useful additions | |
14 | # 3 - Apple//e enhanced - currently same as Apple//e? Please, ask Tom Charlesworth about it. | |
15 | # Default is 3 | |
16 | ||
17 | Computer Emulation = 2 | |
18 | ||
19 | #################################################################### | |
20 | # | |
21 | # Sound Emulation. | |
22 | # Possible values currently are 0 - none, and 1 - use SDL Audio for sounds | |
23 | # Default is 1 | |
24 | ||
25 | Sound Emulation = 1 | |
26 | ||
27 | ####################################################################### | |
28 | # | |
29 | # Soundcard Type means what do you want to use in Slot7 as a sound card | |
30 | # | |
31 | # 0 - uninit //?? | |
32 | # 1 - nothing - disable sound card in Slot 4 | |
33 | # 2 - use Mockingboard in Slot 4 (Mockingboard is like SoundBlaster for PC, if you hear about it) | |
34 | # 3 - use Phasor in Slot 4. Phasor is also a sort of ancient sound cards. Ahhh, what sounds they have!!! | |
35 | # | |
36 | # Default value is 2 (use Mockingboard). | |
37 | # But, please, remember, that currently Mockingboard/Phasor support was not done fully in linapple. | |
38 | # I need some help for this to port it from AppleWin. ^_^ | |
39 | ||
40 | Soundcard Type = 2 | |
41 | ||
42 | ####################################################################### | |
43 | # | |
44 | # Joysticks, those sticks of joy! There may be 2 joysticks at the same time | |
45 | # Possible values are: | |
46 | # 0 - joystick disabled | |
47 | # 1 - use PC joystick #1 or #2, for corresponding joystick | |
48 | ||
49 | # 2 - Keyboard standard | |
50 | # 3 - Keyboard centered | |
51 | # When joysticks used as a keyboard, they are stuck to Numpad keys (1-9 - axis movement, 0 - button1, . - button2) | |
52 | # when centered used, axis of joystick will be centered after releasing any cursor (Numpad 1..9) key. | |
53 | # otherwise it assumed to be pressed always | |
54 | ||
55 | # 4 - Use mouse as a joystick. Rather interesting thing, try it. Useful in Fantavision(tm)by Broderbund Software | |
56 | # Default values are 2 for Joystick 0, and 0 for Joystick 1 | |
57 | ||
58 | Joystick 0 = 3 | |
59 | Joystick 1 = 0 | |
60 | ||
61 | ########################################################################## | |
62 | # | |
63 | # Serial Port joins your Apple][ machine to any device through serial ports. | |
64 | # Possible values are 0 - disabled, and 1 to 100 which means device /dev/ttyS0 .. /dev/ttyS99 relatively | |
65 | # | |
66 | # Default is 0, disabled. Needs testing. | |
67 | ||
68 | Serial Port = 0 | |
69 | ||
70 | ########################################################################## | |
71 | ||
72 | # Emulation Speed is speed of emulator. | |
73 | # Values are from 0 (lowest speed) till 40 (fastest) | |
74 | # Default value is 10 (normal speed) | |
75 | ||
76 | Emulation Speed = 10 | |
77 | ||
78 | ########################################################################## | |
79 | # | |
80 | # Enhance Disk Speed - if the disk spinning should be as in real computer | |
81 | # Possible values - 0 - yes, the disk spinning speed is like in real Apple][ | |
82 | # and 1 - use enhanced disk speed. | |
83 | # Default is 1. | |
84 | ||
85 | Enhance Disk Speed = 1 | |
86 | ||
87 | ########################################################################## | |
88 | # | |
89 | # Video Emulation - a type of video emulation. | |
90 | # Please, remember that you always can change it using F9 key in emulator. | |
91 | ||
92 | # Possible values are: | |
93 | # 0 - use monochrome screen with given color as white (see below Monochrome Color section) | |
94 | ||
95 | # Color modes, which names speak for themselves. | |
96 | # 1 - Color Standard | |
97 | # 2 - Color Text Optimized | |
98 | # 3 - Color TV emulation | |
99 | # 4 - Color Half-Shift | |
100 | ||
101 | # Monochrome modes with predefined monochrome colors | |
102 | # 5 - Monochrome Amber | |
103 | # 6 - Monochrome Green | |
104 | # 7 - Monochrome White | |
105 | # | |
106 | # Default value is 3 - Color TV emulation! | |
107 | ||
108 | Video Emulation = 1 | |
109 | ||
110 | ########################################################################## | |
111 | # | |
112 | # Monochrome Color - define monochrome color that suit you best here. | |
113 | # Color defined as #RRGGBB, where RR - 2 digits for Red color intensity, GG - same for Green color, and BB for Blue. | |
114 | # All digits are in HEX-format, 0-9 and A - F. | |
115 | # Default value is #C0C0C0. | |
116 | ||
117 | Monochrome Color = #FFC010 | |
118 | ||
119 | ########################################################################## | |
120 | # | |
121 | # Mouse in slot 4. Yes, old Apples][ have it! First they saw it in Xerox Development Center. | |
122 | # Possible values are 0 - off, and 1 - on. | |
123 | # Remember, that you can not use Mouse and Mockingboard/Phasor at the same time, for they use same slot (#4). | |
124 | # So, before enabling mouse support in your machine, switch off Mockingboard (see section above). | |
125 | ||
126 | # Default is 0. | |
127 | ||
128 | Mouse in slot 4 = 0 | |
129 | ||
130 | ########################################################################## | |
131 | # | |
132 | # Parallel printer allows you to print any DOS3.3 or Applesoft Basic(tm) output to specified file | |
133 | # (after PR#1 at DOS3.3 prompt) | |
134 | # | |
135 | # Default is Printer.txt in working directory (which is set inside linapple bin) | |
136 | ||
137 | Parallel Printer Filename = | |
138 | ||
139 | ########################################################################## | |
140 | # | |
141 | # HDD - Hard Disk Device for Apple][ | |
142 | # | |
143 | # Harddisk Enable. Same as for mouse. 0 means no Harddisk support, and 1 - yes, give that Harddisk! | |
144 | # Remember, that hard disk images for Apple][ are in .HDV format as a rule (with .hdv extensions) | |
145 | # Hard disk uses Slot 7 in Apple][. So, to access it use something like '] PR#7' at Applesoft Basic(tm) prompt. | |
146 | # Default is 0. | |
147 | ||
148 | Harddisk Enable = 0 | |
149 | ||
150 | # HDV Starting Directory is the starting directory for choose HDV disk images | |
151 | # Default: your home directory (if not set) | |
152 | ||
153 | HDV Starting Directory = | |
154 | ||
155 | # And you may also predefine hard disk images here, for 1 and 2 correspondingly. | |
156 | # Please, use Shift+F3 and Shift+F4 in emulator for change them in real time. | |
157 | # Remember, that values given here will be rewritten if you change them in emulator. | |
158 | # Default - do not use any HDV images | |
159 | ||
160 | Harddisk Image 1 = | |
161 | Harddisk Image 2 = | |
162 | ||
163 | ########################################################################## | |
164 | # | |
165 | # Slot 6 Directory - starting directory for chosing Apple's disk images in slot 6 | |
166 | # (usual slot for FDD 140Kb Apple's disks) | |
167 | # | |
168 | # Default: your home directory (if not set) | |
169 | ||
170 | Slot 6 Directory = /home/ghedger/projects/apple2/Emulators/Apple2/ultima_IV | |
171 | ||
172 | # You may also provide images to be inserted in 1 and 2 drive (D1 or D2) of Slot 6 at startup | |
173 | # Default: do not use, starting with image named Master.dsk in current directory | |
174 | ||
175 | # To get access to the disk in second drive(D2), use something like '] CATALOG,D2' at Applesoft DOS(tm) prompt. | |
176 | ||
177 | Disk Image 1 = | |
178 | Disk Image 2 = | |
179 | ||
180 | # The next parameter defines if you wish to auto-load these disk images in drives at startup! | |
181 | # Default value is 0 (Off), suggested: 1 (On) | |
182 | ||
183 | Slot 6 Autoload = 0 | |
184 | ||
185 | ########################################################################## | |
186 | # | |
187 | # Save State Filename - file name for saving/loading state with keys F11 and F12 in emulator. | |
188 | # Default is none. Note: you can choose it at runtime by pressing F11 (for saving) or F12 (for loading) | |
189 | ||
190 | Save State Filename = | |
191 | ||
192 | # SaveSate Directory is a directory where current states will be saved by using F11,F12 (or ALT+F11, ALT+F12 keys, or Ctrl+0..9, Ctrl+Shift+0..9) | |
193 | #Default is none, which means your home directory | |
194 | ||
195 | Save State Directory = | |
196 | ||
197 | # Define if you wish to save state on exit and restore it at startup by the next parameter: | |
198 | # Possible values are 0 - off, and 1 - on. When On, save state will be saved in Save State Filename at exit, | |
199 | # and will be restored at startup | |
200 | ||
201 | # Default value is 0. | |
202 | ||
203 | Save State On Exit = 0 | |
204 | ||
205 | ########################################################################## | |
206 | # | |
207 | # Next parameters enables some functions at startup | |
208 | # | |
209 | # Fullscreen - if emulator should startup in Fullscreen mode (0 - no, 1 - yes!) | |
210 | # Boot at startup - if emulator should boot after starting up from Disk1 in SLot 6 (0 - yes, 1 - no) | |
211 | # Booting at startup disables show logo. | |
212 | # | |
213 | # Show Leds 1/0 - show leds while accessing disks (140Kb and HDD) or not, default - 1 | |
214 | ||
215 | Fullscreen = 0 | |
216 | Boot at Startup = 0 | |
217 | Show Leds = 1 | |
218 | ||
219 | ########################################################################## | |
220 | # | |
221 | # FTP Server - full path to default FTP server with Apple2 disk images | |
222 | # FTP UserPass - user:password for accessing this server | |
223 | # FTP Local Dir - path on local disk to store downloaded ftp files, | |
224 | ||
225 | # !!! Warning: FTP Local Dir should be existing directory with write access either FTP won't work | |
226 | # Note : FTP Server MUST end with '/' sign either it won't work! FTP Local Dir should not end with '/' | |
227 | ||
228 | FTP Server = ftp://ftp.apple.asimov.net/pub/apple_II/images/games/ | |
229 | FTP ServerHDD = ftp://ftp.apple.asimov.net/pub/apple_II/images/ | |
230 | FTP UserPass = anonymous:my-mail@mail.com | |
231 | FTP Local Dir = | |
232 | ||
233 | ########################################################################## | |
234 | # | |
235 | # Screen properties | |
236 | # Note: not all screen sizes can work in full screen mode, so be careful | |
237 | # Also if you are using not default mode, the speed of emulator can become slow, | |
238 | # which can be spotted easily on old machines | |
239 | ||
240 | # Use this as screen factor in zooming screen. | |
241 | # Values less than 1.0 will make screen smaller and vice versa! | |
242 | # Suggested values are 0.3 till 3.0? | |
243 | ||
244 | # Screen factor = 1.5 | |
245 | ||
246 | # Note: if you want to use Screen Width and Screen Height directly, comment out `Screen factor` whole option | |
247 | # otherwise they won't take effect | |
248 | # Default Screen Width is 560, Screen Height is 384 | |
249 | # For best results, use a height divisible by 192 to avoid moire artifacts when using scanline video effects | |
250 | Screen Width = 1120 | |
251 | Screen Height = 768 | |
252 |
Binary diff not shown
0 | LinApple version 2.1 | |
1 | 28 November 2017 | |
2 | ||
3 | !! Keyboard: Fixed caps lock bug. | |
4 | ||
5 | !! Display: Set higher default host screen resolution in windowed mode. | |
6 | ||
7 | !! Audio: Eliminated decoupling capacitor simulation. | |
8 | ||
9 | !! Audio: Fixed choppy Mockingboard sound due to incorrect cycle caculation between IRQs. | |
10 | ||
11 | For LinApple version 2.0 has been made: | |
12 | ||
13 | !! Fixed screen corruption bug for x64 systems | |
14 | ||
15 | !! Fixed gcc 4.4 compilation error lacking <strings> | |
16 | ||
17 | ++ FTP support. You can load disk images on Slots 6 (1 & 2) and Hard disks images, using FTP server such as apple.asimov.net | |
18 | Press Alt+F3, Alt+Shift+F3 for load disk image through FTP | |
19 | ||
20 | ++ Screen sizes are now flexible. You can set any screen size you wish, just be catious - not all screen sizes can work in full screen mode | |
21 | ||
22 | ++ .zip images support for FDD 140K (in read-only mode). Just first file in .zip archive will be read and inserted as an image. | |
23 | You can load .zip images directly from your file system (by F3/F4 keypress), or from FTP server (by pressing ALT+F3(F4)). | |
24 | ||
25 | -- Sound is still glitched. Needs repairing. Please help! | |
26 | ||
27 | ||
28 | For LinApple version 1.1 has been added: | |
29 | ||
30 | ++ 1. Opening of compressed .gz files - in read-only mode. Works only for FDD 140Kb drives. | |
31 | ||
32 | ++ 2. Super quick load-save states (CTRL+0..9 - quick load state, CTRL+SHIFT+0..9 - quick save it) in current states directory. | |
33 | ||
34 | ++ 3. Add Mockingboard (but not Phasor??) support, without speech, as I could take it. | |
35 | But Mockingboard works! You may test it in such games as Berzap! (you need to switch Mockingboard on after pressing Ctrl+C in the game), in Willy Byte in the Digital Dimensions, in Pitfall II(tm), in UltimaIV and few others. | |
36 | ||
37 | ++ 4. VideoBenchmark added! Run `linapple -b' to see benchmark running and its result in console. | |
38 | ||
39 | ++ 5. Parallel Printer file name can be set in linapple.conf (default was Printer.txt in working directory) |
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |
4 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Library General Public License instead.) You can apply it to | |
18 | your programs, too. | |
19 | ||
20 | When we speak of free software, we are referring to freedom, not | |
21 | price. Our General Public Licenses are designed to make sure that you | |
22 | have the freedom to distribute copies of free software (and charge for | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
31 | ||
32 | For example, if you distribute copies of such a program, whether | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
54 | ||
55 | The precise terms and conditions for copying, distribution and | |
56 | modification follow. | |
57 | ||
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
194 | this License. | |
195 | ||
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
199 | otherwise) that contradict the conditions of this License, they do not | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
238 | be similar in spirit to the present version, but may differ in detail to | |
239 | address new problems or concerns. | |
240 | ||
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
282 | ||
283 | If you develop a new program, and you want it to be of the greatest | |
284 | possible use to the public, the best way to achieve this is to make it | |
285 | free software which everyone can redistribute and change under these terms. | |
286 | ||
287 | To do so, attach the following notices to the program. It is safest | |
288 | to attach them to the start of each source file to most effectively | |
289 | convey the exclusion of warranty; and each file should have at least | |
290 | the "copyright" line and a pointer to where the full notice is found. | |
291 | ||
292 | <one line to give the program's name and a brief idea of what it does.> | |
293 | Copyright (C) <year> <name of author> | |
294 | ||
295 | This program is free software; you can redistribute it and/or modify | |
296 | it under the terms of the GNU General Public License as published by | |
297 | the Free Software Foundation; either version 2 of the License, or | |
298 | (at your option) any later version. | |
299 | ||
300 | This program is distributed in the hope that it will be useful, | |
301 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
303 | GNU General Public License for more details. | |
304 | ||
305 | You should have received a copy of the GNU General Public License | |
306 | along with this program; if not, write to the Free Software | |
307 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
308 | ||
309 | ||
310 | Also add information on how to contact you by electronic and paper mail. | |
311 | ||
312 | If the program is interactive, make it output a short notice like this | |
313 | when it starts in an interactive mode: | |
314 | ||
315 | Gnomovision version 69, Copyright (C) year name of author | |
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
317 | This is free software, and you are welcome to redistribute it | |
318 | under certain conditions; type `show c' for details. | |
319 | ||
320 | The hypothetical commands `show w' and `show c' should show the appropriate | |
321 | parts of the General Public License. Of course, the commands you use may | |
322 | be called something other than `show w' and `show c'; they could even be | |
323 | mouse-clicks or menu items--whatever suits your program. | |
324 | ||
325 | You should also get your employer (if you work as a programmer) or your | |
326 | school, if any, to sign a "copyright disclaimer" for the program, if | |
327 | necessary. Here is a sample; alter the names: | |
328 | ||
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
331 | ||
332 | <signature of Ty Coon>, 1 April 1989 | |
333 | Ty Coon, President of Vice | |
334 | ||
335 | This General Public License does not permit incorporating your program into | |
336 | proprietary programs. If your program is a subroutine library, you may | |
337 | consider it more useful to permit linking proprietary applications with the | |
338 | library. If this is what you want to do, use the GNU Library General | |
339 | Public License instead of this License. |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | # | |
1 | # linapple.conf - config file used by LinApple, Apple][ (Apple2, Apple 2) emulator for Linux and other POSIX systems with SDL support | |
2 | # | |
3 | # for linapple version 2.0 and above | |
4 | # | |
5 | # Please remember - all lines beginning with '#' are considered comments. | |
6 | # All values are CASE SENSITIVE, you should not use, for example, 'joystick 0' instead of 'Joystick 0'. | |
7 | # | |
8 | #################################################################### | |
9 | # First of all let us determine our machine type | |
10 | # that is: | |
11 | # 0 - old Apple][, right out of the hands of Steve Wozniak and Steve Jobs in far 1977? year. | |
12 | # 1 - Apple][+ - same as Apple][ with somewhat enbettered functionality | |
13 | # 2 - Apple//e - Enhanced Apple][ with 80-column mode and other useful additions | |
14 | # 3 - Apple//e enhanced - currently same as Apple//e? Please, ask Tom Charlesworth about it. | |
15 | # Default is 3 | |
16 | ||
17 | Computer Emulation = 2 | |
18 | ||
19 | #################################################################### | |
20 | # | |
21 | # Sound Emulation. | |
22 | # Possible values currently are 0 - none, and 1 - use SDL Audio for sounds | |
23 | # Default is 1 | |
24 | ||
25 | Sound Emulation = 1 | |
26 | ||
27 | ####################################################################### | |
28 | # | |
29 | # Soundcard Type means what do you want to use in Slot7 as a sound card | |
30 | # | |
31 | # 0 - uninit //?? | |
32 | # 1 - nothing - disable sound card in Slot 4 | |
33 | # 2 - use Mockingboard in Slot 4 (Mockingboard is like SoundBlaster for PC, if you hear about it) | |
34 | # 3 - use Phasor in Slot 4. Phasor is also a sort of ancient sound cards. Ahhh, what sounds they have!!! | |
35 | # | |
36 | # Default value is 2 (use Mockingboard). | |
37 | # But, please, remember, that currently Mockingboard/Phasor support was not done fully in linapple. | |
38 | # I need some help for this to port it from AppleWin. ^_^ | |
39 | ||
40 | Soundcard Type = 2 | |
41 | ||
42 | ####################################################################### | |
43 | # | |
44 | # Joysticks, those sticks of joy! There may be 2 joysticks at the same time | |
45 | # Possible values are: | |
46 | # 0 - joystick disabled | |
47 | # 1 - use PC joystick #1 or #2, for corresponding joystick | |
48 | ||
49 | # 2 - Keyboard standard | |
50 | # 3 - Keyboard centered | |
51 | # When joysticks used as a keyboard, they are stuck to Numpad keys (1-9 - axis movement, 0 - button1, . - button2) | |
52 | # when centered used, axis of joystick will be centered after releasing any cursor (Numpad 1..9) key. | |
53 | # otherwise it assumed to be pressed always | |
54 | ||
55 | # 4 - Use mouse as a joystick. Rather interesting thing, try it. Useful in Fantavision(tm)by Broderbund Software | |
56 | # Default values are 2 for Joystick 0, and 0 for Joystick 1 | |
57 | ||
58 | Joystick 0 = 3 | |
59 | Joystick 1 = 0 | |
60 | ||
61 | ########################################################################## | |
62 | # | |
63 | # Serial Port joins your Apple][ machine to any device through serial ports. | |
64 | # Possible values are 0 - disabled, and 1 to 100 which means device /dev/ttyS0 .. /dev/ttyS99 relatively | |
65 | # | |
66 | # Default is 0, disabled. Needs testing. | |
67 | ||
68 | Serial Port = 0 | |
69 | ||
70 | ########################################################################## | |
71 | ||
72 | # Emulation Speed is speed of emulator. | |
73 | # Values are from 0 (lowest speed) till 40 (fastest) | |
74 | # Default value is 10 (normal speed) | |
75 | ||
76 | Emulation Speed = 10 | |
77 | ||
78 | ########################################################################## | |
79 | # | |
80 | # Enhance Disk Speed - if the disk spinning should be as in real computer | |
81 | # Possible values - 0 - yes, the disk spinning speed is like in real Apple][ | |
82 | # and 1 - use enhanced disk speed. | |
83 | # Default is 1. | |
84 | ||
85 | Enhance Disk Speed = 1 | |
86 | ||
87 | ########################################################################## | |
88 | # | |
89 | # Video Emulation - a type of video emulation. | |
90 | # Please, remember that you always can change it using F9 key in emulator. | |
91 | ||
92 | # Possible values are: | |
93 | # 0 - use monochrome screen with given color as white (see below Monochrome Color section) | |
94 | ||
95 | # Color modes, which names speak for themselves. | |
96 | # 1 - Color Standard | |
97 | # 2 - Color Text Optimized | |
98 | # 3 - Color TV emulation | |
99 | # 4 - Color Half-Shift | |
100 | ||
101 | # Monochrome modes with predefined monochrome colors | |
102 | # 5 - Monochrome Amber | |
103 | # 6 - Monochrome Green | |
104 | # 7 - Monochrome White | |
105 | # | |
106 | # Default value is 3 - Color TV emulation! | |
107 | ||
108 | Video Emulation = 1 | |
109 | ||
110 | ########################################################################## | |
111 | # | |
112 | # Monochrome Color - define monochrome color that suit you best here. | |
113 | # Color defined as #RRGGBB, where RR - 2 digits for Red color intensity, GG - same for Green color, and BB for Blue. | |
114 | # All digits are in HEX-format, 0-9 and A - F. | |
115 | # Default value is #C0C0C0. | |
116 | ||
117 | Monochrome Color = #FFC010 | |
118 | ||
119 | ########################################################################## | |
120 | # | |
121 | # Mouse in slot 4. Yes, old Apples][ have it! First they saw it in Xerox Development Center. | |
122 | # Possible values are 0 - off, and 1 - on. | |
123 | # Remember, that you can not use Mouse and Mockingboard/Phasor at the same time, for they use same slot (#4). | |
124 | # So, before enabling mouse support in your machine, switch off Mockingboard (see section above). | |
125 | ||
126 | # Default is 0. | |
127 | ||
128 | Mouse in slot 4 = 0 | |
129 | ||
130 | ########################################################################## | |
131 | # | |
132 | # Parallel printer allows you to print any DOS3.3 or Applesoft Basic(tm) output to specified file | |
133 | # (after PR#1 at DOS3.3 prompt) | |
134 | # | |
135 | # Default is Printer.txt in working directory (which is set inside linapple bin) | |
136 | ||
137 | Parallel Printer Filename = | |
138 | ||
139 | ########################################################################## | |
140 | # | |
141 | # HDD - Hard Disk Device for Apple][ | |
142 | # | |
143 | # Harddisk Enable. Same as for mouse. 0 means no Harddisk support, and 1 - yes, give that Harddisk! | |
144 | # Remember, that hard disk images for Apple][ are in .HDV format as a rule (with .hdv extensions) | |
145 | # Hard disk uses Slot 7 in Apple][. So, to access it use something like '] PR#7' at Applesoft Basic(tm) prompt. | |
146 | # Default is 0. | |
147 | ||
148 | Harddisk Enable = 0 | |
149 | ||
150 | # HDV Starting Directory is the starting directory for choose HDV disk images | |
151 | # Default: your home directory (if not set) | |
152 | ||
153 | HDV Starting Directory = | |
154 | ||
155 | # And you may also predefine hard disk images here, for 1 and 2 correspondingly. | |
156 | # Please, use Shift+F3 and Shift+F4 in emulator for change them in real time. | |
157 | # Remember, that values given here will be rewritten if you change them in emulator. | |
158 | # Default - do not use any HDV images | |
159 | ||
160 | Harddisk Image 1 = | |
161 | Harddisk Image 2 = | |
162 | ||
163 | ########################################################################## | |
164 | # | |
165 | # Slot 6 Directory - starting directory for chosing Apple's disk images in slot 6 | |
166 | # (usual slot for FDD 140Kb Apple's disks) | |
167 | # | |
168 | # Default: your home directory (if not set) | |
169 | ||
170 | Slot 6 Directory = /home/ghedger/projects/apple2/Emulators/Apple2/ultima_IV | |
171 | ||
172 | # You may also provide images to be inserted in 1 and 2 drive (D1 or D2) of Slot 6 at startup | |
173 | # Default: do not use, starting with image named Master.dsk in current directory | |
174 | ||
175 | # To get access to the disk in second drive(D2), use something like '] CATALOG,D2' at Applesoft DOS(tm) prompt. | |
176 | ||
177 | Disk Image 1 = | |
178 | Disk Image 2 = | |
179 | ||
180 | # The next parameter defines if you wish to auto-load these disk images in drives at startup! | |
181 | # Default value is 0 (Off), suggested: 1 (On) | |
182 | ||
183 | Slot 6 Autoload = 0 | |
184 | ||
185 | ########################################################################## | |
186 | # | |
187 | # Save State Filename - file name for saving/loading state with keys F11 and F12 in emulator. | |
188 | # Default is none. Note: you can choose it at runtime by pressing F11 (for saving) or F12 (for loading) | |
189 | ||
190 | Save State Filename = | |
191 | ||
192 | # SaveSate Directory is a directory where current states will be saved by using F11,F12 (or ALT+F11, ALT+F12 keys, or Ctrl+0..9, Ctrl+Shift+0..9) | |
193 | #Default is none, which means your home directory | |
194 | ||
195 | Save State Directory = | |
196 | ||
197 | # Define if you wish to save state on exit and restore it at startup by the next parameter: | |
198 | # Possible values are 0 - off, and 1 - on. When On, save state will be saved in Save State Filename at exit, | |
199 | # and will be restored at startup | |
200 | ||
201 | # Default value is 0. | |
202 | ||
203 | Save State On Exit = 0 | |
204 | ||
205 | ########################################################################## | |
206 | # | |
207 | # Next parameters enables some functions at startup | |
208 | # | |
209 | # Fullscreen - if emulator should startup in Fullscreen mode (0 - no, 1 - yes!) | |
210 | # Boot at startup - if emulator should boot after starting up from Disk1 in SLot 6 (0 - yes, 1 - no) | |
211 | # Booting at startup disables show logo. | |
212 | # | |
213 | # Show Leds 1/0 - show leds while accessing disks (140Kb and HDD) or not, default - 1 | |
214 | ||
215 | Fullscreen = 0 | |
216 | Boot at Startup = 0 | |
217 | Show Leds = 1 | |
218 | ||
219 | ########################################################################## | |
220 | # | |
221 | # FTP Server - full path to default FTP server with Apple2 disk images | |
222 | # FTP UserPass - user:password for accessing this server | |
223 | # FTP Local Dir - path on local disk to store downloaded ftp files, | |
224 | ||
225 | # !!! Warning: FTP Local Dir should be existing directory with write access either FTP won't work | |
226 | # Note : FTP Server MUST end with '/' sign either it won't work! FTP Local Dir should not end with '/' | |
227 | ||
228 | FTP Server = ftp://ftp.apple.asimov.net/pub/apple_II/images/games/ | |
229 | FTP ServerHDD = ftp://ftp.apple.asimov.net/pub/apple_II/images/ | |
230 | FTP UserPass = anonymous:my-mail@mail.com | |
231 | FTP Local Dir = | |
232 | ||
233 | ########################################################################## | |
234 | # | |
235 | # Screen properties | |
236 | # Note: not all screen sizes can work in full screen mode, so be careful | |
237 | # Also if you are using not default mode, the speed of emulator can become slow, | |
238 | # which can be spotted easily on old machines | |
239 | ||
240 | # Use this as screen factor in zooming screen. | |
241 | # Values less than 1.0 will make screen smaller and vice versa! | |
242 | # Suggested values are 0.3 till 3.0? | |
243 | ||
244 | # Screen factor = 1.5 | |
245 | ||
246 | # Note: if you want to use Screen Width and Screen Height directly, comment out `Screen factor` whole option | |
247 | # otherwise they won't take effect | |
248 | # Default Screen Width is 560, Screen Height is 384 | |
249 | # For best results, use a height divisible by 192 to avoid moire artifacts when using scanline video effects | |
250 | Screen Width = 1120 | |
251 | Screen Height = 768 | |
252 |
Binary diff not shown
71 | 71 | |
72 | 72 | # Emulation Speed is speed of emulator. |
73 | 73 | # Values are from 0 (lowest speed) till 40 (fastest) |
74 | # Default value is 10 (normal speed) | |
74 | # Default value is 10 (normal speed - 1 MHz) | |
75 | 75 | |
76 | 76 | Emulation Speed = 10 |
77 | 77 | |
167 | 167 | # |
168 | 168 | # Default: your home directory (if not set) |
169 | 169 | |
170 | Slot 6 Directory = /home/ghedger/projects/apple2/Emulators/Apple2/ultima_IV | |
170 | Slot 6 Directory = | |
171 | 171 | |
172 | 172 | # You may also provide images to be inserted in 1 and 2 drive (D1 or D2) of Slot 6 at startup |
173 | 173 | # Default: do not use, starting with image named Master.dsk in current directory |
175 | 175 | # To get access to the disk in second drive(D2), use something like '] CATALOG,D2' at Applesoft DOS(tm) prompt. |
176 | 176 | |
177 | 177 | Disk Image 1 = |
178 | Disk Image 2 = | |
178 | Disk Image 2 = | |
179 | 179 | |
180 | 180 | # The next parameter defines if you wish to auto-load these disk images in drives at startup! |
181 | 181 | # Default value is 0 (Off), suggested: 1 (On) |
224 | 224 | |
225 | 225 | # !!! Warning: FTP Local Dir should be existing directory with write access either FTP won't work |
226 | 226 | # Note : FTP Server MUST end with '/' sign either it won't work! FTP Local Dir should not end with '/' |
227 | # Note : Also there must be cache directory (e.g. directory named `cache` inside FTP Local Dir | |
228 | # where all downloaded directories are cached for 3 days | |
227 | 229 | |
228 | 230 | FTP Server = ftp://ftp.apple.asimov.net/pub/apple_II/images/games/ |
229 | 231 | FTP ServerHDD = ftp://ftp.apple.asimov.net/pub/apple_II/images/ |
234 | 236 | # |
235 | 237 | # Screen properties |
236 | 238 | # Note: not all screen sizes can work in full screen mode, so be careful |
237 | # Also if you are using not default mode, the speed of emulator can become slow, | |
238 | # which can be spotted easily on old machines | |
239 | # Also if you are using not default mode, the speed of emulator can fall, | |
240 | # which can be spotted on old machines | |
239 | 241 | |
240 | 242 | # Use this as screen factor in zooming screen. |
241 | 243 | # Values less than 1.0 will make screen smaller and vice versa! |
0 | // Central class for managing user configuration files and locations | |
1 | // | |
2 | // Copyright (C) 2017 Greg Hedger | |
3 | ||
4 | #include <string> | |
5 | #include <unistd.h> | |
6 | #include <sys/types.h> | |
7 | #include <pwd.h> | |
8 | #include <sys/stat.h> | |
9 | #include <iostream> | |
10 | #include <fcntl.h> | |
11 | #include <cstdio> | |
12 | ||
13 | #include "config.h" | |
14 | ||
15 | using namespace std; | |
16 | ||
17 | Config::Config() | |
18 | { | |
19 | } | |
20 | ||
21 | std::string Config::GetUserFilePath() | |
22 | { | |
23 | m_optsFilePath = GetHomePath() + USER_DIRECTORY_NAME; | |
24 | return m_optsFilePath.c_str(); | |
25 | } | |
26 | ||
27 | void Config::ChangeToHomeDirectory() | |
28 | { | |
29 | if(chdir(GetHomePath().c_str())) | |
30 | { | |
31 | // TODO: LOG ERROR | |
32 | cout << "Cannot switch to home directory ('" << GetHomePath().c_str() << "')" << std::endl; | |
33 | } | |
34 | } | |
35 | ||
36 | void Config::ChangeToUserDirectory() | |
37 | { | |
38 | if(chdir((GetHomePath() + USER_DIRECTORY_NAME).c_str())) | |
39 | { | |
40 | ||
41 | cout << "Cannot switch to home directory ('" << GetHomePath().c_str() << "')" << std::endl; | |
42 | } | |
43 | } | |
44 | ||
45 | // Simple POSIX file copy | |
46 | bool Config::CopyFile(std::string srcFile, std::string destFile) | |
47 | { | |
48 | const int bufSize = 1024; | |
49 | bool bRet = true; | |
50 | char buf[bufSize]; | |
51 | size_t size; | |
52 | ||
53 | // Attempt to open files | |
54 | int source = open(srcFile.c_str(), O_RDONLY, 0); | |
55 | int dest = open(destFile.c_str(), O_WRONLY | O_CREAT /*| O_TRUNC*/, 0644); | |
56 | ||
57 | if (source && dest) | |
58 | { | |
59 | // Copy | |
60 | while ((size = read(source, buf, bufSize)) > 0) { | |
61 | if(0 >= write(dest, buf, size)) { | |
62 | // Handle error; | |
63 | std::cout << "Error writing '" << destFile.c_str() << "' (" << size << ")" << std::endl; | |
64 | std::cout << "Source file: " << srcFile.c_str() << std::endl; | |
65 | ||
66 | bRet = false; | |
67 | break; | |
68 | } | |
69 | } | |
70 | ||
71 | // Close files | |
72 | if(source) { | |
73 | close(source); | |
74 | } | |
75 | if(dest) { | |
76 | close(dest); | |
77 | } | |
78 | } else { | |
79 | std::cout << "Error copying '" << srcFile.c_str() << "' to '" << destFile.c_str() << "'" << std::endl; | |
80 | bRet = false; | |
81 | } | |
82 | return bRet; | |
83 | } | |
84 | ||
85 | // ValidateUserDirectory | |
86 | // Checks for presence of user directory structure for configuration files | |
87 | bool Config::ValidateUserDirectory() | |
88 | { | |
89 | ||
90 | // GPH TOOD: Revisit with more elegant solution. | |
91 | // Looks like there's an official way to copy all files in a directory | |
92 | // for c++17 using filesystem::, but I just want something that's | |
93 | // going to work. | |
94 | static const char *files[] = | |
95 | { | |
96 | "charset40.bmp", | |
97 | "font.bmp", | |
98 | "splash.bmp", | |
99 | "Printer.txt", | |
100 | "Master.dsk", | |
101 | "LICENSE", | |
102 | "linapple.conf", | |
103 | "icon.bmp", | |
104 | "" | |
105 | }; | |
106 | ||
107 | bool bResult = false; | |
108 | struct stat buffer; | |
109 | std::string userDir = GetHomePath(); | |
110 | userDir += USER_DIRECTORY_NAME; | |
111 | std::string installDir = GetInstallPath(); | |
112 | ||
113 | // Check that the entire subtree exists | |
114 | bResult = (stat (userDir.c_str(), &buffer) == 0); | |
115 | bResult &= (stat ((userDir + CONF_DIRECTORY_NAME).c_str(), &buffer) == 0); | |
116 | bResult &= (stat ((userDir + SAVED_DIRECTORY_NAME).c_str(), &buffer) == 0); | |
117 | bResult &= (stat ((userDir + FTP_DIRECTORY_NAME).c_str(), &buffer) == 0); | |
118 | bResult &= (stat (GetUserFilePath().c_str(), &buffer) == 0); | |
119 | if (!bResult) { | |
120 | // Directory is absent. This means we need to create it and copy over | |
121 | // defaults from the install location. | |
122 | mkdir(userDir.c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | |
123 | mkdir((userDir + CONF_DIRECTORY_NAME).c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | |
124 | mkdir((userDir + SAVED_DIRECTORY_NAME).c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | |
125 | mkdir((userDir + FTP_DIRECTORY_NAME).c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | |
126 | ||
127 | cout << "Copying Files\n"; | |
128 | // Copy config options file | |
129 | for( unsigned int i = 0; *files[ i ]; i++ ) { | |
130 | string dest = GetUserFilePath(); | |
131 | CopyFile( | |
132 | (GetInstallPath() + files[ i ]), | |
133 | dest + files[ i ] | |
134 | ); | |
135 | } | |
136 | } | |
137 | return bResult; | |
138 | } | |
139 | ||
140 | std::string Config::GetInstallPath() | |
141 | { | |
142 | return INSTALL_DIRECTORY_NAME; | |
143 | } | |
144 | ||
145 | std::string Config::GetHomePath() | |
146 | { | |
147 | struct passwd *pw = getpwuid(getuid()); | |
148 | const char *homedir = pw->pw_dir; | |
149 | std::string path = homedir; | |
150 | return path; | |
151 | } |