├── .drone.yml
├── .editorconfig
├── .gitignore
├── CHANGELOG.md
├── COPYING
├── Makefile
├── Makefile.Windows.mak
├── Makefile.amigaos
├── Makefile.docker
├── Makefile.linux
├── README.md
├── aminet.readme
├── catalogs
├── C_c.sd
├── C_h.sd
├── CatComp_h.sd
├── french
│ └── iGame.ct
├── german
│ └── iGame.ct
├── greek
│ └── iGame.ct
├── iGame.cd
├── italiano
│ └── iGame.ct
└── turkish
│ └── iGame.ct
├── guigfx_render_nofpu.lha
├── iGame_rel
├── iGame-2016-11-30.lha
├── iGame-2018-10-11.lha
├── iGame-2018-10-25.lha
├── iGame-2018-11-01.lha
├── iGame-2019-01-15.lha
├── iGame-2019-05-03.lha
└── iGame-2020-09-04.lha
├── igame_screen.png
├── make_includes
├── catalogs.inc
├── obj_000.inc
├── obj_030.inc
├── obj_040.inc
├── obj_060.inc
├── obj_files.inc
├── obj_mos.inc
├── obj_os4.inc
└── rules.inc
├── obsolete
├── MUI Builder
│ └── iGame.MUIB
└── helper_tools
│ ├── install_ram
│ ├── lowlevel.bat
│ ├── lowlevel.c
│ ├── pack_release
│ ├── slave_title2.c
│ └── update_titles.c
├── os4depot.readme
├── required_files
├── Install-iGame
├── Install-iGame.info
├── extras
│ ├── icons
│ │ ├── iGame-png-120.info
│ │ ├── iGame-png-48.info
│ │ ├── iGame-png-64.info
│ │ ├── iGame1.info
│ │ ├── iGame2.info
│ │ ├── iGame3.info
│ │ └── iGame4.info
│ └── igame.png
├── genres
├── iGame.guide
├── iGame.guide.info
├── iGame.info
├── igame.iff
├── igame_drawer.info
└── igame_drawer_3.0.info
└── src
├── chipsetList.c
├── chipsetList.h
├── fsfuncs.c
├── fsfuncs.h
├── funcs.c
├── funcs.h
├── genresList.c
├── genresList.h
├── iGameExtern.h
├── iGameGUI.c
├── iGameGUI.h
├── iGameMain.c
├── slavesList.c
├── slavesList.h
├── strfuncs.c
├── strfuncs.h
└── version.h
/.drone.yml:
--------------------------------------------------------------------------------
1 | kind: pipeline
2 | type: docker
3 | name: awsbuilders-poweron
4 |
5 | clone:
6 | disable: true
7 |
8 | steps:
9 | - name: start-aws-instances
10 | pull: always
11 | image: amazon/aws-cli
12 | environment:
13 | AWS_ACCESS_KEY_ID:
14 | from_secret: AWS_ACCESS_KEY
15 | AWS_SECRET_ACCESS_KEY:
16 | from_secret: AWS_SECRET_ACCESS_KEY
17 | commands:
18 | - aws ec2 start-instances --region eu-north-1 --instance-ids i-01e3d598710a23947
19 |
20 | trigger:
21 | branch:
22 | include:
23 | - master
24 | - develop
25 | event:
26 | include:
27 | - push
28 | - pull_request
29 | - tag
30 |
31 | ---
32 |
33 | kind: pipeline
34 | type: docker
35 | name: compile-tests
36 |
37 | workspace:
38 | path: /drone/src
39 |
40 | steps:
41 | - name: compile-m68k
42 | pull: always
43 | image: walkero/docker4amigavbcc:latest-m68k
44 | commands:
45 | - make -f Makefile.docker CPU=000
46 | - make -f Makefile.docker CPU=030
47 | - make -f Makefile.docker CPU=040
48 | - make -f Makefile.docker CPU=060
49 | - name: compile-os4
50 | pull: always
51 | image: walkero/docker4amigavbcc:latest-ppc
52 | commands:
53 | - make -f Makefile.docker CPU=OS4
54 | - name: compile-mos
55 | pull: always
56 | image: walkero/docker4amigavbcc:latest-mos
57 | commands:
58 | - make -f Makefile.docker CPU=MOS
59 | - name: create-release-lha
60 | image: walkero/docker4amigavbcc:latest-m68k
61 | commands:
62 | - make -f Makefile.docker release
63 | depends_on:
64 | - compile-m68k
65 | - compile-os4
66 | - compile-mos
67 | - name: Prepare test release
68 | image: walkero/lha-on-docker:latest
69 | environment:
70 | OS4DEPOT_PASSPHRASE:
71 | from_secret: OS4DEPOT_PASSPHRASE
72 | commands:
73 | - mkdir test-release
74 | - ls -la ./
75 | - cp iGame--$(date +'%Y%m%d').lha ./test-release/iGame-$(date +'%Y%m%d%H%M').lha
76 | - sed -i "s/VERSION_TAG/nightly-$(date +'%Y%m%d%H%M')/" ./aminet.readme
77 | - sed -i "s/VERSION_TAG/nightly-$(date +'%Y%m%d%H%M')/" ./os4depot.readme
78 | - sed -i "s/OS4DEPOT_PASSPHRASE/$OS4DEPOT_PASSPHRASE/" ./os4depot.readme
79 | - cp ./os4depot.readme ./test-release/os4depot.readme
80 | - cp ./aminet.readme ./test-release/aminet.readme
81 | - ls -la ./test-release
82 | depends_on:
83 | - create-release-lha
84 | # - name: Upload to TEST FTP
85 | # image: cschlosser/drone-ftps
86 | # environment:
87 | # FTP_USERNAME:
88 | # from_secret: TESTFTP_USERNAME
89 | # FTP_PASSWORD:
90 | # from_secret: TESTFTP_PASSWORD
91 | # PLUGIN_HOSTNAME: mediavault.amiga-projects.net:21
92 | # PLUGIN_SRC_DIR: /test-release
93 | # PLUGIN_DEST_DIR: ./web/betas
94 | # PLUGIN_SECURE: "false"
95 | # PLUGIN_VERIFY: "false"
96 | # PLUGIN_CLEAN_DIR: "false"
97 | # depends_on:
98 | # - Prepare test release
99 |
100 | trigger:
101 | branch:
102 | include:
103 | - master
104 | - develop
105 | event:
106 | include:
107 | - push
108 | - pull_request
109 |
110 | depends_on:
111 | - awsbuilders-poweron
112 |
113 | node:
114 | agents: awsbuilders
115 |
116 | ---
117 |
118 | kind: pipeline
119 | type: docker
120 | name: compile-release-bytag
121 |
122 | workspace:
123 | path: /drone/src
124 |
125 | steps:
126 | - name: compile-m68k
127 | pull: always
128 | image: walkero/docker4amigavbcc:latest-m68k
129 | commands:
130 | - make -f Makefile.docker CPU=000
131 | - make -f Makefile.docker CPU=030
132 | - make -f Makefile.docker CPU=040
133 | - make -f Makefile.docker CPU=060
134 | - name: compile-os4
135 | pull: always
136 | image: walkero/docker4amigavbcc:latest-ppc
137 | commands:
138 | - make -f Makefile.docker CPU=OS4
139 | - name: compile-mos
140 | pull: always
141 | image: walkero/docker4amigavbcc:latest-mos
142 | commands:
143 | - make -f Makefile.docker CPU=MOS
144 | - name: Create release
145 | image: walkero/docker4amigavbcc:latest-m68k
146 | commands:
147 | - make -f Makefile.docker release
148 | depends_on:
149 | - compile-m68k
150 | - compile-os4
151 | - compile-mos
152 | - name: deploy-on-repo
153 | image: plugins/github-release
154 | settings:
155 | api_key:
156 | from_secret: GITHUB_RELEASE_API_KEY
157 | files:
158 | - "iGame-*.lha"
159 | title: "iGame release ${DRONE_TAG}"
160 | depends_on:
161 | - Create release
162 | - name: Prepare Aminet release
163 | image: walkero/lha-on-docker:latest
164 | commands:
165 | - mkdir aminet-release
166 | - cp iGame-${DRONE_TAG}-$(date +'%Y%m%d').lha ./aminet-release/iGame.lha
167 | - sed -i "s/VERSION_TAG/${DRONE_TAG}/" ./aminet.readme
168 | - cp ./aminet.readme ./aminet-release/iGame.readme
169 | depends_on:
170 | - Create release
171 | - name: Upload to Aminet
172 | image: cschlosser/drone-ftps
173 | environment:
174 | FTP_USERNAME: "anonymous"
175 | FTP_PASSWORD: "walkero@gmail.com"
176 | PLUGIN_HOSTNAME: main.aminet.net:21
177 | PLUGIN_SRC_DIR: /aminet-release
178 | PLUGIN_DEST_DIR: ./new
179 | PLUGIN_SECURE: "false"
180 | PLUGIN_VERIFY: "false"
181 | PLUGIN_CHMOD: "false"
182 | depends_on:
183 | - Prepare Aminet release
184 | - name: Prepare OS4Depot release
185 | image: walkero/lha-on-docker:latest
186 | environment:
187 | OS4DEPOT_PASSPHRASE:
188 | from_secret: OS4DEPOT_PASSPHRASE
189 | commands:
190 | - mkdir os4depot-release
191 | - cp iGame-${DRONE_TAG}-$(date +'%Y%m%d').lha ./os4depot-release/iGame.lha
192 | - sed -i "s/VERSION_TAG/${DRONE_TAG}/" ./os4depot.readme
193 | - sed -i "s/OS4DEPOT_PASSPHRASE/$OS4DEPOT_PASSPHRASE/" ./os4depot.readme
194 | - cp ./os4depot.readme ./os4depot-release/iGame_lha.readme
195 | depends_on:
196 | - Create release
197 | - name: Upload to OS4Depot
198 | image: cschlosser/drone-ftps
199 | environment:
200 | FTP_USERNAME: "ftp"
201 | FTP_PASSWORD: ""
202 | PLUGIN_HOSTNAME: os4depot.net:21
203 | PLUGIN_SRC_DIR: /os4depot-release
204 | PLUGIN_DEST_DIR: ./upload
205 | PLUGIN_SECURE: "false"
206 | PLUGIN_VERIFY: "false"
207 | PLUGIN_CHMOD: "false"
208 | depends_on:
209 | - Prepare OS4Depot release
210 |
211 | trigger:
212 | event:
213 | include:
214 | - tag
215 |
216 | depends_on:
217 | - awsbuilders-poweron
218 |
219 | node:
220 | agents: awsbuilders
221 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | # Unix-style newlines with a newline ending every file
5 | [*]
6 | charset = utf-8
7 | trim_trailing_whitespace = true
8 | end_of_line = lf
9 | insert_final_newline = true
10 | indent_style = tab
11 | #indent_size = 2
12 |
13 | # Tab indentation (no size specified)
14 | [Makefile]
15 | indent_style = tab
16 |
17 | [*.{c,h,cpp,hpp}]
18 | indent_size = 4
19 |
20 | [*.{yml,yaml}]
21 | indent_style = space
22 | indent_size = 2
23 |
24 | [*.json]
25 | indent_style = space
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | iGame
2 | src/*_cat.*
3 | src/*.o
4 | src/iGame_strings.h
5 | iGame.0*0
6 | iGame_rel/iGame.info
7 | iGame.MOS
8 | iGame.OS4
9 | send_to_emul
10 | catalogs/*/iGame.catalog
11 | .vscode
12 | .idea
13 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## iGame VERSION_TAG - [RELEASE_DATE]
2 |
3 | ## iGame 2.4.6 - [2024-02-18]
4 | ### Changed
5 | - Some optimisation in list loading reducing the time needed more than 42%
6 |
7 | ## iGame 2.4.5 - [2023-11-03]
8 | ### Changed
9 | - Speedup the slavesListAddTail(), almost 200% faster. This has an impact on the slaves list creation during the scan and the loading from the file.
10 |
11 | ### Fixed
12 | - Fixed the opening of the properties window for some users, by reverting some changes from v2.4.1
13 | - Fixed the item (demo/game) renaming from the properties window
14 | - Fixed the addition of an item (demo/game) from the "Add game..." window. This was saved in a wrong way and was breaking the list
15 | - Fixed the title change of the items in the list (#215)
16 | - Code cleanup
17 |
18 | ## iGame 2.4.4 - [2023-09-11]
19 | ### Changed
20 | - Now after the repository scans, any item that is not assigned to any genre gets the "Unknown" value by default
21 |
22 | ### Fixed
23 | - Fixed the generated genre list titles after a rescan of the repository
24 | - Fixed more memory leaks
25 | - Fixed the load of the list of items when the side panel is hidden
26 |
27 | ## iGame 2.4.3 - [2023-09-01]
28 | ### Fixed
29 | - Fixed memory leaks
30 | - Fixed the lists getting wrong values when overflow
31 |
32 | ## iGame 2.4.2 - [2023-08-27]
33 | ### Changed
34 | - Simplified the version string and added the release date in the screen title
35 |
36 | ### Fixed
37 | - Fixed the menus in MorphOS that were broken for some time now
38 |
39 | ## iGame 2.4.1 - [2023-07-19]
40 | ### Added
41 | - Now the Genre list is populated from the igame.data files and the genre file, if it exists, although it is not necessary. The genre filtering is working with these new values
42 | - Added a new cycle box that lets the user filter the results based on the chipset. This requires in settings the "Prefer igame.data files" to be enabled
43 |
44 | ### Changed
45 | - When real-time filtering is enabled at least 3 characters are required so as to be initiated. Less than 3 characters are ignored, unless the filtering by pressing the enter button is enabled.
46 | - Removed the filtering options from the Genre list and moved them to their own select box above the entries list
47 | - Now, even if the list entries list is populated a new repository scan will update the Chipset and Genre information based on the data found in igame.data files.
48 | - If the "Prefer igame.data files" is not enabled those files are not used during the scan of repositories
49 |
50 | ### Fixed
51 | - Fixed a hit when the entry properties are requested without having a selected entry
52 |
53 | ## iGame 2.4.0 - [2023-05-13]
54 | ### Added
55 | - Added back the saving of the list after a scan of the repositories, which was removed in the previous releases
56 | - Introduced the new igame.data files
57 | - iGame uses NList now with extra columns that are sortable
58 | - Added "Prefer igame.data" checkbox in preferences that let the user to set if the title is going to retrieved from the igame.data files or from the slave file or the folder name, like it used to work. This doesn't have any effect on non-WHDLoad items.
59 |
60 | ### Fixed
61 | - Fixed the status messages which was stack with saving list message and didn't show the number of games again.
62 |
63 | ### Changed
64 | - Now the MUI changes are loaded from envarc. With MUI v5 balance size and list columns are saved there and restored the next time iGame is started
65 |
66 | ## iGame 2.3.2 - [2023-04-20]
67 | ### Fixed
68 | - Fixed a bug on repo removal, which remained in the repos list and was included in scans, unless the user restarted iGame
69 |
70 | ## iGame 2.3.2 - [2023-04-20]
71 | ### Fixed
72 | - The custom screenshot sizes were wrongly saved. This is now fixed (#190)
73 | - Fixed a duplication in slave names after the execution of a second scan in the same list, introduced in v2.3.0
74 | - Fixed a crash on systems that use AutoUpdateWB patch. **HUGE THANKS to mfilos** for his testing, feedback and support up to late at nights
75 | - Fixed an error on status text after launching a game that showed total of zero games, introduced in v2.3.0
76 | - Refactored the Slave tooltype parsing on launching to fix a memory hit and potential crashes
77 |
78 | ### Changed
79 | - Added some spaces left and right of the screenshot. This helps to resize the sidebar as needed keeping the screenshot centred
80 | - Now, only the screenshot part of the GUI is updated on item selection and not the whole right side. This makes the GUI refresh faster on slow computers
81 | - If the screenshot is toggled (show/hide) in the settings window the GUI is updated without the need of restarting iGame
82 | - Now iGame doesn't fail to start even if any of the guigfx.library, render.library or Guigfx.mcc is missing. It falls back using the datatypes and the "No GuiGfx" checkbox is blocked in the settings
83 | - With v2.3.0 WHDLoad games that have different names on .info file against the slave file was not starting. I changed the way the necessary info file is discovered to be closer to what v2.2.1 was doing and now it works fine
84 |
85 | ## iGame 2.3.1 - [2023-04-14]
86 | ### Fixed
87 | - This is a hot fix release for the installer script that had a bug of not finding the icons folder
88 |
89 | ## iGame 2.3.0 - [2023-04-13]
90 | ### Added
91 | - Some nonWHDLoad games require to be started from their own folder, otherwise they crash or fail to start. This is a problem mainly on systems that do not have WBRun or WBLoad (i.e. AmigaOS 3.1). Now, for all the added games/demos that are started on such systems a temporary script is created under T:
92 | - Added German catalog and an alternative main image contributed by Martin Cornelius
93 | - Added French catalog contributed by AmiGuy
94 |
95 | ### Changed
96 | - Now we compile iGame with NDK 3.2R4
97 | - Now the repositories path requester accepts only drawers
98 | - Memory footprint is now reduced and optimised as much as possible
99 | - iGame window appears first and then the list is loaded from the file. This makes the application appear faster, giving feedback to the user
100 | - When the user selects a relative path (ie. //Games), that changes to an absolute path.
101 | - Changed the way the same title slaves are counted. This will help for removing the multiple "Alt" words in the list
102 | - Changed the repository scanning for files. The code is simplified and now uses more functions from the system API, making it more compatible. Also, all the "Data" folders are skipped from scanning, so slaves that exist in those folders are not used. A lot of code was removed and optimised, so the scan is now around 37% faster on the same machine, scanning a folder with 3562 entries.
103 | - Changed the way the multiple instances with the same title are shown. Now no "Alt" labels will be added. Instead, we introduced a number in square brackets that represent the different instances, i.e. 3DPool [1], 4DSportsDriving [2]. Not every record has these values, so expect to see them only when there are duplicates.
104 | - The gamelist.csv file changed by having double quotes around the string values, like the path and the title.
105 | - A new column was added in the gamelist.csv file which holds the custom name of the item. The old column remains unchanged. This helps in situations like a repository rescan, where the given name by the user doesn't change. The old second column should remain unchanged.
106 | - Now iGame requires icon.library v44+ for changing icon tooltypes. For systems that do include a new version, there is icon.library 46.4 on Aminet is free to download and use. Those that have older versions of the library will still be able to use iGame, but they won't be able to change the icon tooltypes. They will need to do it from Workbench
107 | - Now the filter string field is not disabled in the hidden list, allowing the user to filter the results based on the title or part of it
108 | - "Status" line, "Times played" and "Slave path" do not have a border anymore, since they are read-only fields
109 | - "No smart spaces" checkbox has a proper border now
110 | - "Slave path" in the item properties window doesn't stretch its width anymore. If MUI 5 is used the text will be shortened, showing three dots in the middle of it.
111 | - If WBLoad exists in the C: folder, this is going to be used to start games/demos from WB, when they were added as extra items in the list
112 | - The "Last played" list holds more than one record, so that you can easily find the last games you played
113 | - Moved alt_icons under extras folder
114 | - Updated installer script to give some info to the user at the installation folder selection step
115 |
116 | ### Fixed
117 | - When a user changes the tooltypes of a slave, the NewIcon keeps working. The previous versions of iGame were deleting the image information. Now they are dropped from the icon tooltypes, but the image keeps working fine. As a result, the .info file size is reduced almost to half.
118 | - Now it is possible to save the icon tooltypes even if it is used as an item screenshot. In the previous versions the icon file was blocked and no change was possible
119 | - Fixed crashing on exit
120 | - Fixed low memory computer freeze while scanning
121 | - Fixed low memory computer freeze when loading big list of entries
122 |
123 | ## iGame 2.2.1 - [2023-01-30]
124 | ### Added
125 | - Added Turkish catalog contributed by Serkan Dursun
126 |
127 | ### Fixed
128 | - Now the 68K cpu specific versions are included in the archive. In v2.2.0 all versions where the same 68000 binary because of a missing flag in compilation
129 | - Willem Drijver contributed with a fix on Execute tooltype, which was not working well.
130 |
131 | ### Changed
132 | - Removed the tooltypes from the iGame icons. They are not used any more
133 |
134 | ## iGame 2.2.0 - [2022-11-06]
135 | ### Added
136 | - Added automatic release to Aminet and OS4Depot through the CI/CD whenever a new release tag is created at the repo
137 |
138 | ### Changed
139 | - Removed completely the Tooltypes. Now iGame defaults to the optimal settings and uses only the settings file to change its behaviour.
140 | - Now if the file "envarc:igame.prefs" exists then this is used by iGame, instead of the one that exists at the PROGDIR:. This way multiple iGame instances will have common settings (#173)
141 | - Introducing semantic versioning. No beta versions any more. Now the versions will have three digits based on MAJOR.MINOR.PATCH pattern. More info at https://semver.org/
142 |
143 | ## iGame 2.1 - [2022-06-04]
144 | ### Changed
145 | - Did some fixes on libraries checks during application start based on the selected tooltypes
146 | - Some minor fixes
147 | - Update icons' positions to not overlap each other
148 | - Added NOSIDEPANEL to iGame tooltypes that was missing
149 |
150 | ... plus all the changes that were released in previous beta versions (2.1b1 up to 2.1b3), which you can see below
151 |
152 | ## iGame 2.1b3 - [2021-12-04]
153 | ### Added
154 | - Added a check if the screenshot image is supported by the installed datatypes. If not, it is skipped. This fixes situations where the Info datatype is not installed and no image is shown instead of the default.
155 |
156 | ### Fixed
157 | - Fixed the menus on Aros 68k. Menus should work on ApolloOS now.
158 |
159 | ### Changed
160 | - The games list is not multiselect now. This speeds up a little bit the selection of games on slow machines.
161 | - Moved the strings methods to a separate file. Also merged the strcasestr.c and strdup.c files.
162 | - Moved the filesystem methods to a separate file.
163 | - Set local methods as static in the funcs.c and cleaned up the iGameExtern.h from the shared methods
164 | - Now all the libraries open on application start and close on application exit. No OpenLibrary() calls in the middle of the application.
165 | - Moved the joystick methods from iGameMain.c to funcs.c
166 | - A lot of global methods and variables removed
167 | - A lot of refactoring happened, so to make funcs.c file smaller. This makes code more clear and readable.
168 | - All the necessary libraries and interfaces are set to be loaded in the code. No "-lauto" is necessary any more.
169 | - Changed the localization system to support the new menus. Now the strings header file is created based on catcomp
170 |
171 | ## iGame 2.1b2 - [2021-03-15]
172 | ### Added
173 | - Added iGame version at the screen title
174 |
175 | ### Updated
176 | - Updated Italian catalog
177 | - Updated Greek catalog
178 | ### Fixed
179 | - Fixed starting whdload games that have tooltypes start with the characters »«.=#!
180 | - Fixed starting whdload games/demos that the Slave path is missing. Now an error message is shown, and iGame doesn't crash hard, bringing down the whole system.
181 |
182 |
183 | ## iGame 2.1b1 - [2021-03-09]
184 | ### Added
185 | - Three extra PNG icons contributed by Carlo Spadoni
186 | - Added Greek translation
187 |
188 | ### Fixed
189 | - Fixed install script on MorphOS
190 | - Fixed usage of Catalog files (thanks coldacid)
191 |
192 |
193 | ## iGame 2.0 - 2020-10-16
194 | This release includes all the fixes and changes of the 2.0 beta releases below.
195 |
196 | ## iGame 2.0b8 - 2020-10-08
197 | ### Added
198 | - Added Italian catalog file in release package and it is now selectable in install script
199 |
200 | ### Fixed
201 | - Fixed the copy of the OS4 native version on installer
202 | - Fixed the running of games that include spaces in path or file names and added by "Add a game" menu item
203 | - Fixed the zero records in gameslist file when the user changed game properties from the respective window
204 |
205 | ## iGame 2.0b7 - 2020-09-25
206 | ### Added
207 | - Changelog file
208 |
209 | ### Changed
210 | - Fully updated iGame.guide file
211 | - Changed the menu item name "Add non-WHDLoad game..." to "Add game.." to be more precise, since from that you can add WHDLoad games as well
212 |
213 | ### Fixed
214 | - Fixed a problem with saving of the CSV file when the old gameslist file had empty genres
215 | - Fixed "Show Favorites" on startup which was not working under AmigaOS 3 with MUI 5
216 | - Fixed the release version and the date on about window
217 | - Fixed the installer that was complaining about missing locale/catalogs folder
218 |
219 | ## iGame 2.0b6 - 2020-09-04
220 | ### Added
221 | - Now iGame checks for any missing library and informs the user if it is started from the shell
222 | - New installation script
223 | - Show "Unknown" genre in genres list for those games that are not categorized yet
224 | - When iGame is iconified, now uses it's icon
225 | - Open game directory from menu
226 | - AmigaOS 4 native version added
227 |
228 | ### Changed
229 | - Changed the gameslist file to CSV, which makes iGame to start faster and the file to be a lot smaller in size. If there is already a gameslist, iGame will read it and on next write it will convert it to csv. All genres and statistics will remain. The old plain list gamelist will not be used after this point, but it is not going to be deleted automatically
230 | - Keep image aspect for screenshot/icon when GuiGfx is used
231 |
232 | ### Fixed
233 | - Stability/Bug fixes, GUI fixes
234 | - Fixed menu shortcuts that didn't work
235 |
236 |
237 | ## iGame 2.0b5 - 2019-05-03
238 | ### Added
239 | - Option to start with the favorites list
240 | - If C:WBRun exists, run non-whdload games with it
241 |
242 | ### Changed
243 | - Some misc gui changes
244 |
245 |
246 | ## iGame 2.0b4 (iGame-2019-01-15.lha)
247 | TBD
248 |
249 |
250 | ## iGame 2.0b3 (iGame-2018-11-01.lha)
251 | ### Added
252 | - Added Makefile for Linux
253 |
254 |
255 | ## iGame 2.0b2 (iGame-2018-10-25.lha)
256 | TBD
257 |
258 |
259 | ## iGame 2.0b1 (iGame-2018-10-11.lha)
260 | ### Added
261 | - Added Makefile for Windows
262 | - Added title scanning based on the parent folder
263 | - Added Settings window. Now using a prefs file, instead of only Tooltypes. Falls back to tooltypes if no prefs file is found.
264 | - Fully translatable using standard .catalog files (.cd file included for translators)
265 |
266 | ### Changed
267 | - GUI rewritten from scratch keeping the same look and feel
268 | - A lot of code cleanup
269 | - Improved error handling in various places
270 |
271 |
272 | ## iGame (iGame-2016-11-30.lha)
273 | TBD
274 |
275 |
276 | ## iGame (iGame-2015-11-07.lha)
277 | ### Fixed
278 | - Fix a GR when selecting Game Properties without having selected a game. (Thanks @AllanU74)
279 |
280 |
281 | ## iGame (iGame-2015-02-13.lha)
282 | ### Changed
283 | - Adjusts screenshot box according to workbench resolution.
284 |
285 |
286 | ## iGame (iGame-2014-08-13.lha)
287 | ### Added
288 | - Builds for 030 and 060
289 | - Added SAVESTATSONEXIT tooltype
290 | - Under some circumstances, iGame now loads games icons
291 |
292 | ### Changed
293 | - Now compiled with vbcc. Should produce a slightly faster build.
294 | - Faster initial loading
295 |
296 | ### Fixed
297 | - Fixed OS4 crashes (mainly during search).
298 | - Some other small changes done during a few years of on/off coding.
299 |
300 |
301 | ## iGame 1.5 (12/08/08)
302 | ### Added
303 | - Added "--Never Played--"
304 | - Filter will now work together with genres
305 | - Added FILTERUSEENTER
306 | - Added indication when writing to disk
307 |
308 | ### Changed
309 | - Genres are now in an external file
310 | - Reworked "Show/Hide hidden slaves"
311 |
312 |
313 | ## iGame 1.4 (08/12/07)
314 | ### Added
315 | - Editable tooltypes
316 |
317 | ### Changed
318 | - Speed increase while listing games
319 |
320 | ### Fixed
321 | - Misc bug fixes
322 |
323 |
324 | ## iGame 1.3 (28/04/07)
325 | ### Added
326 | - Added the NOGUIGFX tooltype
327 | - Added keyboard shortcut to Game Properties (Right A + P)
328 | - Added option to hide a slave
329 | - iGame will now launch a slave, even without an info file (with default tooltypes)
330 | - Reads titles from slave files
331 | - Added the update_titles app
332 | - 'Alt' suffix is used for multiple slaves
333 |
334 |
335 | ## iGame 1.2 (06/04/2007)
336 | ### Changed
337 | - Search .info files only when launching games
338 |
339 | ### Fixed
340 | - Fixed screenshot size to be consistent when changing images
341 | - Counters now work for genres filtering
342 |
343 |
344 | ## iGame 1.1 (27/03/2007)
345 | ### Added
346 | - Added MUI Settings
347 |
348 | ### Fixed
349 | - Fixed a nasty bug that caused iGame to sometimes list wrong titles (or no titles at all) after a scan
350 |
351 |
352 | ## iGame 1.0 (17/03/2007)
353 | ### Added
354 | - First public release
355 |
356 | ### Changed
357 | - Too many things changed to list here
358 |
359 |
360 | ## iGame 0.2 (30/07/2005)
361 | ### Added
362 | - iGame finds the tooltypes from the game's icon and uses them
363 |
364 |
365 | ## iGame 0.1-23052005 (23/05/2005)
366 | ### Added
367 | - Games that have their data stored in a sub-dir, now run
368 |
369 |
370 | ## iGame 0.1-05052005 (05/05/2005)
371 | ### Added
372 | - First test version
373 |
374 |
375 | The format of this changelog file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
376 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Makefile for iGame on Linux using GCC.
3 | #-------------------------------------------------------------------------
4 | # To compile an iGame flat executable using this makefile, run:
5 | # make
6 | #-------------------------------------------------------------------------
7 | ##########################################################################
8 |
9 | ##########################################################################
10 | # Default: Build iGame with standard optimizations and 000 support
11 | ##########################################################################
12 | all: iGame
13 |
14 | ##########################################################################
15 | # Set up version and date properties
16 | ##########################################################################
17 |
18 | DATE = $(shell date --iso=date)
19 |
20 | ##########################################################################
21 | # Compiler settings
22 | ##########################################################################
23 | CC = m68k-amigaos-gcc
24 | LINK = m68k-amigaos-gcc
25 | CC_PPC = ppc-amigaos-gcc
26 | LINK_PPC = ppc-amigaos-gcc
27 |
28 | INCLUDES = -I$(NDK_INC) -I$(MUI38_INC)
29 | INCLUDES_OS4= -I$(SDK_INC) -I$(MUI50_INC)
30 | INCLUDES_MOS= -I$(NDK_INC) -I$(MUI50_INC)
31 |
32 | CFLAGS = -c -Os -fomit-frame-pointer -std=c99 -DCPU_VERS=68000 -DRELEASE_DATE=$(DATE)
33 | CFLAGS_030 = -c -mcpu=68030 -Os -fomit-frame-pointer -std=c99 -DCPU_VERS=68030 -DRELEASE_DATE=$(DATE)
34 | CFLAGS_040 = -c -mcpu=68040 -Os -fomit-frame-pointer -std=c99 -DCPU_VERS=68040 -DRELEASE_DATE=$(DATE)
35 | CFLAGS_060 = -c -mcpu=68060 -Os -fomit-frame-pointer -std=c99 -DCPU_VERS=68060 -DRELEASE_DATE=$(DATE)
36 | CFLAGS_MOS = -c -Os -fomit-frame-pointer -std=c99 -DCPU_VERS=MorphOS -DRELEASE_DATE=$(DATE)
37 | CFLAGS_OS4 = -c -Os -fomit-frame-pointer -std=c99 -D__USE_INLINE__ -DCPU_VERS=AmigaOS4 -DRELEASE_DATE=$(DATE)
38 |
39 | ##########################################################################
40 | # Builder settings
41 | ##########################################################################
42 | #MKLIB = join
43 | LIBFLAGS = -v -lamiga -lstubs -o
44 | LIBFLAGS_MOS = -v -lamiga -lstubs -o
45 | LIBFLAGS_OS4 = -v -lamiga -lstubs -o
46 |
47 | ##########################################################################
48 | # Object files which are part of iGame
49 | ##########################################################################
50 |
51 | include make_includes/obj_files.inc
52 |
53 | ##########################################################################
54 | # Rule for building
55 | ##########################################################################
56 |
57 | include make_includes/rules.inc
58 |
59 | ##########################################################################
60 | # catalog files
61 | ##########################################################################
62 |
63 | include make_includes/catalogs.inc
64 |
65 | catalogs/%/iGame.catalog: catalogs/%/iGame.ct catalogs/iGame.cd
66 | flexcat catalogs/iGame.cd $< CATALOG $@ FILL QUIET || exit 0
67 |
68 | ##########################################################################
69 | # object files (generic 000)
70 | ##########################################################################
71 |
72 | include make_includes/obj_000.inc
73 |
74 | ##########################################################################
75 | # object files (030)
76 | ##########################################################################
77 |
78 | include make_includes/obj_030.inc
79 |
80 | ##########################################################################
81 | # object files (040)
82 | ##########################################################################
83 |
84 | include make_includes/obj_040.inc
85 |
86 | ##########################################################################
87 | # object files (060)
88 | ##########################################################################
89 |
90 | include make_includes/obj_060.inc
91 |
92 | ##########################################################################
93 | # object files (MOS)
94 | ##########################################################################
95 |
96 | include make_includes/obj_mos.inc
97 |
98 | ##########################################################################
99 | # object files (AOS4)
100 | ##########################################################################
101 |
102 | include make_includes/obj_os4.inc
103 |
104 | ##########################################################################
105 | # generic build options
106 | ##########################################################################
107 |
108 | clean:
109 | rm iGame iGame.* src/funcs*.o src/iGameGUI*.o src/iGameMain*.o src/strfuncs*.o src/iGame_cat*.o $(catalog_files)
110 |
111 | # pack everything in a nice lha file
112 | release: $(catalog_files)
113 | cp required_files iGame_rel/iGame-$(DATE) -r
114 | cp alt_icons iGame_rel/iGame-$(DATE)/Icons -r
115 | cp iGame_rel/iGame-$(DATE)/igame_drawer_3.0.info iGame_rel/iGame-$(DATE).info
116 | mv iGame_rel/iGame-$(DATE)/igame_drawer_3.0.info iGame_rel/iGame-$(DATE)/Icons/
117 | mv iGame_rel/iGame-$(DATE)/igame_drawer.info iGame_rel/iGame-$(DATE)/Icons/
118 | if [ -f "iGame" ]; then cp iGame iGame_rel/iGame-$(DATE)/; fi
119 | if [ -f "iGame.030" ]; then cp iGame.030 iGame_rel/iGame-$(DATE)/; fi
120 | if [ -f "iGame.040" ]; then cp iGame.040 iGame_rel/iGame-$(DATE)/; fi
121 | if [ -f "iGame.060" ]; then cp iGame.060 iGame_rel/iGame-$(DATE)/; fi
122 | if [ -f "iGame.MOS" ]; then cp iGame.MOS iGame_rel/iGame-$(DATE)/; fi
123 | if [ -f "iGame.OS4" ]; then cp iGame.OS4 iGame_rel/iGame-$(DATE)/; fi
124 | mkdir iGame_rel/iGame-$(DATE)/catalogs
125 | cp catalogs/iGame.cd iGame_rel/iGame-$(DATE)/catalogs/
126 | cd iGame_rel/iGame-$(DATE) && mkdir $(catalog_dirs)
127 | for c in $(catalog_files); do cp $$c iGame_rel/iGame-$(DATE)/$$(dirname $$c)/; done
128 | cp CHANGELOG.md iGame_rel/iGame=$(DATE)/
129 | cd iGame_rel && lha -aq2o6 iGame-$(DATE).lha iGame-$(DATE)/ iGame-$(DATE).info
130 |
131 | clean-release:
132 | rm -rf iGame_rel/iGame-$(DATE)
133 | rm iGame_rel/iGame-$(DATE).lha
134 | rm iGame_rel/iGame-$(DATE).info
135 |
--------------------------------------------------------------------------------
/Makefile.Windows.mak:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Makefile for iGame on Windows using VBCC. Assumed VBCC installation directory is D:\vbcc.
3 | #-------------------------------------------------------------------------
4 | # To compile an iGame flat executable using this makefile, run:
5 | # make -f Makefile.Windows.mak
6 | #-------------------------------------------------------------------------
7 | ##########################################################################
8 |
9 | ##########################################################################
10 | # Default: Build iGame with standard optimizations and 000 support
11 | ##########################################################################
12 | all: iGame
13 |
14 | ##########################################################################
15 | # Set up version and date properties
16 | ##########################################################################
17 |
18 | DATE = $(shell date --iso=date)
19 |
20 | ##########################################################################
21 | # Compiler settings
22 | ##########################################################################
23 | CC = vc
24 | LINK = vc
25 | CC_PPC = vc
26 | LINK_PPC = vc
27 |
28 | INCLUDES = -I$(NDK_INC) -I$(MUI38_INC)
29 | INCLUDES_OS4= -I$(SDK_INC) -I$(MUI50_INC)
30 | INCLUDES_MOS= -I$(NDK_INC) -I$(MUI50_INC)
31 |
32 | CFLAGS = -c +aos68k -dontwarn=-1 -O2 -c99 -DCPU_VERS=68000 -DRELEASE_DATE=$(DATE)
33 | CFLAGS_030 = -c +aos68k -cpu=68030 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68030 -DRELEASE_DATE=$(DATE)
34 | CFLAGS_040 = -c +aos68k -cpu=68040 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68040 -DRELEASE_DATE=$(DATE)
35 | CFLAGS_060 = -c +aos68k -cpu=68060 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68060 -DRELEASE_DATE=$(DATE)
36 | CFLAGS_MOS = -c +morphos -dontwarn=-1 -O2 -DCPU_VERS=MorphOS -DRELEASE_DATE=$(DATE)
37 | CFLAGS_OS4 = -c +aosppc -dontwarn=-1 -O2 -D__USE_INLINE__ -DCPU_VERS=AmigaOS4 -DRELEASE_DATE=$(DATE)
38 |
39 | ##########################################################################
40 | # Builder settings
41 | ##########################################################################
42 | #MKLIB = join
43 | LIBFLAGS = +aos68k -lamiga -lauto -o
44 | LIBFLAGS_MOS = +morphos -lamiga -lauto -o
45 | LIBFLAGS_OS4 = +aosppc -lamiga -lauto -o
46 |
47 | ##########################################################################
48 | # Object files which are part of iGame
49 | ##########################################################################
50 |
51 | include make_includes/obj_files.inc
52 |
53 | ##########################################################################
54 | # Rule for building
55 | ##########################################################################
56 |
57 | include make_includes/rules.inc
58 |
59 | ##########################################################################
60 | # catalog files
61 | ##########################################################################
62 |
63 | include make_includes/catalogs.inc
64 |
65 | catalogs/%/iGame.catalog: catalogs/%/iGame.ct catalogs/iGame.cd
66 | flexcat catalogs/iGame.cd $< CATALOG $@ FILL QUIET
67 |
68 | ##########################################################################
69 | # object files (generic 000)
70 | ##########################################################################
71 |
72 | include make_includes/obj_000.inc
73 |
74 | ##########################################################################
75 | # object files (030)
76 | ##########################################################################
77 |
78 | include make_includes/obj_030.inc
79 |
80 | ##########################################################################
81 | # object files (040)
82 | ##########################################################################
83 |
84 | include make_includes/obj_040.inc
85 |
86 | ##########################################################################
87 | # object files (060)
88 | ##########################################################################
89 |
90 | include make_includes/obj_060.inc
91 |
92 | ##########################################################################
93 | # object files (MOS)
94 | ##########################################################################
95 |
96 | include make_includes/obj_mos.inc
97 |
98 | ##########################################################################
99 | # object files (AOS4)
100 | ##########################################################################
101 |
102 | include make_includes/obj_os4.inc
103 |
104 | ##########################################################################
105 | # generic build options
106 | ##########################################################################
107 |
108 | clean:
109 | del iGame iGame.* src\funcs*.o src\iGameGUI*.o src\iGameMain*.o src/strfuncs*.o src\iGame_cat*.o $(catalog_files)
110 |
111 | # pack everything in a nice lha file
112 | release:
113 | cp required_files iGame_rel/iGame-$(DATE) -r
114 | cp alt_icons iGame_rel/iGame-$(DATE)/Icons -r
115 | cp iGame_rel/iGame-$(DATE)/igame_drawer_3.0.info iGame_rel/iGame-$(DATE).info
116 | mv iGame_rel/iGame-$(DATE)/igame_drawer_3.0.info iGame_rel/iGame-$(DATE)/Icons/
117 | mv iGame_rel/iGame-$(DATE)/igame_drawer.info iGame_rel/iGame-$(DATE)/Icons/
118 | if [ -f "iGame" ]; then cp iGame iGame_rel/iGame-$(DATE)/; fi
119 | if [ -f "iGame.030" ]; then cp iGame.030 iGame_rel/iGame-$(DATE)/; fi
120 | if [ -f "iGame.040" ]; then cp iGame.040 iGame_rel/iGame-$(DATE)/; fi
121 | if [ -f "iGame.060" ]; then cp iGame.060 iGame_rel/iGame-$(DATE)/; fi
122 | if [ -f "iGame.MOS" ]; then cp iGame.MOS iGame_rel/iGame-$(DATE)/; fi
123 | if [ -f "iGame.OS4" ]; then cp iGame.OS4 iGame_rel/iGame-$(DATE)/; fi
124 | cd iGame_rel && lha -aq2o6 iGame-$(DATE).lha iGame-$(DATE)/ iGame-$(DATE).info
125 |
126 | clean-release:
127 | rm -rf iGame_rel/iGame-$(DATE)
128 | rm iGame_rel/iGame-$(DATE).lha
129 | rm iGame_rel/iGame-$(DATE).info
130 |
--------------------------------------------------------------------------------
/Makefile.amigaos:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Makefile for iGame on AmigaOS using VBCC.
3 | #-------------------------------------------------------------------------
4 | # To compile iGame using this makefile, run:
5 | # make -f Makefile.amigaos
6 | #-------------------------------------------------------------------------
7 | ##########################################################################
8 |
9 | ##########################################################################
10 | # Default: Build iGame with standard optimizations and 000 support
11 | ##########################################################################
12 | all: iGame
13 |
14 | ##########################################################################
15 | # Set up version and date properties
16 | ##########################################################################
17 |
18 | ifeq ($(shell uname), AmigaOS)
19 | DATE = $(shell date LFORMAT "%Y-%m-%d")
20 | else
21 | DATE = $(shell date --iso=date)
22 | endif
23 |
24 | ##########################################################################
25 | # Compiler settings
26 | ##########################################################################
27 | CC = vc
28 | LINK = vc
29 | CC_PPC = vc
30 | LINK_PPC = vc
31 |
32 | INCLUDES_COMMON = -IDevkits:sdk/classic/MCC_Guigfx/Developer/C/Include -IDevkits:sdk/classic/MCC_Texteditor/Developer/C/Include
33 | INCLUDES = -IDevkits:sdk/classic/ndk_39/include/include_h -IDevkits:sdk/classic/MUI/Developer/C/Include $(INCLUDES_COMMON)
34 | INCLUDES_OS4= -ISDK:include/include_h -ISDK:MUI/C/include $(INCLUDES_COMMON)
35 | INCLUDES_MOS= -IDevkits:sdk/morphos/1.0/os-include -IDevkits:sdk/classic/ndk_39/include/include_h -IDevkits:sdk/classic/MUI/Developer/C/Include $(INCLUDES_COMMON)
36 |
37 | CFLAGS = -c +aos68k -dontwarn=-1 -O2 -c99 -DCPU_VERS=68000 -DRELEASE_DATE=$(DATE)
38 | CFLAGS_030 = -c +aos68k -cpu=68030 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68030 -DRELEASE_DATE=$(DATE)
39 | CFLAGS_040 = -c +aos68k -cpu=68040 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68040 -DRELEASE_DATE=$(DATE)
40 | CFLAGS_060 = -c +aos68k -cpu=68060 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68060 -DRELEASE_DATE=$(DATE)
41 | CFLAGS_MOS = -c +morphos -dontwarn=-1 -O2 -DCPU_VERS=MorphOS -DRELEASE_DATE=$(DATE)
42 | CFLAGS_OS4 = -c +aosppc -dontwarn=-1 -O2 -D__USE_INLINE__ -DCPU_VERS=AmigaOS4 -DRELEASE_DATE=$(DATE)
43 |
44 | ##########################################################################
45 | # Builder settings
46 | ##########################################################################
47 | #MKLIB = join
48 | LIBFLAGS = +aos68k -lamiga -lauto -o
49 | LIBFLAGS_MOS = +morphos -lamiga -lauto -o
50 | LIBFLAGS_OS4 = +aosppc -lamiga -lauto -o
51 |
52 | ##########################################################################
53 | # Object files which are part of iGame
54 | ##########################################################################
55 |
56 | include make_includes/obj_files.inc
57 |
58 | ##########################################################################
59 | # Rule for building
60 | ##########################################################################
61 |
62 | include make_includes/rules.inc
63 |
64 | ##########################################################################
65 | # Rules for generating catalog files
66 | ##########################################################################
67 |
68 | include make_includes/catalogs.inc
69 |
70 | catalogs/%/iGame.catalog: catalogs/%/iGame.ct catalogs/iGame.cd
71 | flexcat catalogs/iGame.cd $< CATALOG $@ FILL QUIET
72 |
73 | ##########################################################################
74 | # object files (generic 000)
75 | ##########################################################################
76 |
77 | include make_includes/obj_000.inc
78 |
79 | ##########################################################################
80 | # object files (030)
81 | ##########################################################################
82 |
83 | include make_includes/obj_030.inc
84 |
85 | ##########################################################################
86 | # object files (040)
87 | ##########################################################################
88 |
89 | include make_includes/obj_040.inc
90 |
91 | ##########################################################################
92 | # object files (060)
93 | ##########################################################################
94 |
95 | include make_includes/obj_060.inc
96 |
97 | ##########################################################################
98 | # object files (MOS)
99 | ##########################################################################
100 |
101 | include make_includes/obj_mos.inc
102 |
103 | ##########################################################################
104 | # object files (AOS4)
105 | ##########################################################################
106 |
107 | include make_includes/obj_os4.inc
108 |
109 | ##########################################################################
110 | # generic build options
111 | ##########################################################################
112 |
113 | clean:
114 | delete iGame iGame.030 iGame.040 iGame.060 iGame.MOS iGame.OS4 $(OBJS) $(OBJS_030) $(OBJS_040) $(OBJS_060) $(OBJS_MOS) $(OBJS_OS4) $(catalog_files)
115 |
116 |
--------------------------------------------------------------------------------
/Makefile.docker:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Makefile for iGame on Docker VBCC images.
3 | #-------------------------------------------------------------------------
4 | # To compile an iGame flat executable using this makefile, run:
5 | # make -f Makefile.docker CPU=030
6 | # CPU options are 000,030,040,060,MOS,OS4
7 | #-------------------------------------------------------------------------
8 | ##########################################################################
9 |
10 | ##########################################################################
11 | # Default: Build iGame with standard optimizations and 000 support
12 | ##########################################################################
13 | all: iGame
14 |
15 | ##########################################################################
16 | # Set up version and date properties
17 | ##########################################################################
18 |
19 | DATEISO = $(shell date --iso=date)
20 | DATESTR = $(shell date "+%Y%m%d")
21 |
22 | # DRONE_TAG is set by Drone CI/CD
23 | # Parse the repo tag to different defines, that will be used while
24 | # compiling iGame
25 | #
26 | # The tags should be like v(MAJOR).(MINOR).(PATCH)
27 | # in example v2.2.0
28 | #
29 | ifneq ($(origin DRONE_TAG),undefined)
30 | MAJOR = $(patsubst v%,%,$(firstword $(subst ., ,$(DRONE_TAG))))
31 | MINOR = $(word 2, $(subst ., ,$(DRONE_TAG)))
32 | PATCH = $(word 3, $(subst ., ,$(DRONE_TAG)))
33 |
34 | VERS_FLAGS = -DMAJOR_VERS=$(MAJOR) -DMINOR_VERS=$(MINOR) \
35 | -DPATCH_VERS=$(PATCH) -DRELEASE_DATE=$(DATEISO)
36 | else
37 | VERS_FLAGS = -DRELEASE_DATE=$(DATEISO)
38 | endif
39 |
40 | ##########################################################################
41 | # Compiler settings
42 | ##########################################################################
43 | CC = vc
44 | LINK = vc
45 | CC_PPC = vc
46 | LINK_PPC = vc
47 |
48 | CPU ?= 000
49 |
50 | ##########################################################################
51 | # INCLUDES settings
52 | ##########################################################################
53 |
54 | ifneq (,$(filter 000 030 040 060,$(CPU)))
55 | INCLUDES += -I$(NDK32_INC) -I$(MUI50_INC)
56 | endif
57 | ifneq (,$(filter OS4,$(CPU)))
58 | INCLUDES += -I$(AOS4_SDK_INC) -I$(MUI50_INC) \
59 | -I$(AOS4_SDK_INC)/../../local/common/include
60 | endif
61 | ifneq (,$(filter MOS,$(CPU)))
62 | INCLUDES += -I$(NDK_INC) -I$(MUI50_INC)
63 | endif
64 |
65 | ##########################################################################
66 | # CFLAGS settings
67 | ##########################################################################
68 |
69 | CFLAGS = -c -dontwarn=-1 -O2 -c99 $(VERS_FLAGS)
70 |
71 | ifneq (,$(filter 000 030 040 060,$(CPU)))
72 | CFLAGS += +aos68k -cpu=68$(CPU) -DCPU_VERS=68$(CPU)
73 | endif
74 | ifneq (,$(filter OS4,$(CPU)))
75 | CFLAGS += +aosppc -D__USE_INLINE__ -DCPU_VERS=AmigaOS4
76 | endif
77 | ifneq (,$(filter MOS,$(CPU)))
78 | CFLAGS += +morphos -DCPU_VERS=MorphOS -D__morphos__
79 | endif
80 |
81 | ifeq ($(DEBUG), 1)
82 | CFLAGS += -g -hunkdebug
83 | endif
84 |
85 | ##########################################################################
86 | # Linker settings
87 | ##########################################################################
88 | LIBFLAGS = -lamiga
89 |
90 | ifeq ($(DEBUG), 1)
91 | LIBFLAGS += -g -Bamigahunk
92 | endif
93 |
94 | ifneq (,$(filter 000 030 040 060,$(CPU)))
95 | LIBFLAGS += +aos68k -o
96 | endif
97 | ifneq (,$(filter OS4,$(CPU)))
98 | LIBFLAGS += +aosppc -o
99 | endif
100 | ifneq (,$(filter MOS,$(CPU)))
101 | LIBFLAGS += +morphos -o
102 | endif
103 |
104 |
105 | ##########################################################################
106 | # Object files which are part of iGame
107 | ##########################################################################
108 |
109 | igame_OBJS = src/funcs_$(CPU).o src/iGameGUI_$(CPU).o \
110 | src/iGameMain_$(CPU).o src/strfuncs_$(CPU).o src/fsfuncs_$(CPU).o \
111 | src/slavesList_$(CPU).o src/genresList_$(CPU).o \
112 | src/chipsetList_$(CPU).o
113 |
114 | ##########################################################################
115 | # Rule for building
116 | ##########################################################################
117 |
118 | iGame: $(igame_OBJS)
119 | @echo "\nLinking iGame.$(CPU)\n"
120 | @$(LINK) $(igame_OBJS) $(LIBFLAGS) $@.$(CPU)
121 |
122 | ##########################################################################
123 | # catalog files
124 | ##########################################################################
125 |
126 | include make_includes/catalogs.inc
127 |
128 | catalogs/%/iGame.catalog: catalogs/%/iGame.ct catalogs/iGame.cd
129 | flexcat catalogs/iGame.cd $< CATALOG $@ FILL QUIET || exit 0
130 |
131 | ##########################################################################
132 | # build rules
133 | ##########################################################################
134 |
135 | %_$(CPU).o: %.c
136 | @echo "\nCompiling $<"
137 | @$(CC) -c $< -o $*_$(CPU).o $(CFLAGS) $(INCLUDES)
138 |
139 | src/funcs_$(CPU).o: src/funcs.c src/iGame_strings.h src/strfuncs.h \
140 | src/fsfuncs.h src/iGameExtern.h src/slavesList.h src/genresList.h \
141 | src/chipsetList.h
142 |
143 | src/iGameGUI_$(CPU).o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h \
144 | src/fsfuncs.h src/iGameExtern.h src/version.h
145 |
146 | src/iGameMain_$(CPU).o: src/iGameMain.c src/iGameExtern.h
147 |
148 | src/strfuncs_$(CPU).o: src/strfuncs.c src/iGameExtern.h src/strfuncs.h
149 |
150 | src/fsfuncs_$(CPU).o: src/fsfuncs.c src/fsfuncs.h src/funcs.h \
151 | src/iGameExtern.h src/slavesList.h src/genresList.h src/chipsetList.h
152 |
153 | src/slavesList_$(CPU).o: src/slavesList.c src/slavesList.h
154 |
155 | src/genresList_$(CPU).o: src/genresList.c src/genresList.h src/strfuncs.h
156 |
157 | src/chipsetList_$(CPU).o: src/chipsetList.c src/chipsetList.h src/strfuncs.h
158 |
159 | ##########################################################################
160 | # generic rules
161 | ##########################################################################
162 |
163 | clean:
164 | rm iGame iGame.* $(igame_OBJS) $(catalog_files)
165 |
166 | release: $(catalog_files)
167 | ifneq ($(origin DRONE_TAG),undefined)
168 | sed -i "s/VERSION_TAG/$(DRONE_TAG)/" ./required_files/iGame.guide
169 | sed -i "s/RELEASE_DATE/$(shell date "+%d.%m.%Y")/" ./required_files/iGame.guide
170 | endif
171 | cp -r required_files iGame-$(DRONE_TAG)
172 | cp iGame-$(DRONE_TAG)/igame_drawer_3.0.info iGame-$(DRONE_TAG).info
173 | mv iGame-$(DRONE_TAG)/igame_drawer_3.0.info iGame-$(DRONE_TAG)/extras/icons
174 | mv iGame-$(DRONE_TAG)/igame_drawer.info iGame-$(DRONE_TAG)/extras/icons
175 | mkdir iGame-$(DRONE_TAG)/catalogs
176 | cp catalogs/iGame.cd iGame-$(DRONE_TAG)/catalogs/
177 | cd iGame-$(DRONE_TAG) && mkdir $(catalog_dirs)
178 | for c in $(catalog_files); do cp $$c iGame-$(DRONE_TAG)/$$(dirname $$c)/; done
179 | ifneq ($(origin DRONE_TAG),undefined)
180 | sed -i "s/VERSION_TAG/$(DRONE_TAG)/" ./CHANGELOG.md
181 | sed -i "s/RELEASE_DATE/$(shell date "+%Y-%m-%d")/" ./CHANGELOG.md
182 | endif
183 | cp CHANGELOG.md iGame-$(DRONE_TAG)/
184 | if [ -f "iGame.000" ]; then cp iGame.000 iGame-$(DRONE_TAG)/iGame; fi
185 | if [ -f "iGame.030" ]; then cp iGame.030 iGame-$(DRONE_TAG)/; fi
186 | if [ -f "iGame.040" ]; then cp iGame.040 iGame-$(DRONE_TAG)/; fi
187 | if [ -f "iGame.060" ]; then cp iGame.060 iGame-$(DRONE_TAG)/; fi
188 | if [ -f "iGame.MOS" ]; then cp iGame.MOS iGame-$(DRONE_TAG)/; fi
189 | if [ -f "iGame.OS4" ]; then cp iGame.OS4 iGame-$(DRONE_TAG)/; fi
190 | lha -aq2o6 iGame-$(DRONE_TAG)-$(DATESTR).lha iGame-$(DRONE_TAG)/ iGame-$(DRONE_TAG).info
191 |
192 | clean-release:
193 | rm -rf iGame-$(DRONE_TAG)
194 | rm iGame-$(DRONE_TAG)-$(DATESTR).lha
195 | rm iGame-$(DRONE_TAG).info
196 |
--------------------------------------------------------------------------------
/Makefile.linux:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Makefile for iGame on Linux using VBCC.
3 | #-------------------------------------------------------------------------
4 | # To compile an iGame flat executable using this makefile, run:
5 | # make -f Makefile.linux
6 | #-------------------------------------------------------------------------
7 | ##########################################################################
8 |
9 | ##########################################################################
10 | # Default: Build iGame with standard optimizations and 000 support
11 | ##########################################################################
12 | all: iGame
13 |
14 | ##########################################################################
15 | # Set up version and date properties
16 | ##########################################################################
17 |
18 | DATE = $(shell date --iso=date)
19 |
20 | ##########################################################################
21 | # Compiler settings
22 | ##########################################################################
23 | CC = vc
24 | LINK = vc
25 | CC_PPC = vc
26 | LINK_PPC = vc
27 |
28 | INCLUDES = -I$(NDK_INC) -I$(MUI38_INC)
29 | INCLUDES_OS4= -I$(SDK_INC) -I$(MUI50_INC)
30 | INCLUDES_MOS= -I$(NDK_INC) -I$(MUI50_INC)
31 |
32 | CFLAGS = -c +aos68k -dontwarn=-1 -O2 -c99 -DCPU_VERS=68000 -DRELEASE_DATE=$(DATE)
33 | CFLAGS_030 = -c +aos68k -cpu=68030 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68030 -DRELEASE_DATE=$(DATE)
34 | CFLAGS_040 = -c +aos68k -cpu=68040 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68040 -DRELEASE_DATE=$(DATE)
35 | CFLAGS_060 = -c +aos68k -cpu=68060 -dontwarn=-1 -O2 -c99 -DCPU_VERS=68060 -DRELEASE_DATE=$(DATE)
36 | CFLAGS_MOS = -c +morphos -dontwarn=-1 -O2 -DCPU_VERS=MorphOS -DRELEASE_DATE=$(DATE)
37 | CFLAGS_OS4 = -c +aosppc -dontwarn=-1 -O2 -D__USE_INLINE__ -DCPU_VERS=AmigaOS4 -DRELEASE_DATE=$(DATE)
38 |
39 | ##########################################################################
40 | # Builder settings
41 | ##########################################################################
42 | #MKLIB = join
43 | LIBFLAGS = +aos68k -lamiga -lauto -o
44 | LIBFLAGS_MOS = +morphos -lamiga -lauto -o
45 | LIBFLAGS_OS4 = +aosppc -lamiga -lauto -o
46 |
47 | ##########################################################################
48 | # Object files which are part of iGame
49 | ##########################################################################
50 |
51 | include make_includes/obj_files.inc
52 |
53 | ##########################################################################
54 | # Rule for building
55 | ##########################################################################
56 |
57 | include make_includes/rules.inc
58 |
59 | ##########################################################################
60 | # catalog files
61 | ##########################################################################
62 |
63 | include make_includes/catalogs.inc
64 |
65 | catalogs/%/iGame.catalog: catalogs/%/iGame.ct catalogs/iGame.cd
66 | flexcat catalogs/iGame.cd $< CATALOG $@ FILL QUIET || exit 0
67 |
68 | ##########################################################################
69 | # object files (generic 000)
70 | ##########################################################################
71 |
72 | include make_includes/obj_000.inc
73 |
74 | ##########################################################################
75 | # object files (030)
76 | ##########################################################################
77 |
78 | include make_includes/obj_030.inc
79 |
80 | ##########################################################################
81 | # object files (040)
82 | ##########################################################################
83 |
84 | include make_includes/obj_040.inc
85 |
86 | ##########################################################################
87 | # object files (060)
88 | ##########################################################################
89 |
90 | include make_includes/obj_060.inc
91 |
92 | ##########################################################################
93 | # object files (MOS)
94 | ##########################################################################
95 |
96 | include make_includes/obj_mos.inc
97 |
98 | ##########################################################################
99 | # object files (AOS4)
100 | ##########################################################################
101 |
102 | include make_includes/obj_os4.inc
103 |
104 | ##########################################################################
105 | # generic build options
106 | ##########################################################################
107 |
108 | clean:
109 | rm iGame iGame.* src/funcs*.o src/iGameGUI*.o src/iGameMain*.o src/strfuncs*.o src/iGame_cat*.o $(catalog_files)
110 |
111 | # pack everything in a nice lha file
112 | release: $(catalog_files)
113 | cp required_files iGame_rel/iGame-$(DATE) -r
114 | cp alt_icons iGame_rel/iGame-$(DATE)/Icons -r
115 | cp iGame_rel/iGame-$(DATE)/igame_drawer_3.0.info iGame_rel/iGame-$(DATE).info
116 | mv iGame_rel/iGame-$(DATE)/igame_drawer_3.0.info iGame_rel/iGame-$(DATE)/Icons/
117 | mv iGame_rel/iGame-$(DATE)/igame_drawer.info iGame_rel/iGame-$(DATE)/Icons/
118 | mkdir iGame_rel/iGame-$(DATE)/catalogs
119 | cp catalogs/iGame.cd iGame_rel/iGame-$(DATE)/catalogs/
120 | cd iGame_rel/iGame-$(DATE) && mkdir $(catalog_dirs)
121 | for c in $(catalog_files); do cp $$c iGame_rel/iGame-$(DATE)/$$(dirname $$c)/; done
122 | if [ -f "iGame" ]; then cp iGame iGame_rel/iGame-$(DATE)/; fi
123 | if [ -f "iGame.030" ]; then cp iGame.030 iGame_rel/iGame-$(DATE)/; fi
124 | if [ -f "iGame.040" ]; then cp iGame.040 iGame_rel/iGame-$(DATE)/; fi
125 | if [ -f "iGame.060" ]; then cp iGame.060 iGame_rel/iGame-$(DATE)/; fi
126 | if [ -f "iGame.MOS" ]; then cp iGame.MOS iGame_rel/iGame-$(DATE)/; fi
127 | if [ -f "iGame.OS4" ]; then cp iGame.OS4 iGame_rel/iGame-$(DATE)/; fi
128 | cp CHANGELOG.md iGame_rel/iGame=$(DATE)/
129 | cd iGame_rel && lha -aq2o6 iGame-$(DATE).lha iGame-$(DATE)/ iGame-$(DATE).info
130 |
131 | clean-release:
132 | rm -rf iGame_rel/iGame-$(DATE)
133 | rm iGame_rel/iGame-$(DATE).lha
134 | rm iGame_rel/iGame-$(DATE).info
135 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://www.codacy.com/gh/walkero-gr/iGame/dashboard?utm_source=github.com&utm_medium=referral&utm_content=walkero-gr/iGame&utm_campaign=Badge_Grade)
2 |
3 | ## Description
4 |
5 | iGame is a frontend to launching WHDLoad games for the Amiga. It is implemented as a MUI application.
6 |
7 | http://winterland.no-ip.org/igame/
8 |
9 | 
10 |
11 | ## Builds and releases
12 |
13 | The iGame_rel folder should contain builds that are done at some point in time, following any major code changes.
14 |
15 | ## Installing
16 |
17 | Just place the iGame folder anywhere you want on your drive. iGame also requires the following libraries to work:
18 |
19 | * guigfx.mcc
20 | * TextEditor.mcc
21 | * render.library
22 | * guigfx.library
23 | * lowlevel.library (optional, for joystick navigation support)
24 |
25 | Make sure your installation contains MUI and the above libraries. You can find the latest versions in Aminet.
26 |
27 | ## Compiling
28 |
29 | Please check the [Wiki](https://github.com/MrZammler/iGame/wiki/Compiling-iGame)
30 |
31 | ## Contributing
32 |
33 | Please do :-)
34 |
35 | ## Usage
36 |
37 | Docs for the usage of iGame can be found inside the guide directory. The guide will be packed inside iGame releases and
38 | can also be brought up by pressing the Help key when running iGame.
39 |
--------------------------------------------------------------------------------
/aminet.readme:
--------------------------------------------------------------------------------
1 | Short: Front-end for WHDLoad
2 | Uploader: walkero@gmail.com (George Sokianos)
3 | Author: mrzammler@freemail.gr (Emmanuel Vasilakis)
4 | Type: util/misc
5 | Version: VERSION_TAG
6 | Architecture: m68k-amigaos >= 2.04; ppc-amigaos; ppc-morphos
7 | Distribution: Aminet
8 | Replaces: util/misc/iGame.lha
9 |
10 | iGame is a front-end application for your WHDLoad games and demos collection.
11 | It runs on AmigaOS 2.04 and above, AmigaOS 4 and MorphOS.
12 |
13 | Features
14 |
15 | * Multiple WHDLoad slaves repositories on hard disk partitions
16 | * On-demand scanning in repositories for installed WHDLoad slaves (games,
17 | demos etc.)
18 | * Use games' tooltypes on the run
19 | * Shows game screenshot (screenshot window can be altered through
20 | tooltypes/settings uses datatypes to load foreign formats)
21 | * Categorization of the games and filtering
22 | * Manual addition of non-WHDLoad games, demos etc.
23 | * Simple statistics
24 | * Find-as-you-type search filter
25 |
26 | iGame can "discover" your games on pre-defined repositories and create a small
27 | database. You can then categorize each game according to its genre, provide a
28 | small screenshot image to be displayed when the game is selected and quickly
29 | find the one you're looking for, using the filtering gadget.
30 |
31 | But iGame can support more than just WHDLoad games or demos. You can add and
32 | launch any type of executable, though it mostly makes sense if it's a game ;-)
33 |
34 | iGame can be found on many AmigaOS distributions like AmiKit XE and ApolloOS.
35 |
36 | iGame was initially developed on an Amiga 3000 with a CSMKII 68060 with
37 | 128MB RAM, using the Cubic IDE (gcc). Nowadays, we use mostly vbcc as a
38 | cross-compiler on a Linux system.
39 |
40 | iGame is open source and free software, licensed under the GPLv3, and you can
41 | find it at the following websites.
42 |
43 | https://github.com/MrZammler/iGame
44 | http://winterland.no-ip.org/igame/index.html
45 |
46 | Requirements:
47 | * Kickstart 2.04 or higher
48 | * Workbench 2.1 or higher
49 | * MUI 3.8 or higher
50 | * icon.library v37+ (v44+ Recommended)
51 | * guigfx.library
52 | * render.library
53 | * guigfx.mcc
54 | * Texteditor.mcc
55 | * NListviews.mcc
56 |
57 | The project is open source and you can find the code at:
58 | https://github.com/MrZammler/iGame
59 |
60 | If you have any requests or you would like to report any problems you found,
61 | you can do that at:
62 | https://github.com/MrZammler/iGame/issues
63 |
64 |
65 | Changelog
66 | -------------
67 | Please read the enclosed CHANGELOG.md file for all the changes, or find
68 | them online at:
69 | https://raw.githubusercontent.com/MrZammler/iGame/master/CHANGELOG.md
70 |
--------------------------------------------------------------------------------
/catalogs/C_c.sd:
--------------------------------------------------------------------------------
1 | ##rem $Id$
2 | ##stringtype C
3 | ##shortstrings
4 | /*
5 | %b_cat.c
6 | Translatable strings for iGame
7 |
8 | Copyright (c) 2018, Emmanuel Vasilakis
9 |
10 | This file is part of iGame.
11 |
12 | iGame is free software: you can redistribute it and/or modify
13 | it under the terms of the GNU General Public License as published by
14 | the Free Software Foundation, either version 3 of the License, or
15 | (at your option) any later version.
16 |
17 | iGame is distributed in the hope that it will be useful,
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | GNU General Public License for more details.
21 |
22 | You should have received a copy of the GNU General Public License
23 | along with iGame. If not, see .
24 | */
25 |
26 | /****************************************************************
27 |
28 | This file was created automatically by `%fv'
29 | from "%f0".
30 |
31 | Do NOT edit by hand!
32 |
33 | ****************************************************************/
34 |
35 | /****************************************************************
36 | This file uses the auto initialization features of
37 | Dice, gcc, SAS/C and VBCC, respectively.
38 |
39 | Dice does this by using the __autoinit and __autoexit
40 | keywords, whereas SAS/C uses names beginning with _STI
41 | or _STD, respectively. gcc uses the asm() instruction
42 | to emulate C++ constructors and destructors. VBCC uses
43 | names starting with _INIT_n_ and _INIT_n_, respectively,
44 | where n can be any digit between 1 and 9 inclusive.
45 |
46 | Using this file you don't have *all* the benefits of
47 | locale.library (no Locale or Language arguments are
48 | supported when opening the catalog). However, these are
49 | *very* rarely used, so this should be sufficient for most
50 | applications.
51 | ****************************************************************/
52 |
53 | /*
54 | Include files and compiler specific stuff
55 | */
56 |
57 | #include
58 | #include
59 | #include
60 |
61 | #include
62 | #include
63 | #include
64 |
65 | #include
66 | #include
67 |
68 | #include "%b_cat.h"
69 |
70 |
71 | /*
72 | Variables
73 | */
74 |
75 | struct FC_String %b_Strings[%n] = {
76 | { (STRPTR) %s, %d }%(,)
77 | };
78 |
79 | STATIC struct Catalog *%bCatalog = NULL;
80 | #ifdef LOCALIZE_V20
81 | STATIC STRPTR %bStrings = NULL;
82 | STATIC ULONG %bStringsSize;
83 | #endif
84 |
85 |
86 | #if defined(_DCC)
87 | STATIC __autoexit VOID _STDClose%bCatalog(VOID)
88 | #elif defined(__SASC)
89 | VOID _STDClose%bCatalog(VOID)
90 | #elif defined(__GNUC__)
91 | STATIC VOID __attribute__ ((destructor)) _STDClose%bCatalog(VOID)
92 | #elif defined(__VBCC__)
93 | void _EXIT_9_Close%bCatalog(void)
94 | #else
95 | VOID Close%bCatalog(VOID)
96 | #endif
97 |
98 | {
99 | if (%bCatalog) {
100 | CloseCatalog(%bCatalog);
101 | }
102 | #ifdef LOCALIZE_V20
103 | if (%bStrings) {
104 | FreeMem(%bStrings, %bStringsSize);
105 | }
106 | #endif
107 | }
108 |
109 |
110 | #if defined(_DCC)
111 | STATIC __autoinit VOID _STIOpen%bCatalog(VOID)
112 | #elif defined(__SASC)
113 | VOID _STIOpen%bCatalog(VOID)
114 | #elif defined(__GNUC__)
115 | VOID __attribute__ ((constructor)) _STIOpen%bCatalog(VOID)
116 | #elif defined(__VBCC__)
117 | void _INIT_9_Open%bCatalog(void)
118 | #else
119 | VOID Open%bCatalog(VOID)
120 | #endif
121 |
122 | {
123 | if (LocaleBase) {
124 | if ((%bCatalog = OpenCatalog(NULL, (STRPTR) "%b.catalog",
125 | OC_BuiltInLanguage, %l,
126 | OC_Version, %v,
127 | TAG_DONE))) {
128 | struct FC_String *fc;
129 | int i;
130 |
131 | for (i = 0, fc = %b_Strings; i < %n; i++, fc++) {
132 | fc->msg = GetCatalogStr(%bCatalog, fc->id, (STRPTR) fc->msg);
133 | }
134 | }
135 | }
136 | }
137 |
138 |
139 |
140 |
141 | #ifdef LOCALIZE_V20
142 | VOID Init%bCatalog(STRPTR language)
143 |
144 | {
145 | struct IFFHandle *iffHandle;
146 |
147 | /*
148 | ** Use iffparse.library only, if we need to.
149 | */
150 | if (LocaleBase || !IFFParseBase || !language ||
151 | Stricmp(language, %l) == 0) {
152 | return;
153 | }
154 |
155 | if ((iffHandle = AllocIFF())) {
156 | char path[128]; /* Enough to hold 4 path items (dos.library V40) */
157 | strcpy(path, "PROGDIR:Catalogs");
158 | AddPart((STRPTR) path, language, sizeof(path));
159 | AddPart((STRPTR) path, "%b.catalog", sizeof(path));
160 | if (!(iffHandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE))) {
161 | strcpy(path, "LOCALE:Catalogs");
162 | AddPart((STRPTR) path, language, sizeof(path));
163 | AddPart((STRPTR) path, language, sizeof(path));
164 | iffHandle->iff_Stream = Open((STRPTR) path, MODE_OLDFILE);
165 | }
166 |
167 | if (iffHandle->iff_Stream) {
168 | InitIFFasDOS(iffHandle);
169 | if (!OpenIFF(iffHandle, IFFF_READ)) {
170 | if (!PropChunk(iffHandle, MAKE_ID('C','T','L','G'),
171 | MAKE_ID('S','T','R','S'))) {
172 | struct StoredProperty *sp;
173 | int error;
174 |
175 | for (;;) {
176 | if ((error = ParseIFF(iffHandle, IFFPARSE_STEP))
177 | == IFFERR_EOC) {
178 | continue;
179 | }
180 | if (error) {
181 | break;
182 | }
183 |
184 | if ((sp = FindProp(iffHandle, MAKE_ID('C','T','L','G'),
185 | MAKE_ID('S','T','R','S')))) {
186 | /*
187 | ** Check catalog and calculate the needed
188 | ** number of bytes.
189 | ** A catalog string consists of
190 | ** ID (LONG)
191 | ** Size (LONG)
192 | ** Bytes (long word padded)
193 | */
194 | LONG bytesRemaining;
195 | LONG *ptr;
196 |
197 | %bStringsSize = 0;
198 | bytesRemaining = sp->sp_Size;
199 | ptr = (LONG *) sp->sp_Data;
200 |
201 | while (bytesRemaining > 0) {
202 | LONG skipSize, stringSize;
203 |
204 | ptr++; /* Skip ID */
205 | stringSize = *ptr++;
206 | skipSize = ((stringSize+3) >> 2);
207 |
208 | %bStringsSize += stringSize+1; /* NUL */
209 | bytesRemaining -= 8 + (skipSize << 2);
210 | ptr += skipSize;
211 | }
212 |
213 | if (!bytesRemaining &&
214 | (%bStrings = AllocMem(%bStringsSize, MEMF_ANY))) {
215 | STRPTR sptr;
216 |
217 | bytesRemaining = sp->sp_Size;
218 | ptr = (LONG *) sp->sp_Data;
219 | sptr = %bStrings;
220 |
221 | while (bytesRemaining) {
222 | LONG skipSize, stringSize, id;
223 | struct FC_String *fc;
224 | int i;
225 |
226 | id = *ptr++;
227 | stringSize = *ptr++;
228 | skipSize = ((stringSize+3) >> 2);
229 |
230 | CopyMem(ptr, sptr, stringSize);
231 | bytesRemaining -= 8 + (skipSize << 2);
232 | ptr += skipSize;
233 |
234 | for (i = 0, fc = %b_Strings; i < %n; i++, fc++) {
235 | if (fc->id == id) {
236 | fc->msg = sptr;
237 | }
238 | }
239 |
240 | sptr += stringSize;
241 | *sptr++ = '\\0';
242 | }
243 | }
244 | break;
245 | }
246 | }
247 | }
248 | CloseIFF(iffHandle);
249 | }
250 | Close(iffHandle->iff_Stream);
251 | }
252 | FreeIFF(iffHandle);
253 | }
254 | }
255 | #endif
256 |
--------------------------------------------------------------------------------
/catalogs/C_h.sd:
--------------------------------------------------------------------------------
1 | ##rem $Id$
2 | ##stringtype C
3 | ##shortstrings
4 | /*
5 | %b_cat.h
6 | Header strings file for iGame
7 |
8 | Copyright (c) 2018, Emmanuel Vasilakis
9 |
10 | This file is part of iGame.
11 |
12 | iGame is free software: you can redistribute it and/or modify
13 | it under the terms of the GNU General Public License as published by
14 | the Free Software Foundation, either version 3 of the License, or
15 | (at your option) any later version.
16 |
17 | iGame is distributed in the hope that it will be useful,
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | GNU General Public License for more details.
21 |
22 | You should have received a copy of the GNU General Public License
23 | along with iGame. If not, see .
24 | */
25 |
26 | /****************************************************************
27 |
28 | This file was created automatically by `%fv'
29 | from "%f0".
30 |
31 | Do NOT edit by hand!
32 |
33 | ****************************************************************/
34 |
35 | #ifndef %b_CAT_H
36 | #define %b_CAT_H
37 |
38 |
39 | #ifndef EXEC_TYPES_H
40 | #include
41 | #endif
42 |
43 |
44 | /*
45 | ** Prototypes
46 | */
47 | #if !defined(__GNUC__) && !defined(__SASC) && !defined(_DCC)
48 | extern VOID Open%bCatalog(VOID);
49 | extern VOID Close%bCatalog(VOID);
50 | #endif
51 | #ifdef LOCALIZE_V20
52 | extern void Init%bCatalog(STRPTR);
53 | #endif
54 |
55 |
56 |
57 | struct FC_String {
58 | const UBYTE *msg;
59 | LONG id;
60 | };
61 |
62 | extern struct FC_String %b_Strings[%n];
63 |
64 | #define %i (%b_Strings[%e].msg)\n#define _%i (%b_Strings+%e)
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/catalogs/CatComp_h.sd:
--------------------------------------------------------------------------------
1 | ##rem $Id$
2 | ##stringtype C
3 | ##shortstrings
4 | /*
5 | %b_strings.h
6 | Header strings file for iGame
7 |
8 | Copyright (c) 2018, Emmanuel Vasilakis
9 |
10 | This file is part of iGame.
11 |
12 | iGame is free software: you can redistribute it and/or modify
13 | it under the terms of the GNU General Public License as published by
14 | the Free Software Foundation, either version 3 of the License, or
15 | (at your option) any later version.
16 |
17 | iGame is distributed in the hope that it will be useful,
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | GNU General Public License for more details.
21 |
22 | You should have received a copy of the GNU General Public License
23 | along with iGame. If not, see .
24 | */
25 |
26 | /****************************************************************
27 |
28 | This file was created automatically by `%fv'
29 | from "%f0"
30 |
31 | using the custom CatComp_h.sd
32 |
33 | Do NOT edit by hand!
34 |
35 | ****************************************************************/
36 |
37 | #ifndef %b_STRINGS_H
38 | #define %b_STRINGS_H
39 |
40 | #ifndef EXEC_TYPES_H
41 | #include
42 | #endif
43 |
44 | #ifdef %b_CODE
45 | #ifndef %b_BLOCK
46 | #define %b_ARRAY
47 | #endif
48 | #endif
49 |
50 | #ifdef %b_ARRAY
51 | #ifndef %b_NUMBERS
52 | #define %b_NUMBERS
53 | #endif
54 | #ifndef %b_STRINGS
55 | #define %b_STRINGS
56 | #endif
57 | #endif
58 |
59 | #ifdef %b_BLOCK
60 | #ifndef %b_STRINGS
61 | #define %b_STRINGS
62 | #endif
63 | #endif
64 |
65 |
66 | /****************************************************************************/
67 |
68 |
69 | #ifdef %b_NUMBERS
70 |
71 | #define %i %d
72 |
73 | #endif /* %b_NUMBERS */
74 |
75 |
76 | /****************************************************************************/
77 |
78 |
79 | #ifdef %b_STRINGS
80 |
81 | #define %i_STR %s
82 |
83 | #endif /* %b_STRINGS */
84 |
85 |
86 | /****************************************************************************/
87 |
88 |
89 | #ifdef %b_ARRAY
90 |
91 | struct %b_ArrayType
92 | {
93 | LONG cca_ID;
94 | CONST_STRPTR cca_Str;
95 | };
96 |
97 | static const struct %b_ArrayType %b_Array[] =
98 | {
99 | { %i, (CONST_STRPTR)%i_STR },
100 | };
101 |
102 |
103 | #endif /* %b_ARRAY */
104 |
105 |
106 | /****************************************************************************/
107 |
108 |
109 | #ifdef %b_BLOCK
110 |
111 | STATIC CONST UBYTE %b_Block[] =
112 | {
113 |
114 | "%4a" "%2t"\n %i_STR "%z"
115 |
116 | };
117 |
118 | #endif /* %b_BLOCK */
119 |
120 |
121 | /****************************************************************************/
122 |
123 |
124 | #ifndef PROTO_LOCALE_H
125 | #ifndef __NOLIBBASE__
126 | #define _NLB_DEFINED_
127 | #define __NOLIBBASE__
128 | #endif
129 | #ifndef __NOGLOBALIFACE__
130 | #define _NGI_DEFINED_
131 | #define __NOGLOBALIFACE__
132 | #endif
133 | #include
134 | #ifdef _NLB_DEFINED_
135 | #undef __NOLIBBASE__
136 | #undef _NLB_DEFINED_
137 | #endif
138 | #ifdef _NGI_DEFINED_
139 | #undef __NOGLOBALIFACE__
140 | #undef _NGI_DEFINED_
141 | #endif
142 | #endif
143 |
144 | struct %b_LocaleInfo
145 | {
146 | #ifndef __amigaos4__
147 | struct Library *li_LocaleBase;
148 | #else
149 | struct LocaleIFace *li_ILocale;
150 | #endif
151 | struct Catalog *li_Catalog;
152 | };
153 |
154 |
155 | #ifdef __cplusplus
156 | extern "C" {
157 | #endif /* __cplusplus */
158 |
159 | CONST_STRPTR %b_GetString(struct %b_LocaleInfo *li, LONG stringNum);
160 |
161 | #ifdef __cplusplus
162 | }
163 | #endif /* __cplusplus */
164 |
165 |
166 | #ifdef %b_CODE
167 |
168 |
169 | CONST_STRPTR %b_GetString(struct %b_LocaleInfo *li, LONG stringNum)
170 | {
171 | #ifndef __amigaos4__
172 | struct Library *LocaleBase = li->li_LocaleBase;
173 | #else
174 | struct LocaleIFace *ILocale = li->li_ILocale;
175 | #endif
176 | LONG *l;
177 | UWORD *w;
178 | CONST_STRPTR builtIn = NULL;
179 |
180 | l = (LONG *)CatCompBlock;
181 |
182 | while (*l != stringNum && l < (LONG *)(&CatCompBlock[sizeof(CatCompBlock)]))
183 | {
184 | w = (UWORD *)((ULONG)l + 4);
185 | l = (LONG *)((ULONG)l + (ULONG)*w + 6);
186 | }
187 | if (*l == stringNum)
188 | {
189 | builtIn = (CONST_STRPTR)((ULONG)l + 6);
190 | }
191 |
192 | #ifndef __amigaos4__
193 | if (LocaleBase)
194 | {
195 | return GetCatalogStr(li->li_Catalog, stringNum, builtIn);
196 | }
197 | #else
198 | if (ILocale)
199 | {
200 | #ifdef __USE_INLINE__
201 | return GetCatalogStr(li->li_Catalog, stringNum, builtIn);
202 | #else
203 | return ILocale->GetCatalogStr(li->li_Catalog, stringNum, builtIn);
204 | #endif
205 | }
206 | #endif
207 | return builtIn;
208 | }
209 |
210 | #endif /* %b_CODE */
211 |
212 |
213 | /****************************************************************************/
214 |
215 |
216 | #endif /* %b_STRINGS_H */
217 |
--------------------------------------------------------------------------------
/catalogs/french/iGame.ct:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/catalogs/french/iGame.ct
--------------------------------------------------------------------------------
/catalogs/german/iGame.ct:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/catalogs/german/iGame.ct
--------------------------------------------------------------------------------
/catalogs/greek/iGame.ct:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/catalogs/greek/iGame.ct
--------------------------------------------------------------------------------
/catalogs/iGame.cd:
--------------------------------------------------------------------------------
1 | ; $VER: igame.cd 2.4 (06.05.2023)
2 | ;
3 | ;
4 | MSG_AppDescription (//)
5 | A front-end to WHDLoad
6 | ;
7 | MSG_AppCopyright (//)
8 | Emmanuel Vasilakis
9 | ;
10 | MSG_WI_MainWindow (//)
11 | iGame
12 | ;
13 | MSG_MNlabel2Actions (//)
14 | Actions
15 | ;
16 | MSG_MNlabelScan (//)
17 | Scan Repositories
18 | ;
19 | MSG_MNlabelScanChar (//)
20 | R_
21 | ;
22 | MSG_MNMainAddnonWHDLoadgame (//)
23 | Add game...
24 | ;
25 | MSG_MNMainAddnonWHDLoadgameChar (//)
26 | A_
27 | ;
28 | MSG_MNMainMenuShowHidehiddenentries (//)
29 | Show hidden entries
30 | ;
31 | MSG_MNMainOpenList (//)
32 | Open List...
33 | ;
34 | MSG_MNMainOpenListChar (//)
35 | O_
36 | ;
37 | MSG_MNMainSaveList (//)
38 | Save List
39 | ;
40 | MSG_MNMainSaveListChar (//)
41 | S_
42 | ;
43 | MSG_MNMainSaveListAs (//)
44 | Save List As...
45 | ;
46 | MSG_MNMainExportListtoTextfile (//)
47 | Export List to Text file...
48 | ;
49 | MSG_MNMainAbout (//)
50 | About...
51 | ;
52 | MSG_MNMainQuit (//)
53 | Quit
54 | ;
55 | MSG_MNMainQuitChar (//)
56 | Q_
57 | ;
58 | MSG_MNlabel2Game (//)
59 | Game
60 | ;
61 | MSG_MNMainMenuDuplicate (//)
62 | Duplicate...
63 | ;
64 | MSG_MNMainProperties (//)
65 | Properties...
66 | ;
67 | MSG_MNMainPropertiesChar (//)
68 | P_
69 | ;
70 | MSG_MNMainDelete (//)
71 | Delete
72 | ;
73 | MSG_MNMainDeleteChar (//)
74 | D_
75 | ;
76 | MSG_MNlabel2Tools (//)
77 | Settings
78 | ;
79 | MSG_MNMainiGameSettings (//)
80 | Settings...
81 | ;
82 | MSG_MNlabel2GameRepositories (//)
83 | Repositories...
84 | ;
85 | MSG_MNMainMUISettings (//)
86 | MUI Settings...
87 | ;
88 | MSG_LA_Filter (//)
89 | Filter:
90 | ;
91 | MSG_LV_GenresListTitle (//)
92 | Genres
93 | ;
94 | MSG_WI_Properties (//)
95 | Game Properties
96 | ;
97 | MSG_STR_PropertiesGameTitleTitle (//)
98 | Title
99 | ;
100 | MSG_LA_PropertiesGenre (//)
101 | Genre:
102 | ;
103 | MSG_CY_PropertiesGenre0 (//)
104 | Unknown
105 | ;
106 | MSG_CH_PropertiesFavorite (//)
107 | Favourite:
108 | ;
109 | MSG_CH_PropertiesHidden (//)
110 | Hidden:
111 | ;
112 | MSG_LA_PropertiesTimesPlayed (//)
113 | Times Played:
114 | ;
115 | MSG_LA_PropertiesSlavePath (//)
116 | Slave Path:
117 | ;
118 | MSG_TX_PropertiesTooltypesTitle (//)
119 | Tooltypes
120 | ;
121 | MSG_BT_PropertiesOK (//)
122 | Save
123 | ;
124 | MSG_BT_PropertiesCancel (//)
125 | Cancel
126 | ;
127 | MSG_WI_GameRepositories (//)
128 | Game Repositories
129 | ;
130 | MSG_BT_AddRepo (//)
131 | Add
132 | ;
133 | MSG_BT_RemoveRepo (//)
134 | Remove
135 | ;
136 | MSG_BT_CloseRepoWindow (//)
137 | Close
138 | ;
139 | MSG_WI_AddNonWHDLoad (//)
140 | Add a Game
141 | ;
142 | MSG_LA_AddGameTitle (//)
143 | Title:
144 | ;
145 | MSG_LA_AddGamePath (//)
146 | Path:
147 | ;
148 | MSG_LA_AddGameGenre (//)
149 | Genre:
150 | ;
151 | MSG_CY_AddGameGenre0 (//)
152 | Unknown
153 | ;
154 | MSG_BT_AddGameOK (//)
155 | OK
156 | ;
157 | MSG_BT_AddGameCancel (//)
158 | Cancel
159 | ;
160 | MSG_WI_About (//)
161 | About iGame
162 | ;
163 | MSG_TX_About (//)
164 | Emmanuel Vasilakis (mrzammler@mm.st)\n& Contributors\n\n
165 | ;
166 | MSG_BT_AboutOK (//)
167 | OK
168 | ;
169 | MSG_WI_Settings (//)
170 | iGame Settings
171 | ;
172 | MSG_LA_HideScreenshots (//)
173 | Hide Screenshots
174 | ;
175 | MSG_GR_ScreenshotsTitle (//)
176 | Screenshots
177 | ;
178 | MSG_LA_NoGuiGfx (//)
179 | No GuiGfx
180 | ;
181 | MSG_LA_ScreenshotSize (//)
182 | Screenshot Size:
183 | ;
184 | MSG_CY_ScreenshotSize0 (//)
185 | 160x128
186 | ;
187 | MSG_CY_ScreenshotSize1 (//)
188 | 320x256
189 | ;
190 | MSG_CY_ScreenshotSize2 (//)
191 | Custom
192 | ;
193 | MSG_LA_Width (//)
194 | Width
195 | ;
196 | MSG_LA_Height (//)
197 | Height
198 | ;
199 | MSG_GR_TitlesTitle (//)
200 | Titles
201 | ;
202 | MSG_RA_TitlesFromTitle (//)
203 | Titles From:
204 | ;
205 | MSG_RA_TitlesFrom0 (//)
206 | Slave Contents
207 | ;
208 | MSG_RA_TitlesFrom1 (//)
209 | Directories
210 | ;
211 | MSG_LA_SmartSpaces (//)
212 | No Smart Spaces
213 | ;
214 | MSG_GR_MiscTitle (//)
215 | Misc
216 | ;
217 | MSG_LA_SaveStatsOnExit (//)
218 | Save stats on exit
219 | ;
220 | MSG_LA_FilterUseEnter (//)
221 | Use enter to filter
222 | ;
223 | MSG_LA_HideSidepanel (//)
224 | Hide side panel
225 | ;
226 | MSG_BT_SettingsSave (//)
227 | Save
228 | ;
229 | MSG_BT_SettingsUse (//)
230 | Use
231 | ;
232 | MSG_BT_SettingsCancel (//)
233 | Cancel
234 | ;
235 | MSG_SelectDir (//)
236 | Select path...
237 | ;
238 | MSG_GameExecutable (//)
239 | Select executable...
240 | ;
241 | MSG_TotalNumberOfGames (//)
242 | Total %d games.
243 | ;
244 | MSG_UnknownGenre (//)
245 | Unknown
246 | ;
247 | MSG_FilterShowAll (//)
248 | --Show All--
249 | ;
250 | MSG_FilterFavorites (//)
251 | --Favourites--
252 | ;
253 | MSG_FilterLastPlayed (//)
254 | --Last Played--
255 | ;
256 | MSG_FilterMostPlayed (//)
257 | --Most Played--
258 | ;
259 | MSG_FilterNeverPlayed (//)
260 | --Never Played--
261 | ;
262 | MSG_RunningGameTitle (//)
263 | Running %s...
264 | ;
265 | MSG_ErrorExecutingWhdload (//)
266 | Error while executing the selected entry.\nPlease make sure WHDLoad is in your path.
267 | ;
268 | MSG_ScanningPleaseWait (//)
269 | Scanning [%s]. Please wait...
270 | ;
271 | MSG_CouldNotCreateReposFile (//)
272 | Could not create repos.prefs file!
273 | ;
274 | MSG_SelectGameFromList (//)
275 | Please select an entry from the list.
276 | ;
277 | MSG_TitleAlreadyExists (//)
278 | The title you selected, already exists.
279 | ;
280 | MSG_SavingGamelist (//)
281 | Please wait, saving gameslist...
282 | ;
283 | MSG_FailedOpeningGameslist (//)
284 | Could not open gameslist file!
285 | ;
286 | MSG_BadTooltype (//)
287 | Bad tooltype!
288 | ;
289 | MSG_NoTitleSpecified (//)
290 | Please let me know the name of the game...
291 | ;
292 | MSG_NoExecutableSpecified (//)
293 | Please pick the game executable...
294 | ;
295 | MSG_NotEnoughMemory (//)
296 | Could not allocate memory! Aborting...
297 | ;
298 | MSG_DirectoryNotFound (//)
299 | Game Directory not found!
300 | ;
301 | MSG_LA_StartWithFavorites (//)
302 | Display favourites on start
303 | ;
304 | MSG_MNMainOpenCurrentDir (//)
305 | Open game folder
306 | ;
307 | MSG_MNMainOpenCurrentDirChar (//)
308 | W_
309 | ;
310 | MSG_slavePathDoesntExist (//)
311 | Slave path does not exist!
312 | ;
313 | MSG_compiledForAboutWin (//)
314 | compiled for
315 | ;
316 | MSG_MNMainPreferences (//)
317 | Preferences
318 | ;
319 | MSG_ScanCompletedUpdatingList (//)
320 | Scan completed. Updating the list now.
321 | ;
322 | MSG_LoadingSavedList (//)
323 | Loading the saved list. Please wait.
324 | ;
325 | MSG_ICONPICTURESTORE_FAILED (//)
326 | Could not store default picture icon
327 | ;
328 | MSG_LV_GAMESLIST_TITLE (//)
329 | Title
330 | ;
331 | MSG_LV_GAMESLIST_YEAR (//)
332 | Year
333 | ;
334 | MSG_LV_GAMESLIST_PLAYERS (//)
335 | Players
336 | ;
337 | MSG_LA_UseIgameDataTitle (//)
338 | Prefer igame.data
339 | ;
340 |
--------------------------------------------------------------------------------
/catalogs/italiano/iGame.ct:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/catalogs/italiano/iGame.ct
--------------------------------------------------------------------------------
/catalogs/turkish/iGame.ct:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/catalogs/turkish/iGame.ct
--------------------------------------------------------------------------------
/guigfx_render_nofpu.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/guigfx_render_nofpu.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2016-11-30.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2016-11-30.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2018-10-11.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2018-10-11.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2018-10-25.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2018-10-25.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2018-11-01.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2018-11-01.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2019-01-15.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2019-01-15.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2019-05-03.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2019-05-03.lha
--------------------------------------------------------------------------------
/iGame_rel/iGame-2020-09-04.lha:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/iGame_rel/iGame-2020-09-04.lha
--------------------------------------------------------------------------------
/igame_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/igame_screen.png
--------------------------------------------------------------------------------
/make_includes/catalogs.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # catalog files
3 | ##########################################################################
4 | src/iGame_strings.h: catalogs/iGame.cd catalogs/CatComp_h.sd
5 | ifeq ($(shell uname), AmigaOS)
6 | catcomp catalogs/iGame.cd CFILE src/iGame_strings.h
7 | else
8 | cd catalogs && flexcat iGame.cd ../src/iGame_strings.h=CatComp_h.sd
9 | endif
10 |
11 | catalog_files := $(patsubst %/iGame.ct,%/iGame.catalog,$(wildcard catalogs/*/iGame.ct))
12 | catalog_dirs := $(dir $(catalog_files))
13 |
14 | catalogs: $(catalog_files)
15 |
16 |
--------------------------------------------------------------------------------
/make_includes/obj_000.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # object files (generic 000)
3 | ##########################################################################
4 |
5 | src/funcs.o: src/funcs.c src/iGame_strings.h src/strfuncs.h src/fsfuncs.h src/iGameExtern.h
6 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ src/funcs.c
7 |
8 | src/iGameGUI.o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h src/fsfuncs.h src/iGameExtern.h
9 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ src/iGameGUI.c
10 |
11 | src/iGameMain.o: src/iGameMain.c src/iGameExtern.h
12 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ src/iGameMain.c
13 |
14 | src/strfuncs.o: src/strfuncs.c src/strfuncs.h
15 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ src/strfuncs.c
16 |
17 | src/fsfuncs.o: src/fsfuncs.c src/fsfuncs.h src/funcs.h src/iGameExtern.h
18 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ src/fsfuncs.c
19 |
--------------------------------------------------------------------------------
/make_includes/obj_030.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # object files (030)
3 | ##########################################################################
4 |
5 | src/funcs_030.o: src/funcs.c src/iGame_strings.h src/strfuncs.h src/fsfuncs.h
6 | $(CC) $(CFLAGS_030) $(INCLUDES) -o $@ src/funcs.c
7 |
8 | src/iGameGUI_030.o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h src/fsfuncs.h
9 | $(CC) $(CFLAGS_030) $(INCLUDES) -o $@ src/iGameGUI.c
10 |
11 | src/iGameMain_030.o: src/iGameMain.c
12 | $(CC) $(CFLAGS_030) $(INCLUDES) -o $@ src/iGameMain.c
13 |
14 | src/strfuncs_030.o: src/strfuncs.c src/strfuncs.h
15 | $(CC) $(CFLAGS_030) $(INCLUDES) -o $@ src/strfuncs.c
16 |
17 | src/fsfuncs_030.o: src/fsfuncs.c src/fsfuncs.h src/funcs.h src/iGameExtern.h
18 | $(CC) $(CFLAGS_030) $(INCLUDES) -o $@ src/fsfuncs.c
19 |
--------------------------------------------------------------------------------
/make_includes/obj_040.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # object files (040)
3 | ##########################################################################
4 |
5 | src/funcs_040.o: src/funcs.c src/iGame_strings.h src/strfuncs.h src/fsfuncs.h src/iGameExtern.h
6 | $(CC) $(CFLAGS_040) $(INCLUDES) -o $@ src/funcs.c
7 |
8 | src/iGameGUI_040.o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h src/fsfuncs.h src/iGameExtern.h
9 | $(CC) $(CFLAGS_040) $(INCLUDES) -o $@ src/iGameGUI.c
10 |
11 | src/iGameMain_040.o: src/iGameMain.c src/iGameExtern.h
12 | $(CC) $(CFLAGS_040) $(INCLUDES) -o $@ src/iGameMain.c
13 |
14 | src/strfuncs_040.o: src/strfuncs.c src/strfuncs.h
15 | $(CC) $(CFLAGS_040) $(INCLUDES) -o $@ src/strfuncs.c
16 |
17 | src/fsfuncs_040.o: src/fsfuncs.c src/fsfuncs.h src/funcs.h src/iGameExtern.h
18 | $(CC) $(CFLAGS_040) $(INCLUDES) -o $@ src/fsfuncs.c
19 |
--------------------------------------------------------------------------------
/make_includes/obj_060.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # object files (060)
3 | ##########################################################################
4 |
5 | src/funcs_060.o: src/funcs.c src/iGame_strings.h src/strfuncs.h src/fsfuncs.h src/iGameExtern.h
6 | $(CC) $(CFLAGS_060) $(INCLUDES) -o $@ src/funcs.c
7 |
8 | src/iGameGUI_060.o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h src/fsfuncs.h src/iGameExtern.h
9 | $(CC) $(CFLAGS_060) $(INCLUDES) -o $@ src/iGameGUI.c
10 |
11 | src/iGameMain_060.o: src/iGameMain.c src/iGameExtern.h
12 | $(CC) $(CFLAGS_060) $(INCLUDES) -o $@ src/iGameMain.c
13 |
14 | src/strfuncs_060.o: src/strfuncs.c src/strfuncs.h
15 | $(CC) $(CFLAGS_060) $(INCLUDES) -o $@ src/strfuncs.c
16 |
17 | src/fsfuncs_060.o: src/fsfuncs.c src/fsfuncs.h src/funcs.h src/iGameExtern.h
18 | $(CC) $(CFLAGS_060) $(INCLUDES) -o $@ src/fsfuncs.c
19 |
--------------------------------------------------------------------------------
/make_includes/obj_files.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Object files which are part of iGame
3 | ##########################################################################
4 |
5 | OBJS = src/funcs.o src/iGameGUI.o src/iGameMain.o src/strfuncs.o src/fsfuncs.o
6 | OBJS_030 = src/funcs_030.o src/iGameGUI_030.o src/iGameMain_030.o src/strfuncs_030.o src/fsfuncs_030.o
7 | OBJS_040 = src/funcs_040.o src/iGameGUI_040.o src/iGameMain_040.o src/strfuncs_040.o src/fsfuncs_040.o
8 | OBJS_060 = src/funcs_060.o src/iGameGUI_060.o src/iGameMain_060.o src/strfuncs_060.o src/fsfuncs_060.o
9 | OBJS_MOS = src/funcs_MOS.o src/iGameGUI_MOS.o src/iGameMain_MOS.o src/strfuncs_MOS.o src/fsfuncs_MOS.o
10 | OBJS_OS4 = src/funcs_OS4.o src/iGameGUI_OS4.o src/iGameMain_OS4.o src/strfuncs_OS4.o src/fsfuncs_OS4.o
11 |
--------------------------------------------------------------------------------
/make_includes/obj_mos.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # object files (MOS)
3 | ##########################################################################
4 |
5 | src/funcs_MOS.o: src/funcs.c src/iGame_strings.h src/strfuncs.h src/fsfuncs.h src/iGameExtern.h
6 | $(CC_PPC) $(CFLAGS_MOS) $(INCLUDES_MOS) -o $@ src/funcs.c
7 |
8 | src/iGameGUI_MOS.o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h src/fsfuncs.h src/iGameExtern.h
9 | $(CC_PPC) $(CFLAGS_MOS) $(INCLUDES_MOS) -o $@ src/iGameGUI.c
10 |
11 | src/iGameMain_MOS.o: src/iGameMain.c src/iGameExtern.h
12 | $(CC_PPC) $(CFLAGS_MOS) $(INCLUDES_MOS) -o $@ src/iGameMain.c
13 |
14 | src/strfuncs_MOS.o: src/strfuncs.c src/strfuncs.h
15 | $(CC_PPC) $(CFLAGS_MOS) $(INCLUDES_MOS) -o $@ src/strfuncs.c
16 |
17 | src/fsfuncs_MOS.o: src/fsfuncs.c src/fsfuncs.h src/funcs.h src/iGameExtern.h
18 | $(CC_PPC) $(CFLAGS_MOS) $(INCLUDES_MOS) -o $@ src/fsfuncs.c
19 |
--------------------------------------------------------------------------------
/make_includes/obj_os4.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # object files (AOS4)
3 | ##########################################################################
4 |
5 | src/funcs_OS4.o: src/funcs.c src/iGame_strings.h src/strfuncs.h src/fsfuncs.h src/iGameExtern.h
6 | $(CC_PPC) $(CFLAGS_OS4) $(INCLUDES_OS4) -o $@ src/funcs.c
7 |
8 | src/iGameGUI_OS4.o: src/iGameGUI.c src/iGameGUI.h src/iGame_strings.h src/fsfuncs.h src/iGameExtern.h
9 | $(CC_PPC) $(CFLAGS_OS4) $(INCLUDES_OS4) -o $@ src/iGameGUI.c
10 |
11 | src/iGameMain_OS4.o: src/iGameMain.c src/iGameExtern.h
12 | $(CC_PPC) $(CFLAGS_OS4) $(INCLUDES_OS4) -o $@ src/iGameMain.c
13 |
14 | src/strfuncs_OS4.o: src/strfuncs.c src/strfuncs.h
15 | $(CC_PPC) $(CFLAGS_OS4) $(INCLUDES_OS4) -o $@ src/strfuncs.c
16 |
17 | src/fsfuncs_OS4.o: src/fsfuncs.c src/fsfuncs.h src/funcs.h src/iGameExtern.h
18 | $(CC_PPC) $(CFLAGS_OS4) $(INCLUDES_OS4) -o $@ src/fsfuncs.c
19 |
--------------------------------------------------------------------------------
/make_includes/rules.inc:
--------------------------------------------------------------------------------
1 | ##########################################################################
2 | # Rule for building
3 | ##########################################################################
4 |
5 | iGame: $(OBJS)
6 | $(LINK) $(OBJS) $(LIBFLAGS) $@
7 |
8 | iGame.030: $(OBJS_030)
9 | $(LINK) $(OBJS_030) $(LIBFLAGS) $@
10 |
11 | iGame.040: $(OBJS_040)
12 | $(LINK) $(OBJS_040) $(LIBFLAGS) $@
13 |
14 | iGame.060: $(OBJS_060)
15 | $(LINK) $(OBJS_060) $(LIBFLAGS) $@
16 |
17 | iGame.MOS: $(OBJS_MOS)
18 | $(LINK_PPC) $(OBJS_MOS) $(LIBFLAGS_MOS) $@
19 |
20 | iGame.OS4: $(OBJS_OS4)
21 | $(LINK_PPC) $(OBJS_OS4) $(LIBFLAGS_OS4) $@
22 |
--------------------------------------------------------------------------------
/obsolete/helper_tools/install_ram:
--------------------------------------------------------------------------------
1 | failat 21
2 | ;echo "-> Deleting RAM:iGame..."
3 | ;delete RAM:iGame ALL
4 | echo "-> Creating new dir RAM:iGame..."
5 | makedir RAM:iGame
6 | ;echo "-> Compiling iGame to RAM:"...
7 | failat 10
8 | ;vc -dontwarn=-1 -O2 -o RAM:iGame/iGame -IStuff:Development/MUI/Developer/C/Include -IStuff:Development/MCC_Guigfx/Developer/C/Include -IStuff:Development/MCC_Texteditor/Developer/C/Include -c99 -lamiga -lauto src/funcs.c src/iGameGUI.c src/iGameMain.c src/Hook_utility.o src/strdup.c
9 | ;make
10 | echo "-> Copying required files to RAM:iGame..."
11 | copy required_files/genres to RAM:iGame/
12 | copy required_files/igame.iff to RAM:iGame/
13 | copy required_files/iGame.info to RAM:iGame/
14 | copy iGame to RAM:iGame/
15 | echo "** DONE **"
--------------------------------------------------------------------------------
/obsolete/helper_tools/lowlevel.bat:
--------------------------------------------------------------------------------
1 | vc +aos68k -lamiga -lauto lowlevel.c -o lowlevel.exe
--------------------------------------------------------------------------------
/obsolete/helper_tools/lowlevel.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | //#include
5 |
6 | #include
7 | #include
8 |
9 | struct Library *LowLevelBase;
10 |
11 | static void printbuttons(ULONG val)
12 | {
13 | if (val & JPF_BUTTON_PLAY) printf("[PLAY/MMB]");
14 | if (val & JPF_BUTTON_REVERSE) printf("[REVERSE]");
15 | if (val & JPF_BUTTON_FORWARD) printf("[FORWARD]");
16 | if (val & JPF_BUTTON_GREEN) printf("[SHUFFLE]");
17 | if (val & JPF_BUTTON_RED) printf("[SELECT/LMB/FIRE]");
18 | if (val & JPF_BUTTON_BLUE) printf("[STOP/RMB]");
19 | }
20 |
21 | static void printmousedirections(ULONG val)
22 | {
23 | printf("[%lu,%lu]", val & JP_MHORZ_MASK, (val & JP_MVERT_MASK) >> 8);
24 | }
25 |
26 | //static void printajoydirections(ULONG val)
27 | //{
28 | // printf("[%d, %d]", (val & JP_XAXIS_MASK), (val & JP_YAXIS_MASK) >> 8);
29 | //}
30 | static void printjoydirections(ULONG val)
31 | {
32 | if (val & JPF_JOY_UP) printf("[UP]");
33 | if (val & JPF_JOY_DOWN) printf("[DOWN]");
34 | if (val & JPF_JOY_LEFT) printf("[LEFT]");
35 | if (val & JPF_JOY_RIGHT) printf("[RIGHT]");
36 | }
37 |
38 | static void printjoyport(ULONG val)
39 | {
40 | for(int i = 31; i >= 0; i--)
41 | {
42 | printf("%d", val & 1 << i ? 1 : 0);
43 | }
44 |
45 | printf(" - ");
46 |
47 | if ((val & JP_TYPE_MASK) == JP_TYPE_NOTAVAIL) printf("NOT AVAILABLE");
48 | if ((val & JP_TYPE_MASK) == JP_TYPE_UNKNOWN) printf("UNKNOWN");
49 |
50 | if ((val & JP_TYPE_MASK) == JP_TYPE_JOYSTK)
51 | {
52 | printf("JOYSTICK - ");
53 | printjoydirections(val);
54 | printbuttons(val);
55 | }
56 |
57 | if ((val & JP_TYPE_MASK) == JP_TYPE_GAMECTLR)
58 | {
59 | printf("GAME CONTROLLER - ");
60 | printjoydirections(val);
61 | printbuttons(val);
62 | }
63 |
64 | if ((val & JP_TYPE_MASK) == JP_TYPE_MOUSE)
65 | {
66 | printf("MOUSE - ");
67 | printmousedirections(val);
68 | printbuttons(val);
69 | }
70 |
71 | //if ((val & JP_TYPE_MASK) == JP_TYPE_ANALOGUE)
72 | //{
73 | // printf("JOYSTICK[ANALOGUE] - ");
74 | // printajoydirections(val);
75 | // printbuttons(val);
76 | //}
77 |
78 | printf("\n");
79 | }
80 |
81 | int main(int argc, char **argv)
82 | {
83 | int unit = 1;
84 |
85 | if (argc == 2) unit = atoi(argv[1]);
86 |
87 | LowLevelBase = OpenLibrary("lowlevel.library", 0);
88 |
89 | if (LowLevelBase)
90 | {
91 | ULONG old = 0;
92 |
93 | while(!CheckSignal(SIGBREAKF_CTRL_C))
94 | {
95 | ULONG new = ReadJoyPort(unit);
96 | if (new != old)
97 | {
98 | old = new;
99 | printjoyport(new);
100 | }
101 |
102 | Delay(1);
103 | }
104 | CloseLibrary(LowLevelBase);
105 | }
106 |
107 | return 0;
108 | }
--------------------------------------------------------------------------------
/obsolete/helper_tools/pack_release:
--------------------------------------------------------------------------------
1 | failat 21
2 | echo "-> Deleting RAM:iGame.lha..."
3 | delete RAM:iGame.lha
4 | echo "-> Deleting RAM:iGame..."
5 | delete RAM:iGame ALL
6 | echo "-> Creating new dir RAM:iGame..."
7 | makedir RAM:iGame
8 | echo "-> Compiling iGame to RAM:"...
9 | failat 10
10 | vc -dontwarn=-1 -O2 -o RAM:iGame/iGame -IWork:Coding/MUI/Developer/C/Include -IWork:Coding/MCC_Guigfx/Developer/C/Include -IWork:Coding/MCC_Texteditor/Developer/C/Include -c99 -lamiga -lauto src/funcs.c src/iGameGUI.c src/iGameMain.c src/Hook_utility.o src/strdup.c
11 | echo "-> Copying required files to RAM:iGame..."
12 | copy required_files/genres to RAM:iGame/
13 | copy required_files/igame.iff to RAM:iGame/
14 | copy required_files/iGame.info to RAM:iGame/
15 | copy required_files/iGame_drawer.info to RAM:iGame.info
16 | copy guide/iGame.guide to RAM:iGame/
17 | copy guide/iGame.guide.info to RAM:iGame/
18 | makedir RAM:iGame/Icons
19 | copy alt_icons/iGame1.info to RAM:iGame/Icons
20 | copy alt_icons/iGame2.info to RAM:iGame/Icons
21 | copy alt_icons/iGame3.info to RAM:iGame/Icons
22 | copy alt_icons/iGame4.info to RAM:iGame/Icons
23 | lha -aezrx a RAM:iGame.lha RAM:iGame
24 | lha -aezrx a RAM:iGame.lha RAM:iGame.info
25 | echo "** DONE RELEASE **"
--------------------------------------------------------------------------------
/obsolete/helper_tools/slave_title2.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main(int argc, char* argv[])
5 | {
6 | char Title[100];
7 |
8 | struct SlaveInfo
9 | {
10 | unsigned long Security;
11 | char ID[8];
12 | unsigned short Version;
13 | unsigned short Flags;
14 | unsigned long BaseMemSize;
15 | unsigned long ExecInstall;
16 | unsigned short GameLoader;
17 | unsigned short CurrentDir;
18 | unsigned short DontCache;
19 | char keydebug;
20 | char keyexit;
21 | unsigned long ExpMem;
22 | unsigned short name;
23 | unsigned short copy;
24 | unsigned short info;
25 | };
26 |
27 | struct SlaveInfo sl;
28 |
29 | if (argc == 1)
30 | {
31 | printf("Usage: %s filename.slave\n", argv[0]);
32 | exit(0);
33 | }
34 |
35 | FILE* fp = fopen(argv[1], "rbe");
36 | if (fp == NULL)
37 | {
38 | printf("Could not open %s\n", argv[1]);
39 | exit(0);
40 | }
41 |
42 | //seek to +0x20
43 | fseek(fp, 32, SEEK_SET);
44 |
45 | fread(&sl, 1, sizeof(sl), fp);
46 |
47 |
48 | sl.Version = (sl.Version >> 8) | (sl.Version << 8);
49 | sl.name = (sl.name >> 8) | (sl.name << 8);
50 |
51 | printf("[%s] [%d]\n", sl.ID, sl.Version);
52 |
53 | //sl.name holds the offset for the slave name
54 | fseek(fp, sl.name + 32, SEEK_SET);
55 | //title = calloc (1, 100);
56 | //fread (title, 1, 100, fp);
57 |
58 | for (int i = 0; i <= 99; i++)
59 | {
60 | Title[i] = fgetc(fp);
61 | if (Title[i] == '\n')
62 | {
63 | Title[i] = '\0';
64 | break;
65 | }
66 | }
67 |
68 | printf("[%s]\n", Title);
69 |
70 | //fclose(fp);
71 | }
72 |
--------------------------------------------------------------------------------
/obsolete/helper_tools/update_titles.c:
--------------------------------------------------------------------------------
1 | /*
2 | * update_titles.c
3 | * scans a gamelist file and updates the titles from the slave info
4 | */
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | extern char* strdup(const char* s);
11 | extern char* strcasestr(const char *haystack, const char *needle);
12 |
13 | typedef struct games
14 | {
15 | char title[200];
16 | char genre[100];
17 | int index;
18 | char path[256];
19 | int favorite;
20 | int times_played;
21 | int last_played; //indicates whether this one was the last game played
22 | int exists; //indicates whether this game still exists after a scan
23 | int hidden; //game is hidden from normal operation
24 | struct games* next;
25 | } games_list;
26 |
27 | games_list *item_games = NULL, *games = NULL;
28 |
29 | /*
30 | * Gets title from a slave file
31 | * returns 0 on success, 1 on fail
32 | */
33 | int get_title_from_slave(char* slave, char* title)
34 | {
35 | char Title[100];
36 |
37 | struct SlaveInfo
38 | {
39 | unsigned long Security;
40 | char ID[8];
41 | unsigned short Version;
42 | unsigned short Flags;
43 | unsigned long BaseMemSize;
44 | unsigned long ExecInstall;
45 | unsigned short GameLoader;
46 | unsigned short CurrentDir;
47 | unsigned short DontCache;
48 | char keydebug;
49 | char keyexit;
50 | unsigned long ExpMem;
51 | unsigned short name;
52 | unsigned short copy;
53 | unsigned short info;
54 | };
55 |
56 | struct SlaveInfo sl;
57 |
58 | FILE* fp = fopen(slave, "rbe");
59 | if (fp == NULL)
60 | {
61 | return 1;
62 | }
63 |
64 | //seek to +0x20
65 | fseek(fp, 32, SEEK_SET);
66 |
67 | fread(&sl, 1, sizeof(sl), fp);
68 |
69 |
70 | //sl.Version = (sl.Version>>8) | (sl.Version<<8);
71 | //sl.name = (sl.name>>8) | (sl.name<<8);
72 |
73 | //printf ("[%s] [%d]\n", sl.ID, sl.Version);
74 |
75 | //sl.name holds the offset for the slave name
76 | fseek(fp, sl.name + 32, SEEK_SET);
77 | //title = calloc (1, 100);
78 | //fread (title, 1, 100, fp);
79 |
80 | if (sl.Version < 10)
81 | {
82 | return 1;
83 | }
84 |
85 | for (int i = 0; i <= 99; i++)
86 | {
87 | Title[i] = fgetc(fp);
88 | if (Title[i] == '\n')
89 | {
90 | Title[i] = '\0';
91 | break;
92 | }
93 | }
94 |
95 | strcpy(title, Title);
96 |
97 | //printf("[%s]\n", Title);
98 |
99 | fclose(fp);
100 |
101 | return 0;
102 | }
103 |
104 | /*
105 | * Checks if the title already exists
106 | * returns 1 if yes, 0 otherwise
107 | */
108 | int check_dup_title(char* title)
109 | {
110 | for (games_list* check_games = games; check_games != NULL; check_games = check_games->next)
111 | {
112 | if (!strcmp(check_games->title, title))
113 | {
114 | // printf("[%s] [%s]\n", check_games->Title, title);
115 | return 1;
116 | }
117 | }
118 |
119 | return 0;
120 | }
121 |
122 | /*
123 | * Splits a string using spl
124 | */
125 | char** my_split(char* str, char* spl)
126 | {
127 | char **ret, *buffer[256], buf[4096];
128 | int i;
129 |
130 | if (!spl)
131 | {
132 | ret = (char **)malloc(2 * sizeof(char *));
133 | ret[0] = (char *)strdup(str);
134 | ret[1] = NULL;
135 | return (ret);
136 | }
137 |
138 | int count = 0;
139 |
140 | char* fptr = str;
141 | const int spl_len = strlen(spl);
142 | char* sptr = strstr(fptr, spl);
143 | while (sptr)
144 | {
145 | i = sptr - fptr;
146 | memcpy(buf, fptr, i);
147 | buf[i] = '\0';
148 | buffer[count++] = (char *)strdup(buf);
149 | fptr = sptr + spl_len;
150 | sptr = strstr(fptr, spl);
151 | }
152 | sptr = strchr(fptr, '\0');
153 | i = sptr - fptr;
154 | memcpy(buf, fptr, i);
155 | buf[i] = '\0';
156 | buffer[count++] = (char *)strdup(buf);
157 |
158 | ret = (char **)malloc((count + 1) * sizeof(char *));
159 |
160 | for (i = 0; i < count; i++)
161 | {
162 | ret[i] = buffer[i];
163 | }
164 | ret[count] = NULL;
165 |
166 | return (ret);
167 | }
168 |
169 | /*
170 | * Saves the current Games struct to disk
171 | */
172 | void save_list(int CheckExists)
173 | {
174 | FILE* fpgames = fopen("PROGDIR:gameslist", "we");
175 |
176 | if (!fpgames)
177 | {
178 | printf("Could not open gameslist file!");
179 | }
180 | else
181 | {
182 | for (item_games = games; item_games != NULL; item_games = item_games->next)
183 | {
184 | //printf("Saving: %s\n", item_games->Title);
185 | if (CheckExists == 1)
186 | {
187 | if (item_games->exists == 1)
188 | {
189 | fprintf(fpgames, "index=%d\n", item_games->index);
190 | fprintf(fpgames, "title=%s\n", item_games->title);
191 | fprintf(fpgames, "genre=%s\n", item_games->genre);
192 | fprintf(fpgames, "path=%s\n", item_games->path);
193 | fprintf(fpgames, "favorite=%d\n", item_games->favorite);
194 | fprintf(fpgames, "timesplayed=%d\n", item_games->times_played);
195 | fprintf(fpgames, "lastplayed=%d\n", item_games->last_played);
196 | fprintf(fpgames, "hidden=%d\n\n", item_games->hidden);
197 |
198 | fflush(fpgames);
199 | }
200 | else
201 | {
202 | strcpy(item_games->path, "");
203 | }
204 | }
205 | else
206 | {
207 | fprintf(fpgames, "index=%d\n", item_games->index);
208 | fprintf(fpgames, "title=%s\n", item_games->title);
209 | fprintf(fpgames, "genre=%s\n", item_games->genre);
210 | fprintf(fpgames, "path=%s\n", item_games->path);
211 | fprintf(fpgames, "favorite=%d\n", item_games->favorite);
212 | fprintf(fpgames, "timesplayed=%d\n", item_games->times_played);
213 | fprintf(fpgames, "lastplayed=%d\n", item_games->last_played);
214 | fprintf(fpgames, "hidden=%d\n\n", item_games->hidden);
215 |
216 | fflush(fpgames);
217 | }
218 | }
219 |
220 | fclose(fpgames);
221 | }
222 | }
223 |
224 | int main()
225 | {
226 | char FileLine[1000];
227 | char helperstr[250];
228 |
229 | printf("This program will update your gameslist with game titles from the slave files\n");
230 | printf("Do you wish to continue? (Y/N): ");
231 |
232 | const char resp = fgetc(stdin);
233 |
234 | if (resp != 'Y' && resp != 'y')
235 | {
236 | printf("Exiting...\n");
237 | exit(0);
238 | }
239 |
240 | FILE* fpgames = fopen("PROGDIR:gameslist", "re");
241 | if (!fpgames)
242 | {
243 | printf(
244 | "Could not open gameslist.Please make sure you run this command within the same dir as the gamelist file.\n");
245 | }
246 | else
247 | {
248 | do
249 | {
250 | if (fgets(FileLine, sizeof(FileLine), fpgames) == NULL) { break; }
251 | FileLine[strlen(FileLine) - 1] = '\0';
252 | //printf("%s\n", FileLine);
253 |
254 | if (strlen(FileLine) == 0) continue;
255 |
256 | char** temp_tbl = my_split((char *)FileLine, "=");
257 | if (temp_tbl == NULL || temp_tbl[0] == NULL || !strcmp(temp_tbl, " ") || !strcmp(temp_tbl, ""))
258 | {
259 | continue;
260 | }
261 |
262 | item_games = (games_list *)calloc(1, sizeof(games_list));
263 | item_games->next = NULL;
264 |
265 | if (!strcmp(temp_tbl[0], "index"))
266 | {
267 | item_games->index = atoi(temp_tbl[1]);
268 | item_games->exists = 0;
269 | do
270 | {
271 | if (fgets(FileLine, sizeof(FileLine), fpgames) == NULL) { break; }
272 |
273 | FileLine[strlen(FileLine) - 1] = '\0';
274 |
275 | /* split */
276 | temp_tbl = my_split((char *)(FileLine), "=");
277 | if (temp_tbl == NULL || temp_tbl[0] == NULL || !strcmp(temp_tbl[0], " ") || !strcmp(temp_tbl[0], "")
278 | )
279 | {
280 | break;
281 | }
282 |
283 | //this is to make sure that gameslist goes ok from 1.2 to 1.3
284 | item_games->hidden = 0;
285 |
286 | if (!strcmp(temp_tbl[0], "title"))
287 | strcpy(item_games->title, temp_tbl[1]);
288 | else if (!strcmp(temp_tbl[0], "genre"))
289 | strcpy(item_games->genre, temp_tbl[1]);
290 | else if (!strcmp(temp_tbl[0], "path"))
291 | strcpy(item_games->path, temp_tbl[1]);
292 | else if (!strcmp(temp_tbl[0], "favorite"))
293 | item_games->favorite = atoi(temp_tbl[1]);
294 | else if (!strcmp(temp_tbl[0], "timesplayed"))
295 | item_games->times_played = atoi(temp_tbl[1]);
296 | else if (!strcmp(temp_tbl[0], "lastplayed"))
297 | item_games->last_played = atoi(temp_tbl[1]);
298 | else if (!strcmp(temp_tbl[0], "hidden"))
299 | item_games->hidden = atoi(temp_tbl[1]);
300 |
301 | // break;
302 |
303 | //}
304 |
305 |
306 | /* free some mem */
307 | free(temp_tbl[1]);
308 | free(temp_tbl[0]);
309 | free(temp_tbl);
310 | temp_tbl = NULL;
311 | }
312 | while (1);
313 |
314 | if (games == NULL)
315 | {
316 | games = item_games;
317 | }
318 | else
319 | {
320 | item_games->next = games;
321 | games = item_games;
322 | }
323 | }
324 |
325 | free(temp_tbl[1]);
326 | free(temp_tbl[0]);
327 | free(temp_tbl);
328 |
329 | // fgets (FileLine, sizeof(FileLine), fpgames);
330 | // strcpy(item_games->Title, temp_tbl[1]
331 |
332 | // str = malloc(strlen((char *)temp_tbl[1]+1));
333 | // printf("here\n");
334 | // if (str) strcpy(str,(char *)temp_tbl[1]);
335 | // printf("here2\n");
336 | // DoMethod(App->LV_GamesList, MUIM_List_Insert, &str, 1, MUIV_List_Insert_Bottom);
337 | // printf("here3\n");
338 | //if (str) free(str);
339 | //}
340 |
341 | //free(temp_tbl[1]);free(temp_tbl[0]);free(temp_tbl);
342 | }
343 | while (1);
344 | }
345 | fclose(fpgames);
346 |
347 | printf("Gameslist loaded, please wait...");
348 |
349 | for (item_games = games; item_games != NULL; item_games = item_games->next)
350 | {
351 | //only if it is a slave file ;-)
352 | if (strcasestr(item_games->path, ".slave"))
353 | {
354 | if (!get_title_from_slave(item_games->path, helperstr))
355 | {
356 | printf("Changing [%s] to [%s]\n", item_games->title, helperstr);
357 | item_games->title[0] = '\0';
358 | while (check_dup_title(helperstr))
359 | {
360 | strcat(helperstr, " Alt");
361 | }
362 | strcpy(item_games->title, helperstr);
363 | }
364 | }
365 | }
366 |
367 | save_list(0);
368 |
369 | printf("All done.!\n");
370 | }
371 |
--------------------------------------------------------------------------------
/os4depot.readme:
--------------------------------------------------------------------------------
1 | name: iGame
2 | description: Front-end for WHDLoad
3 | version: VERSION_TAG
4 | author: Emmanuel Vasilakis and contributors
5 | submitter: George Sokianos
6 | email: walkero@gmail.com
7 | url: https://github.com/MrZammler/iGame
8 | category: utility/misc
9 | replaces: utility/misc/iGame.lha
10 | requirements: MUI, render.library
11 | license: GPL
12 | minosversion: 4.0
13 | distribute: yes
14 | passphrase: OS4DEPOT_PASSPHRASE
15 | hend:
16 | iGame is a front-end application for your WHDLoad games and demos collection.
17 | It runs on AmigaOS 2.04 and above, AmigaOS 4 and MorphOS.
18 |
19 | Features
20 |
21 | * Multiple WHDLoad slaves repositories on hard disk partitions
22 | * On-demand scanning in repositories for installed WHDLoad slaves (games,
23 | demos etc.)
24 | * Use games' tooltypes on the run
25 | * Shows game screenshot (screenshot window can be altered through
26 | tooltypes/settings uses datatypes to load foreign formats)
27 | * Categorization of the games and filtering
28 | * Manual addition of non-WHDLoad games, demos etc.
29 | * Simple statistics
30 | * Find-as-you-type search filter
31 |
32 | iGame can "discover" your games on pre-defined repositories and create a small
33 | database. You can then categorize each game according to its genre, provide a
34 | small screenshot image to be displayed when the game is selected and quickly
35 | find the one you're looking for, using the filtering gadget.
36 |
37 | But iGame can support more than just WHDLoad games or demos. You can add and
38 | launch any type of executable, though it mostly makes sense if it's a game ;-)
39 |
40 | iGame can be found on many AmigaOS distributions like AmiKit XE and ApolloOS.
41 |
42 | iGame was initially developed on an Amiga 3000 with a CSMKII 68060 with
43 | 128MB RAM, using the Cubic IDE (gcc). Nowadays, we use mostly vbcc as a
44 | cross-compiler on a Linux system.
45 |
46 | iGame is open source and free software, licensed under the GPLv3, and you can
47 | find it at the following websites.
48 |
49 | https://github.com/MrZammler/iGame
50 | http://winterland.no-ip.org/igame/index.html
51 |
52 | Requirements:
53 | * Kickstart 2.04 or higher
54 | * Workbench 2.1 or higher
55 | * MUI 3.8 or higher
56 | * icon.library v37+ (v44+ Recommended)
57 | * guigfx.library
58 | * render.library
59 | * guigfx.mcc
60 | * Texteditor.mcc
61 | * NListviews.mcc
62 |
63 | The project is open source and you can find the code at:
64 | https://github.com/MrZammler/iGame
65 |
66 | If you have any requests or you would like to report any problems you found,
67 | you can do that at:
68 | https://github.com/MrZammler/iGame/issues
69 |
70 |
71 | Changelog
72 | -------------
73 | Please read the enclosed CHANGELOG.md file for all the changes, or find
74 | them online at:
75 | https://raw.githubusercontent.com/MrZammler/iGame/master/CHANGELOG.md
76 |
--------------------------------------------------------------------------------
/required_files/Install-iGame:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/Install-iGame
--------------------------------------------------------------------------------
/required_files/Install-iGame.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/Install-iGame.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame-png-120.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame-png-120.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame-png-48.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame-png-48.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame-png-64.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame-png-64.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame1.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame1.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame2.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame2.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame3.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame3.info
--------------------------------------------------------------------------------
/required_files/extras/icons/iGame4.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/icons/iGame4.info
--------------------------------------------------------------------------------
/required_files/extras/igame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/extras/igame.png
--------------------------------------------------------------------------------
/required_files/genres:
--------------------------------------------------------------------------------
1 | Action
2 | Adult
3 | Adventure
4 | Bat and ball
5 | Beat 'em up
6 | Board
7 | Cards
8 | Demo
9 | Gambling
10 | Maze
11 | Misc
12 | Pinball
13 | Platform
14 | Puzzle
15 | Quiz
16 | Racing
17 | RPG
18 | Shoot 'em up
19 | Simulation
20 | Sports
21 | Strategy
22 |
--------------------------------------------------------------------------------
/required_files/iGame.guide:
--------------------------------------------------------------------------------
1 | @DATABASE iGame.guide
2 | @$VER: iGame.guide VERSION_TAG (RELEASE_DATE)
3 | @INDEX "Index"
4 | @wordwrap
5 |
6 | @NODE "Main" "iGame documentation"
7 | @{jcenter}
8 | iGame
9 | =============================================
10 | (c) 2005-2023 Emmanuel Vasilakis
11 | @{jleft}
12 | @{lindent 3}
13 | @{" Introduction " LINK "INTR" 0} - About iGame
14 | @{" History " LINK "HIST" 0} - History of iGame
15 | @{" Building iGame " LINK "BUIL" 0} - Building iGame
16 | @{" Requirements " LINK "REQS" 0} - System requirements
17 |
18 | @{" Installation " LINK "INST" 0} - How to install iGame
19 | @{" Usage " LINK "USAG" 0} - Using iGame
20 | @{" igame.data file " LINK "IGDF" 0} - About igame.data files
21 |
22 | @{" Todo & Bugs " LINK "TODO" 0} - Todo and known bugs
23 | @{" Author " LINK "INFO" 0} - Author contact info
24 | @{" Changelog " LINK "CHNG" 0} - Version changelog
25 |
26 | @ENDNODE
27 | @NODE "INTR" "Introduction"
28 | @{lindent 3}
29 | iGame is a front-end application for your WHDLoad games and demos collection. It runs on AmigaOS 2.04 and above, AmigaOS 4 and MorphOS.
30 |
31 | @{b}Features@{ub}
32 |
33 | - Multiple WHDLoad slaves repositories on hard disk partitions
34 | - On-demand scanning in repositories for installed WHDLoad slaves (games, demos etc.)
35 | - Use games' tooltypes on a run
36 | - Shows game screenshot (screenshot window can be altered through settings, uses datatypes to load foreign formats)
37 | - Categorization of the games and filtering
38 | - Manual addition of non-WHDLoad games, demos etc.
39 | - Simple statistics
40 | - Find-as-you-type search filter
41 | - Usage of the descriptive @{" igame.data files " LINK "IGDF" 0} to set automatically the required information for the entries
42 |
43 | iGame can "discover" your games on pre-defined repositories and create a small database. You can then categorize each game according to its genre, provide a small screenshot image to be displayed when the game is selected and quickly find the one you're looking for, using the filtering gadget.
44 |
45 | But iGame can support more than just WHDLoad games or demos. You can add and launch any type of executable, though it mostly makes sense if it's a game ;-)
46 |
47 | iGame can be found on many AmigaOS distributions like AmiKit XE and ApolloOS.
48 |
49 | iGame was initially developed on an Amiga 3000 with a CSMKII 68060 with 128MB RAM, using the Cubic IDE (gcc). Nowadays, we use mostly vbcc as a cross-compiler on a Linux system.
50 |
51 | iGame is open source and free software, licensed under the GPLv3, and you can find it at the following websites.
52 |
53 | https://github.com/MrZammler/iGame
54 | http://winterland.no-ip.org/igame/index.html
55 |
56 | @ENDNODE
57 | @NODE "HIST" "History"
58 | @{lindent 3}
59 | A bit of history
60 |
61 | iGame started in ~2004/5 as a way to learn a bit of MUI and general Amiga system coding. Through the years it's been updated with various new small features and bug fixes. After version 1.5, iGame was updated with internal version 1.6 which was never really officially released. Sorry; I wasn't very good at releasing versions or keeping a changelog.
62 |
63 | Back in 2016 iGame became open source under the GPLv3 license. Since then, with the kind help of contributors, we did a lot of re-writing and added new features. These versions are now tagged as 2.0.
64 |
65 | Contributors:
66 | - Chris Charabaruk (coldacid)
67 | - Dimitris Panokostas (midwan)
68 | - George Sokianos (walkero)
69 | - Javier R. Santurde (T0lk13n)
70 | - Willem Drijver
71 |
72 | @ENDNODE
73 | @NODE "BUIL" "Building iGame"
74 | @{lindent 3}
75 | iGame is open source and free software, licensed under the GPLv3. This means you can have access to the source and compile it yourself. How to do it is described at the following URL, where various Operating Systems are covered.
76 |
77 | https://github.com/MrZammler/iGame/wiki/2.-Compiling
78 |
79 | If you would like to contribute to iGame, please have a look at the following web page:
80 |
81 | https://github.com/MrZammler/iGame/wiki/Contribute
82 |
83 | @ENDNODE
84 | @NODE "REQS" "Requirements"
85 | @{lindent 3}
86 | @{b}Hardware requirements@{ub}
87 |
88 | @{u}Minimum requirements@{uu}
89 |
90 | - Amiga Computer (obviously)
91 | - 68000 processor
92 | - 2MB Fast Ram
93 |
94 | @{u}Recommended requirements@{uu}
95 |
96 | - Amiga Computer (obviously)
97 | - 68030 processor
98 | - 8MB Fast Ram
99 |
100 | Depending on the number of WHDLoad slaves (games, demos etc.) more available memory might be required.
101 |
102 | On a 68030 processor, it takes a while to scan and list the games. It takes about 2 minutes for a complete scan of 2000 games (~3G data) on an SFS formatted partition.
103 |
104 | On a 68060 processor with ~200 games, scanning takes ~30 secs and listing/sorting less than 1 sec.
105 |
106 | The above times are measured when the scan checks the slave files to get the game/demo name. iGame scan is faster if you change that behaviour to get the names from the parent folder name. This can be set on @{"Settings Window" LINK "WINSETS" 0}.
107 |
108 | @{b}Software requirements@{ub}
109 |
110 | iGame uses Magic User Interface (MUI) and some third-party libraries. Depending on your configuration the software requirements might change. In any case, iGame will inform you about the missing required libraries if you run it from the shell.
111 |
112 | All the required software is available on Aminet for free download.
113 |
114 | @{u}Minimum requirements@{uu}
115 |
116 | - Kickstart 2.04 or higher
117 | - Workbench 2.1 or higher
118 | - MUI 3.8 or higher
119 | - icon.library v37+ (v44+ Recommended)
120 | - guigfx.library
121 | - render.library
122 | - guigfx.mcc
123 | - Texteditor.mcc
124 | - NListviews.mcc
125 |
126 | If your Amiga has a 68000 CPU make sure that the libraries you have installed support it, i.e. there is a different MCC_TextEditor package for this processor. The same applies to CPUs that do not have FPU.
127 |
128 | The @{b}AmigaOS 4 version@{ub} should work fine on any AmigaOS 4.0 update 6 release and above. It might work on previous versions, but it is not tested.
129 |
130 | The @{b}MorphOS version@{ub} should work fine on any MorphOS 3.x release.
131 | @ENDNODE
132 |
133 | @NODE "INST" "Installation"
134 | @{lindent 3}
135 | @{b}Installer@{ub}
136 | In the iGame archive, you will find an installation script, which you can use to install iGame on your hard disk. The installer recognizes the OS version and the available CPU and proposes the best binary for you, but in the end, you can choose the version you want to use.
137 |
138 | Have in mind that the installer will not install any of the needed third-party libraries. These must be installed manually by you.
139 |
140 | @{b}Manual Installation@{ub}
141 |
142 | You can install iGame manually if you prefer. To do that, you need to follow the following steps:
143 |
144 | @{lindent 6}
145 | 1. Unpack the archive wherever you want.
146 | 2. Copy the iGame drawer anywhere on your hard disk.
147 | 3. There are different executables of iGame based on CPU and Operating System. You need to find the one that is most suitable for your system and rename it as iGame.
148 | @{tab}These are:
149 | @{tab}iGame for 68000/68010/68020 CPUs
150 | @{tab}iGame.030 for 68030 CPU
151 | @{tab}iGame.040 for 68040 CPU
152 | @{tab}iGame.060 for 68060 CPU
153 | @{tab}iGame.OS4 for AmigaOS 4 and PPC CPU
154 | @{tab}iGame.MOS for MorphOS and PPC CPU
155 | 4. Make sure igame.iff file is in the same directory as the binary.
156 | 5. Install required libs and MCCs suitable for your system.
157 | 6. Run iGame!
158 |
159 | @{lindent 3}
160 | iGame saves its support files in its folder (PROGDIR:). We recommend you install it in its separate directory on your hard disk.
161 |
162 | If you upgrade from a previous release, the only thing you need to do is to copy the new executable over the previous one. Make sure to keep the igame.prefs, gameslist.csv, genres and repos.prefs files!
163 |
164 | @{b}NOTE:@{ub}
165 |
166 | Make sure that render.library and guigfx.library are supported by your system and processor if you choose to use them. If iGame fails with a Guru Meditation 8000000B or similar on startup, double-check the libraries.
167 |
168 | If it persists, check http://winterland.no-ip.org/igame/files.html, where you will find an archive of these 2 libraries for systems with 020/no fpu (thanks to Jools 'buzz' Smyth for providing them!). These libraries might fix issues on 68030/882 systems as well.
169 |
170 | If the problem is not gone, select the "No GuiGfx" checkbox in the settings. This option will use MUI's internal datatypes loading routines (dtpic.mui) instead of guigfx.mcc's. If yu can't access the settings, then delete the igame.prefs file, which will make iGame return to its default values.
171 |
172 | If the GuiGfx library is not used there will be no scaling of the used screenshots. This means that all the screenshots should have the same height and width, so to keep the GUI consistent.
173 |
174 | @ENDNODE
175 | @NODE "USAG" "Using iGame"
176 | @{lindent 3}
177 | If you are new to iGame and you would like a "fast first steps" guide then we recommend you follow the next bullets:
178 |
179 | - Select from the menu "Settings > Game Repositories"
180 | - Add to the list the folders where you keep your WHDLoad games
181 | - Click the "Close" button
182 | - Select from the menu "Actions > Scan Repositories"
183 | - As soon as the list appears double click on the game you want to play for this to start.
184 |
185 | That's all. It is so simple, isn't it?
186 |
187 | If you would like more details about all the available menus and windows, visit the following sections:
188 |
189 | @{" Menus " LINK "MENUS" 0}
190 | @{" Main Window " LINK "WINMAIN" 0}
191 | @{" Add a Game Window " LINK "WINADDG" 0}
192 | @{" Settings Window " LINK "WINSETS" 0}
193 | @{" Game Repositories Window " LINK "WINREPO" 0}
194 | @{" Properties Window " LINK "WINPROP" 0}
195 |
196 | @ENDNODE
197 | @NODE "MENUS" "Menus"
198 | @{lindent 3}
199 | @{b}Actions@{ub}
200 | @{lindent 6}
201 | @{u}Scan Repositories@{uu}
202 | If you select "Scan Repositories", iGame will scan the paths you added at the @{" Game Repositories " LINK "WINREPO" 0} window and will try to find your available WHDLoad games and demos. This method supports ONLY WHDLoad games and demos. iGame checks the .slave files, and based on them creates a list of games and demos, which are later shown in the @{" Main Window " LINK "WINMAIN" 0}.
203 |
204 | @{u}Add Game...@{uu}
205 | This menu opens the @{" Add a Game " LINK "WINADDG" 0} window, which helps you add games/demos or any other executable you want into iGame list. You can also categorize them based on genre.
206 |
207 | @{u}Show/Hide hidden entries@{uu}
208 | This menu item hides all the entries from the list and shows only those that are marked as hidden. The filter field at the top and the genres list are disabled.
209 |
210 | @{u}About...@{uu}
211 | This menu item shows information about the application, the version and date of release and the target CPU. Also, you will find the contact information of the developer and contributors.
212 |
213 | @{u}Quit@{uu}
214 | This menu item closes iGame.
215 |
216 | @{lindent 3}
217 | @{b}Game@{ub}
218 | @{lindent 6}
219 | @{u}Properties...@{uu}
220 | This menu opens the @{" Properties " LINK "WINPROP" 0} window, where you can set more information for the selected entry, like the category, set it as favourite etc. If no entry is selected an error message is shown.
221 |
222 | @{u}Open Game Dir@{uu}
223 | When you select "Open Game Dir", iGame will open a window on Workbench from the selected entry. This is useful when you need to check a manual or a guide that comes along with the game or demo.
224 |
225 | @{lindent 3}
226 | @{b}Settings@{ub}
227 | @{lindent 6}
228 | @{u}Settings...@{uu}
229 | This menu opens the @{" Settings " LINK "WINSETS" 0} window, where you can configure how iGame will work for you, i.e. you can set the size of the screenshots etc..
230 |
231 | @{u}Game Repositories...@{uu}
232 | This menu opens the @{" Game Repositories " LINK "WINREPO" 0} window, where you can add/remove paths from your hard disk, where you keep your games and demos stored. These paths are useful for iGame only if they contain WHDLoad games/demos, and they are used to automatically recognize and build a list of them. If you do any changes in this list you have to rescan the Game Repositories using the menu item "Actions > Scan Repositories".
233 |
234 | @{u}MUI Setting...@{uu}
235 | This menu opens the MUI Settings window, where you can change the look of MUI components for iGame.
236 |
237 | @ENDNODE
238 | @NODE "WINMAIN" "Main Window"
239 | @{lindent 3}
240 | The Main Window is what you see when you start iGame. It is pretty simple to use and it has only a few fields.
241 |
242 | At the top, there is the "Filter" field which is used to filter the list of entries, based on your input. iGame returns entries with a matching part in their title. For example, if you want to find all the games that have "Soccer" in their title, that's what you need to write. The search is not case-sensitive, so it doesn't matter if the part of the title is capitalized or not. From the iGame settings, you can set it when the search is initialized, while you type (3 minimum characters) or after you press "Enter".
243 |
244 | On the left side, there are a filter select box and the entries list. The filter select box helps tp filter the entries by "Last played", "Favorites", "Most Played" and "Never Played".
245 |
246 | The entries list holds the entries (games, demos etc.) based on the filtering. With a double click on an entry, it is executed. If you want to add some information on an entry using the "Game > Properties..." menu, that's the list where you have to select it first. The list has 3 columns, where the first one has the title, the second one shows the year of release and the third column shows the maximum number of players that can play. iGame uses @{" igame.data files " LINK "IGDF" 0} to gather that information. By clicking on their title the sorting of the list can change.
247 |
248 | At the top right side, there is a screenshot of the selected entry. For the screenshot, iGame uses an image file, which must be in the same folder as the game/demo, named @{b}igame.iff@{ub}. If no screenshot is available then the entry icon is shown. You can disable the screenshots from the @{" Settings Window " LINK "WINSETS" 0}.
249 |
250 | Under the screenshot, there is the Chipset cycle box. Using that the user can filter the games based on the required chipset, for example show only the AGA games.
251 |
252 | Then the "Genres" list helps the user to filter the games based on the "Genre". There is also an "Unknown" selection which shows the entries that do not have any Genre assigned.
253 |
254 | At the bottom, there is a read-only field which shows information about iGame, based on what you are doing. It is like a status bar, where useful information will be shown while you use iGame.
255 |
256 | The Genre and Chipset lists get the information from the @{b}gameslist.csv@{ub} file. It can be automatically populated if the @{" igame.data files " LINK "IGDF" 0} are used and this is enabled in the settings window.
257 |
258 | @ENDNODE
259 | @NODE "WINADDG" "Add a Game Window..."
260 | @{lindent 3}
261 | This window opens from the menu "Actions > Add a Game". This is useful in cases you want to add a WDHLoad game/demo or any other game/demo which can be started from Workbench/Shell. Depending the AmigaOS version it uses compatible methods to run the executable.
262 |
263 | By this window you can set the "Title" of the game/demo, select the path on HD of the executable and set its "Genre".
264 |
265 | Click OK if you are fine with your selections so that this new entry will be saved on the list. Click on "Cancel" if you changed your mind.
266 |
267 | @ENDNODE
268 | @NODE "WINREPO" "Game Repositories Window..."
269 | @{lindent 3}
270 | This window opens from the menu item "Settings > Game Repositories". There you can add your hard disk paths where you keep your WHDLoad games stored. These paths are going to be scanned when you select the menu item "Actions > Scan Repositories".
271 |
272 | This window has a file field at the top. Click on the folder button to select the path from your hard disk, and then click the button list to add it to the list below. If you want to remove a path, select it from the list and click the "Remove" button at the bottom of the window.
273 |
274 | When you finish the changes on the repositories list, click the "Close" button to close it. Remember that no changes on your game list will happen if you do not scan the repositories first, using the menu item "Actions > Scan Repositories".
275 |
276 | @ENDNODE
277 | @NODE "WINPROP" "Properties Window..."
278 | @{lindent 3}
279 | This window opens from the menu item "Game > Properties". For this to work you have to have an entry selected at the games list on the main window, otherwise, an error message will show up. Through this window, you can change the properties of an entry.
280 |
281 | From the top, the first field is the entry title, which you can change if you want.
282 |
283 | Next, you can set the Genre from the select list. This can be used from the Genres list on the right side of the main window.
284 |
285 | Following is a checkbox to set the entry as one of your favourites. To show your favourite games in the games list, select from the "Genre" list at the right side of the main window, the "--Favorites--" option.
286 |
287 | Beside that is a checkbox to set the entry as hidden. This entry is going to be removed from the games list. To list all the hidden entries you have to select the menu item "Actions > Show/Hide hidden entries" from the main window.
288 |
289 | The next field is the number of times this game was played. This is a read-only field and you can't change the value.
290 |
291 | The full path of the slave file, in case this is a WHDLoad entry, or the full path of the executable of any entry as set from the "Actions > Add a Game", is shown in the next field. This is also a read-only field and you cannot modify it.
292 |
293 | After that, there is a big text area, showing the icon tooltypes. This is extremely useful in case you want to change something on the entry, especially if it is a WHDLoad one, where the tooltypes can change the way it works.
294 |
295 | @ENDNODE
296 | @NODE "WINSETS" "Settings Window"
297 | @{lindent 3}
298 | The iGame settings window opens from the menu item "Settings > Settings...". These are saved on a text file named "igame.prefs", inside iGame folder. If this file is missing, iGame uses the default values which is optimal to work on any system.
299 |
300 | If you have different instances of iGame and you would like to keep the same preferences for all of them, then move the "igame.prefs" into ENVARC:. Since version 2.2.0 iGame checks for the "igame.prefs" file first in ENVARC: folder. If it is found then this is used instead of the one in its folder.
301 |
302 | The settings window has three separate sections:
303 |
304 | @{u}Screenshots@{uu}
305 | The first checkbox here, named "Hide Screenshots", disables the screenshot part of the main window. iGame window will be refreshed to show/hide the screenshot as soon as you apply the changes.
306 |
307 | If screenshots are enabled you can select from the second checkbox if the GuiGfx library will be used. GuiGfx provides good scaling of the screenshot but it is a little bit tricky to set this up. You can find more info at @{" Installation " LINK "INST" 0} section. If this checkbox is selected that means that iGame will not use the GuiGfx library. If the library is not installed or the prerequisites are missing, then iGame will use datatypes to show the screenshot and this checkbox will be disabled.
308 |
309 | Under that, there is a select box to choose the screenshot size. You can choose between 160x128 pixels, 320x256 pixels and custom, which lets you set the width and height manually, using the fields below the select box.
310 |
311 | @{u}Titles@{uu}
312 | The first two radio buttons set the way iGame gets the WHDLoad games/demos titles. These can be based on reading the slave files or by the game/demo parent folder name. If you choose the "Slave Contents" option the name can be more accurate, but the scanning is slower. The "Directories" option is way faster, but if the slave inside a folder is not the one the directory is named, then there is a risk to have the wrong game in the list. Have in mind that if iGame finds multiple slaves for the same game, their titles will be suffixed with the 'Alt' word.
313 |
314 | The "No Smart Spaces" disables the ability of iGame to add extra spaces on the game/demo title, where it believes it is needed, i.e. before a version number.
315 |
316 | If "Prefer igame.data" is enabled then iGame prefers to get the entry title from the igame.data file if that exists. If it doesn't exist or it is disabled then the previous settings are going to be used for WHDLoad based items. This doesn't have any effect on non-WHDLoad items.
317 |
318 | @{u}Misc@{uu}
319 | The "Save stats on exit" checkbox enables the save of the statistics (i.e. times played) for each game when iGame is closed instead of every time a game is double-clicked. This might be preferred if you don't want to have iGame writing many times on the hard disk.
320 |
321 | The "Use enter to filter" checkbox changes the filter field on the main window to be initiated when you press the enter key. By default, as soon as you type something in this field, the filtering of the games list happens in real-time. On slow machines, this might be slow.
322 |
323 | The "Hide side panel" checkbox, if selected, hides the right side of the main window. This is useful if you don't need the screenshots and the filtering of the entries list by the options of the "Genres" list. This change requires to restart iGame to be applied.
324 |
325 | "Display favourites on start" checkbox, if selected, iGame starts showing the games that are marked as "Favorite". This is useful when you have a big collection of games but you would like to start with your favourites ones, to select something for fast gaming.
326 |
327 | The "Save" button saves the settings in the configuration file.
328 | The "Use" button applies the settings, except the ones that require restart iGame, as mentioned above, but if you close iGame, those changes are lost.
329 | The "Cancel" button closes the window and forgets the changes you did.
330 |
331 | @ENDNODE
332 | @NODE "TODO" "Todo & Bugs"
333 | @{lindent 3}
334 | Since iGame got open source we prefer to use GitHub to log all the issues and the features/changes we want to develop on the application. So, if you have a suggestion or an idea, or a problem with how iGame works, please open an issue at:
335 |
336 | https://github.com/MrZammler/iGame/issues
337 |
338 | There is also a couple of threads on EAB that we check frequently:
339 |
340 | http://eab.abime.net/showthread.php?t=28771
341 | http://eab.abime.net/showthread.php?t=94347
342 |
343 | @ENDNODE
344 | @NODE "INFO" "Author info"
345 | @{lindent 3}
346 | If you wish to contact the original creator of iGame, you can send an email at:
347 | Emmanuel Vasilakis (mrzammler\@mm.st)
348 |
349 | We would like to thank:
350 | - Animagic and Emmanouela Panterh for designing the icons and the pics that come with iGame.
351 | - Carlo Spadoni for designing 3 PNG icons found in the icons folder (iGame-png-xx.info).
352 |
353 | Contributors:
354 | Since iGame became open source a few people contributed with code. We would like to thank:
355 | - Chris Charabaruk (coldacid)
356 | - Dimitris Panokostas (midwan)
357 | - George Sokianos (walkero)
358 | - Javier R. Santurde (T0lk13n)
359 | - Willem Drijver
360 | An extensive and more up to date list can be found at:
361 | https://github.com/MrZammler/iGame/graphs/contributors
362 |
363 | Translators:
364 | iGame can be used in many different languages, which are included in every release:
365 | - French by AmiGuy
366 | - German by Martin Cornelius
367 | - Greek by George Sokianos
368 | - Italian by Samir Hawamdeh
369 | - Turkish by Serkan Dursun
370 |
371 | and of course, all of you who use iGame and support our beloved Amiga computer.
372 |
373 | @ENDNODE
374 |
375 | @NODE "IGDF" "igame.data files"
376 | @{lindent 3}
377 | @{b}Introducing igame.data files@{ub}
378 |
379 | iGame scans for and if found uses a custom file with the filename igame.data. These files let iGame know some crucial information for each entry (game/demo/application). Those files have a very specific structure and should be in the same folder of the WHDLoad items where the slave file exists, or in the same folder where an executable file exists.
380 |
381 | igame.data information is meant to cover (non)WHDLoad items and Demos, including as much information as possible. Not all the information is going to be loaded in the memory, just those that are necessary for some features in iGame. Other information will be used only when the user requests to view it.
382 |
383 | There is no plan for now to edit the igame.data through iGame itself. This decision might change in the future.
384 |
385 | @{b}What is the reason?@{ub}
386 |
387 | The benefits for the users of iGame will be the following, as long as these files exist and are populated:
388 |
389 | - The games/demos will get a title name that is going to be specific and not generated by iGame itself
390 | - The genre will be assigned automatically
391 | - Information like the year of release, the max number of players, the company that developed it and many more can be set for each entry and used inside iGame in various ways
392 | - Games/Demos that are not based on WHDLoad can also be scanned and automatically added to the list, ready to be launched
393 | - If igame.data files are included in community-maintained collections of games and demos the users will be benefited a lot, as they will have them categorised automatically and named correctly after a scan of the collection
394 | - Other game launchers will be able to use that information as well
395 |
396 | @{b}How is the structure of igame.data file?@{ub}
397 |
398 | igame.data file is a text file with the following information:
399 |
400 | title=Menace
401 | year=1988
402 | by=Psyclapse
403 | chipset=OCS
404 | genre=Shoot'em up
405 | players=1
406 | exe=
407 | arguments=
408 | lemon=735
409 | hol=2448
410 | pouet=
411 |
412 | - @{b}title@{ub}: This is going to be the title of the entry in iGame list. If two titles are the same then a number will be appended in square brackets, ie. Menace [1], the same happens in the latest versions of iGame. The user will be able to alter that title, but that is not going to be saved back to the igame.data file but in gameslist.csv file.
413 |
414 | - @{b}year@{ub}: The year of release. This is going to be used in the main list of iGame and the user will be able to sort the entries by that information.
415 |
416 | - @{b}by@{ub}: The responsible company/group/programmer for the development of the entry. This going to be used as an extra field in the entry information window
417 |
418 | - @{b}chipset@{ub}: This can take values about the supported chipset, ie. ECS, OCS, AGA, RTG etc. Multiple values can be separated with commas, ie. OCS,ECS. Those values are going to be used to filter the list the same way the genre is used in future versions of iGame.
419 |
420 | - @{b}genre@{ub}: This is the major genre of the game. This will not support multiple values but this decision might change in the future.
421 |
422 | - @{b}players@{ub}: This value refers to the maximum number of players. This is going to be used in the main list of iGame and the user will be able to sort the entries by that information.
423 |
424 | - @{b}exe@{ub}: This refers to the executable filename when the item is not a WHDLoad games/demo, i.e. quake.
425 |
426 | - @{b}arguments@{ub}: This refers to the needed arguments that an item requires so as to run properly.
427 |
428 | - @{b}lemon@{ub}: This is the id of the game entry at https://www.lemonamiga.com/. There is a plan to use that id in the information window as a link, so as the user to visit that page using a web browser
429 |
430 | - @{b}hol@{ub}: This is the id of the game entry at https://hol.abime.net/. There is a plan to use that id in the information window as a link, so as the user to visit that page using a web browser
431 |
432 | - @{b}pouet@{ub}: This is the id of the demo entry at https://www.pouet.net/. There is a plan to use that id in the information window as a link, so as the user to visit that page using a web browser
433 |
434 | @ENDNODE
435 |
436 | @NODE "CHNG" "Version changelog"
437 | @{lindent 3}
438 | Information about all the versions and the changes of iGame can be found in the CHANGELOG.md file.
439 |
440 | @ENDNODE
441 | @{BODY}
442 |
--------------------------------------------------------------------------------
/required_files/iGame.guide.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/iGame.guide.info
--------------------------------------------------------------------------------
/required_files/iGame.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/iGame.info
--------------------------------------------------------------------------------
/required_files/igame.iff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/igame.iff
--------------------------------------------------------------------------------
/required_files/igame_drawer.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/igame_drawer.info
--------------------------------------------------------------------------------
/required_files/igame_drawer_3.0.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/midwan/iGame/39ca5d289745c66158126e65c60e5be0d9ae02af/required_files/igame_drawer_3.0.info
--------------------------------------------------------------------------------
/src/chipsetList.c:
--------------------------------------------------------------------------------
1 | /*
2 | chipsetList.c
3 | chipset list functions source for iGame
4 |
5 | Copyright (c) 2018-2023, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include
28 |
29 | #include "iGameExtern.h"
30 | #include "chipsetList.h"
31 | #include "strfuncs.h"
32 |
33 | chipsetList *chipsetListHead = NULL;
34 |
35 | static int isListEmpty(const void *head)
36 | {
37 | return head == NULL;
38 | }
39 |
40 | void chipsetListAddTail(chipsetList *node)
41 | {
42 | if (node != NULL)
43 | {
44 | node->next = NULL;
45 |
46 | if (isListEmpty(chipsetListHead))
47 | {
48 | chipsetListHead = node;
49 | }
50 | else
51 | {
52 | // find the last node
53 | chipsetList *currPtr = chipsetListHead;
54 | while (currPtr->next != NULL)
55 | {
56 | currPtr = currPtr->next;
57 | }
58 |
59 | currPtr->next = node;
60 | }
61 | }
62 | }
63 |
64 | static BOOL chipsetListRemoveHead(void) {
65 |
66 | if (isListEmpty(chipsetListHead)) {
67 | return FALSE;
68 | }
69 |
70 | chipsetList *nextPtr = chipsetListHead->next;
71 | free(chipsetListHead);
72 | chipsetListHead = nextPtr;
73 | return TRUE;
74 | }
75 |
76 | void chipsetListPrint(void)
77 | {
78 | int cnt = 0;
79 | chipsetList *currPtr = chipsetListHead;
80 | while (currPtr != NULL)
81 | {
82 | printf("----> %s\n", currPtr->title);
83 | currPtr = currPtr->next;
84 | cnt++;
85 | }
86 | printf("END OF LIST: %d items\n", cnt);
87 | }
88 |
89 | chipsetList *chipsetListSearchByTitle(char *title, unsigned int titleSize)
90 | {
91 | if (isListEmpty(chipsetListHead))
92 | {
93 | return NULL;
94 | }
95 |
96 | chipsetList *currPtr = chipsetListHead;
97 | while (
98 | currPtr != NULL &&
99 | strncmp(currPtr->title, title, titleSize)
100 | ) {
101 | currPtr = currPtr->next;
102 | }
103 |
104 | return currPtr;
105 | }
106 |
107 | chipsetList *getChipsetListHead(void)
108 | {
109 | return chipsetListHead;
110 | }
111 |
112 | void emptyChipsetList(void)
113 | {
114 | while(chipsetListRemoveHead())
115 | {}
116 | }
117 |
118 | int chipsetListNodeCount(int cnt)
119 | {
120 | static int nodeCount = 0;
121 |
122 | if (cnt == -1)
123 | {
124 | return nodeCount;
125 | }
126 |
127 | nodeCount = cnt;
128 | return nodeCount;
129 | }
130 |
131 | void addChipsetInList(char *title)
132 | {
133 | if (isStringEmpty(title))
134 | return;
135 |
136 | if (chipsetListSearchByTitle(title, sizeof(char) * MAX_CHIPSET_SIZE) == NULL)
137 | {
138 | chipsetList *node = malloc(sizeof(chipsetList));
139 | if(node == NULL)
140 | {
141 | return;
142 | }
143 | strncpy(node->title, title, sizeof(char) * MAX_CHIPSET_SIZE);
144 | chipsetListAddTail(node);
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/src/chipsetList.h:
--------------------------------------------------------------------------------
1 | /*
2 | chipsetList.h
3 | chipset list functions header for iGame
4 |
5 | Copyright (c) 2018-2023, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef _CHIPSET_LIST_H
24 | #define _CHIPSET_LIST_H
25 |
26 | void chipsetListAddTail(chipsetList *);
27 | void chipsetListPrint(void);
28 | chipsetList *chipsetListSearchByTitle(char *, unsigned int);
29 | chipsetList *getChipsetListHead(void);
30 | void emptyChipsetList(void);
31 | int chipsetListNodeCount(int);
32 | void addChipsetInList(char *);
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/src/fsfuncs.c:
--------------------------------------------------------------------------------
1 | /*
2 | fsfuncs.c
3 | Filesystem functions source for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 |
24 | /* MUI */
25 | #include
26 | #include
27 |
28 | /* Prototypes */
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 |
36 | #include
37 |
38 | /* System */
39 | #if defined(__amigaos4__)
40 | #define ASL_PRE_V38_NAMES
41 | #endif
42 | #include
43 |
44 | /* ANSI C */
45 | #include
46 | #include
47 | #include
48 | #include
49 |
50 | #define iGame_NUMBERS
51 | #include "iGame_strings.h"
52 |
53 | #include "iGameGUI.h"
54 | #include "iGameExtern.h"
55 | #include "strfuncs.h"
56 | #include "slavesList.h"
57 | #include "genresList.h"
58 | #include "chipsetList.h"
59 | #include "funcs.h"
60 | #include "fsfuncs.h"
61 |
62 | extern struct ObjApp* app;
63 | extern char* executable_name;
64 |
65 | /* structures */
66 | struct FileRequester* request;
67 |
68 | /* global variables */
69 | extern char fname[255];
70 | extern igame_settings *current_settings;
71 |
72 | /*
73 | * Get the path of the parent folder
74 | */
75 | void getParentPath(char *filename, char *result, int resultSize)
76 | {
77 | BPTR fileLock = Lock(filename, SHARED_LOCK);
78 | if (fileLock)
79 | {
80 | BPTR folderLock = ParentDir(fileLock);
81 | NameFromLock(folderLock, result, resultSize);
82 |
83 | UnLock(folderLock);
84 | UnLock(fileLock);
85 | }
86 | }
87 |
88 | /*
89 | * Get the filename of a folder/file from a path
90 | */
91 | void getNameFromPath(char *path, char *result, unsigned int resultSize)
92 | {
93 | BPTR pathLock = Lock(path, SHARED_LOCK);
94 | if (pathLock) {
95 |
96 | #if defined(__amigaos4__)
97 | struct ExamineData *data = ExamineObjectTags(EX_LockInput, pathLock, TAG_END);
98 | strncpy(result, data->Name, resultSize);
99 | #else
100 | struct FileInfoBlock *FIblock = (struct FileInfoBlock *)AllocVec(sizeof(struct FileInfoBlock), MEMF_CLEAR);
101 |
102 | if (Examine(pathLock, FIblock))
103 | {
104 | strncpy(result, FIblock->fib_FileName, resultSize);
105 | FreeVec(FIblock);
106 | }
107 | #endif
108 | UnLock(pathLock);
109 | }
110 | }
111 |
112 | void getFullPath(const char *path, char *result)
113 | {
114 | char *buf = malloc(sizeof(char) * MAX_PATH_SIZE);
115 | strcpy(buf, path);
116 | if (path[0] == '/')
117 | {
118 | sprintf(buf, "PROGDIR:%s", path);
119 | }
120 |
121 | BPTR pathLock = Lock(buf, SHARED_LOCK);
122 | if (pathLock)
123 | {
124 | NameFromLock(pathLock, result, sizeof(char) * MAX_PATH_SIZE);
125 | UnLock(pathLock);
126 | free(buf);
127 | return;
128 | }
129 |
130 | free(buf);
131 | }
132 |
133 | /*
134 | * Check if a path actually exists in hard disk.
135 | * - Return True if exists
136 | * - Return False if it doesn't exist
137 | */
138 | BOOL check_path_exists(char *path)
139 | {
140 | const BPTR lock = Lock(path, SHARED_LOCK);
141 | if (lock) {
142 | UnLock(lock);
143 | return TRUE;
144 | }
145 |
146 | return FALSE;
147 | }
148 |
149 | BOOL get_filename(const char *title, const char *positive_text, const BOOL save_mode)
150 | {
151 | BOOL result = FALSE;
152 | if ((request = MUI_AllocAslRequest(ASL_FileRequest, NULL)) != NULL)
153 | {
154 | if (MUI_AslRequestTags(request,
155 | ASLFR_TitleText, title,
156 | ASLFR_PositiveText, positive_text,
157 | ASLFR_DoSaveMode, save_mode,
158 | ASLFR_InitialDrawer, PROGDIR,
159 | TAG_DONE))
160 | {
161 | memset(&fname[0], 0, sizeof fname);
162 | strcat(fname, request->fr_Drawer);
163 | if (fname[strlen(fname) - 1] != (UBYTE)58) /* Check for : */
164 | strcat(fname, "/");
165 | strcat(fname, request->fr_File);
166 |
167 | result = TRUE;
168 | }
169 |
170 | if (request)
171 | MUI_FreeAslRequest(request);
172 | }
173 |
174 | return result;
175 | }
176 |
177 | void slavesListLoadFromCSV(char *filename)
178 | {
179 | int lineBufSize = sizeof(char) * 512;
180 |
181 | if (check_path_exists(filename))
182 | {
183 | FILE *fpgames = fopen(filename, "r");
184 | if (fpgames)
185 | {
186 | char *lineBuf = AllocVec(lineBufSize, MEMF_CLEAR);
187 | char *buf = AllocVec(sizeof(char) * MAX_PATH_SIZE, MEMF_CLEAR);
188 | if((buf == NULL) || (lineBuf == NULL))
189 | {
190 | msg_box((const char*)GetMBString(MSG_NotEnoughMemory));
191 | fclose(fpgames);
192 | return;
193 | }
194 |
195 | while (fgets(lineBuf, lineBufSize, fpgames) != NULL)
196 | {
197 | slavesList *node = malloc(sizeof(slavesList));
198 | if(node == NULL)
199 | {
200 | msg_box((const char*)GetMBString(MSG_NotEnoughMemory));
201 | return;
202 | }
203 |
204 | buf = strtok(lineBuf, ";");
205 | node->instance = atoi(buf);
206 |
207 | buf = strtok(NULL, ";");
208 | node->title[0] = '\0';
209 | sprintf(node->title, "%s", buf);
210 | if (strcasestr(buf, "\""))
211 | {
212 | sprintf(node->title,"%s", substring(buf, 1, -2));
213 | }
214 |
215 | buf = strtok(NULL, ";");
216 | node->genre[0] = '\0';
217 | sprintf(node->genre, "%s", buf);
218 | if (strcasestr(buf, "\""))
219 | {
220 | sprintf(node->genre,"%s", substring(buf, 1, -2));
221 | }
222 | if(isStringEmpty(node->genre))
223 | {
224 | sprintf(node->genre,"Unknown");
225 | }
226 | addGenreInList(node->genre);
227 |
228 | buf = strtok(NULL, ";");
229 | node->path[0] = '\0';
230 | sprintf(node->path, "%s", buf);
231 | if (strcasestr(buf, "\""))
232 | {
233 | sprintf(node->path, "%s", substring(buf, 1, -2));
234 | }
235 |
236 | buf = strtok(NULL, ";");
237 | node->favourite = atoi(buf);
238 |
239 | buf = strtok(NULL, ";");
240 | node->times_played = atoi(buf);
241 |
242 | buf = strtok(NULL, ";");
243 | node->last_played = atoi(buf);
244 |
245 | buf = strtok(NULL, ";");
246 | node->hidden = atoi(buf);
247 |
248 | buf = strtok(NULL, ";");
249 | node->deleted = atoi(buf);
250 |
251 | buf = strtok(NULL, ";");
252 | node->user_title[0] = '\0';
253 | if (buf)
254 | {
255 | sprintf(node->user_title, "%s", buf);
256 | if (strcasestr(buf, "\""))
257 | {
258 | sprintf(node->user_title, "%s", substring(buf, 1, -2));
259 | }
260 | }
261 |
262 | buf = strtok(NULL, ";");
263 | node->year = 0;
264 | if (buf)
265 | node->year = atoi(buf);
266 |
267 | buf = strtok(NULL, ";");
268 | node->players = 0;
269 | if (buf)
270 | node->players = atoi(buf);
271 |
272 | buf = strtok(NULL, ";");
273 | node->chipset[0] = '\0';
274 | if (strncmp(buf, "\n", sizeof(char)))
275 | {
276 | sprintf(node->chipset, "%s", buf);
277 | }
278 | if (strcasestr(buf, "\""))
279 | {
280 | sprintf(node->chipset, "%s", substring(buf, 1, -2));
281 | }
282 | addChipsetInList(node->chipset);
283 |
284 | slavesListAddTail(node);
285 | }
286 | fclose(fpgames);
287 | FreeVec(lineBuf);
288 | }
289 | }
290 | }
291 |
292 | void slavesListSaveToCSV(const char *filename)
293 | {
294 | char csvFilename[32];
295 | const char* saving_message = (const char*)GetMBString(MSG_SavingGamelist);
296 | set(app->TX_Status, MUIA_Text_Contents, saving_message);
297 |
298 | strcpy(csvFilename, (CONST_STRPTR)filename);
299 | strcat(csvFilename, ".csv");
300 |
301 | FILE *fpgames = fopen(csvFilename, "w");
302 | if (!fpgames)
303 | {
304 | msg_box((const char*)GetMBString(MSG_FailedOpeningGameslist));
305 | return;
306 | }
307 |
308 | slavesList *currPtr = getSlavesListHead();
309 |
310 | while (currPtr != NULL)
311 | {
312 | fprintf(
313 | fpgames,
314 | "%d;\"%s\";\"%s\";\"%s\";%d;%d;%d;%d;%d;\"%s\";%d;%d;\"%s\";\n",
315 | currPtr->instance, currPtr->title,
316 | currPtr->genre, currPtr->path, currPtr->favourite,
317 | currPtr->times_played, currPtr->last_played, currPtr->hidden,
318 | currPtr->deleted, currPtr->user_title,
319 | currPtr->year, currPtr->players, currPtr->chipset
320 | );
321 | currPtr = currPtr->next;
322 | }
323 |
324 | fclose(fpgames);
325 | }
326 |
327 | /*
328 | * Gets title from a slave file
329 | * returns 0 on success, 1 on fail
330 | */
331 | int get_title_from_slave(char* slave, char* title)
332 | {
333 | char slave_title[MAX_SLAVE_TITLE_SIZE];
334 |
335 | struct slave_info
336 | {
337 | unsigned long security; // cppcheck-suppress unusedStructMember
338 | char id[8]; // cppcheck-suppress unusedStructMember
339 | unsigned short version;
340 | unsigned short flags; // cppcheck-suppress unusedStructMember
341 | unsigned long base_mem_size; // cppcheck-suppress unusedStructMember
342 | unsigned long exec_install; // cppcheck-suppress unusedStructMember
343 | unsigned short game_loader; // cppcheck-suppress unusedStructMember
344 | unsigned short current_dir; // cppcheck-suppress unusedStructMember
345 | unsigned short dont_cache; // cppcheck-suppress unusedStructMember
346 | char keydebug; // cppcheck-suppress unusedStructMember
347 | char keyexit; // cppcheck-suppress unusedStructMember
348 | unsigned long exp_mem; // cppcheck-suppress unusedStructMember
349 | unsigned short name;
350 | unsigned short copy; // cppcheck-suppress unusedStructMember
351 | unsigned short info; // cppcheck-suppress unusedStructMember
352 | };
353 |
354 | struct slave_info sl;
355 |
356 | FILE* fp = fopen(slave, "rbe");
357 | if (fp == NULL)
358 | {
359 | return 1;
360 | }
361 |
362 | //seek to +0x20
363 | fseek(fp, 32, SEEK_SET);
364 | fread(&sl, 1, sizeof sl, fp);
365 |
366 | //sl.Version = (sl.Version>>8) | (sl.Version<<8);
367 | //sl.name = (sl.name>>8) | (sl.name<<8);
368 |
369 | //printf ("[%s] [%d]\n", sl.ID, sl.Version);
370 |
371 | //sl.name holds the offset for the slave name
372 | fseek(fp, sl.name + 32, SEEK_SET);
373 | //title = calloc (1, 100);
374 | //fread (title, 1, 100, fp);
375 |
376 | if (sl.version < 10)
377 | {
378 | fclose(fp);
379 | return 1;
380 | }
381 |
382 | for (int i = 0; i <= 99; i++)
383 | {
384 | slave_title[i] = fgetc(fp);
385 | if (slave_title[i] == '\n')
386 | {
387 | slave_title[i] = '\0';
388 | break;
389 | }
390 | }
391 |
392 | strcpy(title, slave_title);
393 | fclose(fp);
394 |
395 | return 0;
396 | }
397 |
398 | /*
399 | * Set the item title name based on the path on disk
400 | */
401 | void getTitleFromPath(char *path, char *result, int resultSize)
402 | {
403 | int bufSize = sizeof(char) * MAX_PATH_SIZE;
404 | char *buf = AllocVec(bufSize, MEMF_CLEAR);
405 | char *itemFolderPath = AllocVec(bufSize, MEMF_CLEAR);
406 |
407 | getParentPath(path, itemFolderPath, bufSize);
408 | if (itemFolderPath)
409 | {
410 | getNameFromPath(itemFolderPath, buf, bufSize);
411 |
412 | if (current_settings->no_smart_spaces)
413 | {
414 | strncpy(result, buf, resultSize);
415 | }
416 | else
417 | {
418 | add_spaces_to_string(buf, result, resultSize);
419 | }
420 | }
421 | FreeVec(itemFolderPath);
422 | FreeVec(buf);
423 | }
424 |
425 | // Get the application's executable name
426 | char *get_executable_name(int argc, char **argv)
427 | {
428 | // argc is zero when run from the Workbench,
429 | // positive when run from the CLI
430 | if (argc == 0)
431 | {
432 | // in AmigaOS, argv is a pointer to the WBStartup message
433 | // when argc is zero (run under the Workbench)
434 | struct WBStartup* argmsg = (struct WBStartup *)argv;
435 | struct WBArg* wb_arg = argmsg->sm_ArgList; /* head of the arg list */
436 |
437 | executable_name = wb_arg->wa_Name;
438 | }
439 | else
440 | {
441 | // Run from the CLI
442 | executable_name = argv[0];
443 | }
444 |
445 | return executable_name;
446 | }
447 |
448 | // This reveals the item window on Workbench
449 | void open_current_dir(void)
450 | {
451 | int bufSize = sizeof(char) * MAX_PATH_SIZE;
452 | char *buf = AllocVec(bufSize, MEMF_CLEAR);
453 | char *game_title = NULL;
454 |
455 | if (get_wb_version() < 44)
456 | {
457 | // workbench.library doesn't support OpenWorkbenchObjectA yet
458 | return;
459 | }
460 |
461 | // Get the selected item from the list
462 | DoMethod(app->LV_GamesList, MUIM_NList_GetEntry, MUIV_NList_GetEntry_Active, &game_title);
463 | if (game_title == NULL || strlen(game_title) == 0)
464 | {
465 | msg_box((const char*)GetMBString(MSG_SelectGameFromList));
466 | return;
467 | }
468 |
469 | slavesList *existingNode = NULL;
470 | if ((existingNode = slavesListSearchByTitle(game_title, sizeof(char) * MAX_SLAVE_TITLE_SIZE)) == NULL)
471 | {
472 | msg_box((const char*)GetMBString(MSG_SelectGameFromList));
473 | return;
474 | }
475 |
476 | getParentPath(existingNode->path, buf, bufSize);
477 | if(!buf)
478 | {
479 | msg_box((const char*)GetMBString(MSG_DirectoryNotFound));
480 | return;
481 | }
482 |
483 | // Open path directory on workbench
484 | OpenWorkbenchObject(buf);
485 | FreeVec(buf);
486 | }
487 |
488 | // Check if the path is a folder or a partition
489 | BOOL isPathFolder(char *path)
490 | {
491 | if (path[strlen(path)-1] == ':')
492 | return FALSE;
493 |
494 | return TRUE;
495 | }
496 |
497 | /*
498 | * Get the icon tooltypes and copies them in result
499 | * The path needs to be the full file path without .info at the end
500 | */
501 | void getIconTooltypes(char *path, char *result)
502 | {
503 | if (IconBase)
504 | {
505 | struct DiskObject *diskObj = GetDiskObjectNew(path);
506 | if(diskObj)
507 | {
508 | char *buf = AllocVec(sizeof(char) * MAX_TOOLTYPE_SIZE, MEMF_CLEAR);
509 |
510 | // cppcheck-suppress redundantInitialization
511 | for (STRPTR *tool_types = diskObj->do_ToolTypes; (buf = *tool_types); ++tool_types)
512 | {
513 | if (!strncmp(buf, "*** DON'T EDIT", 14) || !strncmp(buf, "IM", 2))
514 | continue;
515 |
516 | strcat(result, buf);
517 | strcat(result, "\n");
518 | }
519 | FreeVec(buf);
520 | FreeDiskObject(diskObj);
521 | }
522 | }
523 | }
524 |
525 | void setIconTooltypes(char *path, char *tooltypes)
526 | {
527 | if (IconBase)
528 | {
529 | struct DiskObject *diskObj = GetIconTags(path, TAG_DONE);
530 | if(diskObj)
531 | {
532 | int toolTypesCnt = 0;
533 |
534 | char *buf = AllocVec(sizeof(char) * MAX_TOOLTYPE_SIZE, MEMF_CLEAR);
535 |
536 | // Get the number of the new tooltypes
537 | char **table = my_split(tooltypes, "\n");
538 | BOOL isLastLineEmpty = FALSE;
539 |
540 | for (table; (buf = *table); ++table) // cppcheck-suppress redundantInitialization
541 | {
542 | toolTypesCnt++;
543 | isLastLineEmpty = FALSE;
544 | if (buf[0] == '\0')
545 | {
546 | isLastLineEmpty = TRUE;
547 | }
548 | }
549 | if (!isLastLineEmpty)
550 | {
551 | toolTypesCnt++;
552 | }
553 |
554 | unsigned char **newToolTypes = AllocVec(sizeof(char *) * toolTypesCnt, MEMF_CLEAR);
555 | if (newToolTypes)
556 | {
557 | char **table2 = my_split(tooltypes, "\n");
558 | int table2Cnt = 0;
559 | for (table2; (buf = *table2); ++table2)
560 | {
561 | newToolTypes[table2Cnt] = buf;
562 | table2Cnt++;
563 | }
564 |
565 | newToolTypes[toolTypesCnt-1] = NULL;
566 |
567 | diskObj->do_ToolTypes = newToolTypes;
568 |
569 | LONG errorCode;
570 | BOOL success;
571 | success = PutIconTags(path, diskObj,
572 | ICONPUTA_DropNewIconToolTypes, TRUE,
573 | ICONA_ErrorCode, &errorCode,
574 | TAG_DONE);
575 |
576 | if(success == FALSE)
577 | {
578 | msg_box((const char*)GetMBString(MSG_ICONPICTURESTORE_FAILED));
579 | }
580 |
581 | FreeVec(newToolTypes);
582 | }
583 |
584 | FreeDiskObject(diskObj);
585 | }
586 | }
587 | }
588 |
589 | /*
590 | * Check if the needed slave file is set in .info tooltypes
591 | * The infoFile needs to be the full file path without .info at the end
592 | */
593 | BOOL checkSlaveInTooltypes(char *infoFile, char *slaveName)
594 | {
595 | struct DiskObject *diskObj = GetDiskObjectNew(infoFile);
596 | if(diskObj)
597 | {
598 | if (MatchToolValue(FindToolType(diskObj->do_ToolTypes, "SLAVE"), slaveName))
599 | {
600 | FreeDiskObject(diskObj);
601 | return TRUE;
602 | }
603 | FreeDiskObject(diskObj);
604 | }
605 | return FALSE;
606 | }
607 |
608 | /*
609 | * Prepare the exec command based on icon tooltypes
610 | * The infoFile needs to be the full file path without .info at the end
611 | */
612 | void prepareWHDExecution(char *infoFile, char *result)
613 | {
614 | char *tooltypes = AllocVec(sizeof(char) * 1024, MEMF_CLEAR);
615 | getIconTooltypes(infoFile, tooltypes);
616 |
617 | char *buf = AllocVec(sizeof(char) * MAX_TOOLTYPE_SIZE, MEMF_CLEAR);
618 | char **table = my_split(tooltypes, "\n");
619 | strcpy(result, "whdload");
620 | for (table; (buf = *table); ++table) // cppcheck-suppress redundantInitialization
621 | {
622 | if (buf[0] == ' ') continue;
623 | if (buf[0] == '(') continue;
624 | if (buf[0] == '*') continue;
625 | if (buf[0] == ';') continue;
626 | if (buf[0] == '\0') continue;
627 | if (buf[0] == -69) continue; // »
628 | if (buf[0] == -85) continue; // «
629 | if (buf[0] == 34) continue; // \"
630 | if (buf[0] == '.') continue;
631 | if (buf[0] == '=') continue;
632 | if (buf[0] == '#') continue;
633 | if (buf[0] == '!') continue;
634 |
635 | char** tmpTbl = my_split(buf, "=");
636 | if (tmpTbl[1] != NULL)
637 | {
638 | if (tmpTbl[1][0] == '$')
639 | {
640 | sprintf(buf, "%s=%d", tmpTbl[0], hex2dec((char *)tmpTbl[1]));
641 | }
642 | else if (isNumeric(tmpTbl[1]))
643 | {
644 | sprintf(buf, "%s=%s", tmpTbl[0], tmpTbl[1]);
645 | }
646 | else
647 | {
648 | sprintf(buf, "%s=\"%s\"", tmpTbl[0], tmpTbl[1]);
649 | }
650 | }
651 |
652 | strcat(result, " ");
653 | strcat(result, buf);
654 | }
655 |
656 | FreeVec(buf);
657 | FreeVec(tooltypes);
658 | }
659 |
660 | void getIGameDataInfo(char *igameDataPath, slavesList *node)
661 | {
662 | const BPTR fpigamedata = Open(igameDataPath, MODE_OLDFILE);
663 | if (fpigamedata)
664 | {
665 | int lineSize = 64;
666 | char *line = malloc(lineSize * sizeof(char));
667 | while (FGets(fpigamedata, line, lineSize) != NULL)
668 | {
669 | char **tokens = str_split(line, '=');
670 | if (tokens)
671 | {
672 | if (tokens[1] != NULL)
673 | {
674 | int tokenValueLen = strlen(tokens[1]);
675 | if (tokens[1][tokenValueLen - 1] == '\n')
676 | {
677 | tokens[1][tokenValueLen - 1] = '\0';
678 | }
679 | else
680 | {
681 | tokens[1][tokenValueLen] = '\0';
682 | }
683 |
684 | if(current_settings->useIgameDataTitle && !strcmp(tokens[0], "title"))
685 | {
686 | strncpy(node->title, tokens[1], MAX_SLAVE_TITLE_SIZE);
687 | }
688 |
689 | if(!strcmp(tokens[0], "chipset"))
690 | {
691 | strncpy(node->chipset, tokens[1], MAX_CHIPSET_SIZE);
692 | }
693 |
694 | if(!strcmp(tokens[0], "genre"))
695 | {
696 | strncpy(node->genre, tokens[1], MAX_GENRE_NAME_SIZE);
697 | }
698 |
699 | if(!strcmp(tokens[0], "year") && isNumeric(tokens[1]))
700 | {
701 | node->year=atoi(tokens[1]);
702 | }
703 |
704 | if(!strcmp(tokens[0], "players") && isNumeric(tokens[1]))
705 | {
706 | node->players=atoi(tokens[1]);
707 | }
708 |
709 | if(!strcmp(tokens[0], "exe") && !isStringEmpty(tokens[1]) && !strcasestr(tokens[1], ".slave"))
710 | {
711 | strncpy(node->path, tokens[1], MAX_PATH_SIZE);
712 | }
713 | }
714 | int i;
715 | for (i = 0; *(tokens + i); i++)
716 | {
717 | free(*(tokens + i));
718 | }
719 | free(tokens);
720 | }
721 | }
722 |
723 | free(line);
724 | Close(fpigamedata);
725 | }
726 | }
727 |
728 | void loadGenresFromFile(void)
729 | {
730 | const BPTR fpgenres = Open(DEFAULT_GENRES_FILE, MODE_OLDFILE);
731 | if (fpgenres)
732 | {
733 | int lineSize = MAX_GENRE_NAME_SIZE;
734 | char *line = malloc(lineSize * sizeof(char));
735 | while (FGets(fpgenres, line, lineSize) != NULL)
736 | {
737 | line[strlen(line) - 1] = '\0';
738 | if (!isStringEmpty(line))
739 | {
740 | addGenreInList(line);
741 | }
742 | }
743 |
744 | free(line);
745 | Close(fpgenres);
746 | }
747 | }
748 |
--------------------------------------------------------------------------------
/src/fsfuncs.h:
--------------------------------------------------------------------------------
1 | /*
2 | fsfuncs.h
3 | Filesystem functions header for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef _FS_FUNCS_H
24 | #define _FS_FUNCS_H
25 |
26 | void getParentPath(char *, char *, int);
27 | void getNameFromPath(char *, char *, unsigned int);
28 | void getFullPath(const char *, char *);
29 | BOOL check_path_exists(char *);
30 | BOOL get_filename(const char *, const char *, const BOOL);
31 | void slavesListLoadFromCSV(char *);
32 | void slavesListSaveToCSV(const char *);
33 | int get_title_from_slave(char *, char *);
34 | void getTitleFromPath(char *, char *, int);
35 | const char *get_directory_name(const char *);
36 | char *get_executable_name(int, char **);
37 | void open_current_dir(void);
38 | void get_path(char *, char *);
39 | BOOL isPathFolder(char *);
40 | void getIconTooltypes(char *, char *);
41 | void setIconTooltypes(char *, char *);
42 | BOOL checkSlaveInTooltypes(char *, char *);
43 | void prepareWHDExecution(char *, char *);
44 | void getIGameDataInfo(char *, slavesList *);
45 | void loadGenresFromFile(void);
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/src/funcs.h:
--------------------------------------------------------------------------------
1 | /*
2 | iGameMain.c
3 | Misc functions header for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef _FUNCS_H
24 | #define _FUNCS_H
25 |
26 | void msg_box(const char *);
27 | void game_click(void);
28 | void joystick_input(ULONG);
29 | void app_stop(void);
30 | void save_list(void);
31 | ULONG get_wb_version(void);
32 | void scan_repositories(void);
33 | void open_list(void);
34 | int hex2dec(char *);
35 | void save_list_as(void);
36 | void game_delete(void);
37 | void filter_change(void);
38 | void launch_game(void);
39 | void list_show_hidden(void);
40 | void app_start(void);
41 | void slaveProperties(void);
42 | void saveItemProperties(void);
43 | void add_non_whdload(void);
44 | void non_whdload_ok(void);
45 | void repo_stop(void);
46 | void repo_add(void);
47 | void repo_remove(void);
48 | void setting_filter_use_enter_changed(void);
49 | void setting_save_stats_on_exit_changed(void);
50 | void setting_smart_spaces_changed(void);
51 | void setting_titles_from_changed(void);
52 | void setting_hide_screenshot_changed(void);
53 | void setting_no_guigfx_changed(void);
54 | void setting_screenshot_size_changed(void);
55 | void settings_save(void);
56 | void setting_hide_side_panel_changed(void);
57 | void setting_start_with_favorites_changed(void);
58 | void settings_use(void);
59 | void settingUseIgameDataTitleChanged(void);
60 | igame_settings *load_settings(const char *);
61 |
62 | #endif
63 |
--------------------------------------------------------------------------------
/src/genresList.c:
--------------------------------------------------------------------------------
1 | /*
2 | genresList.c
3 | genres list functions source for iGame
4 |
5 | Copyright (c) 2018-2023, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include
28 |
29 | #include "iGameExtern.h"
30 | #include "genresList.h"
31 | #include "strfuncs.h"
32 |
33 | genresList *genresListHead = NULL;
34 |
35 | static int isListEmpty(const void *head)
36 | {
37 | return head == NULL;
38 | }
39 |
40 | void genresListAddTail(genresList *node)
41 | {
42 | if (node != NULL)
43 | {
44 | node->next = NULL;
45 |
46 | if (isListEmpty(genresListHead))
47 | {
48 | genresListHead = node;
49 | }
50 | else
51 | {
52 | // find the last node
53 | genresList *currPtr = genresListHead;
54 | while (currPtr->next != NULL)
55 | {
56 | currPtr = currPtr->next;
57 | }
58 |
59 | currPtr->next = node;
60 | }
61 | }
62 | }
63 |
64 | static BOOL genresListRemoveHead(void) {
65 |
66 | if (isListEmpty(genresListHead)) {
67 | return FALSE;
68 | }
69 |
70 | genresList *nextPtr = genresListHead->next;
71 | free(genresListHead);
72 | genresListHead = nextPtr;
73 | return TRUE;
74 | }
75 |
76 | void genresListPrint(void)
77 | {
78 | int cnt = 0;
79 | genresList *currPtr = genresListHead;
80 | while (currPtr != NULL)
81 | {
82 | printf("----> %s\n", currPtr->title);
83 | currPtr = currPtr->next;
84 | cnt++;
85 | }
86 | printf("END OF LIST: %d items\n", cnt);
87 | }
88 |
89 | genresList *genresListSearchByTitle(char *title, unsigned int titleSize)
90 | {
91 | if (isListEmpty(genresListHead))
92 | {
93 | return NULL;
94 | }
95 |
96 | genresList *currPtr = genresListHead;
97 | while (
98 | currPtr != NULL &&
99 | strncmp(currPtr->title, title, titleSize)
100 | ) {
101 | currPtr = currPtr->next;
102 | }
103 |
104 | return currPtr;
105 | }
106 |
107 | genresList *getGenresListHead(void)
108 | {
109 | return genresListHead;
110 | }
111 |
112 | void emptyGenresList(void)
113 | {
114 | while(genresListRemoveHead())
115 | {}
116 | }
117 |
118 | int genresListNodeCount(int cnt)
119 | {
120 | static int nodeCount = 0;
121 |
122 | if (cnt == -1)
123 | {
124 | return nodeCount;
125 | }
126 |
127 | nodeCount = cnt;
128 | return nodeCount;
129 | }
130 |
131 | void addGenreInList(char *title)
132 | {
133 | if (isStringEmpty(title))
134 | return;
135 |
136 | if (genresListSearchByTitle(title, sizeof(char) * MAX_GENRE_NAME_SIZE) == NULL)
137 | {
138 | genresList *node = malloc(sizeof(genresList));
139 | if(node == NULL)
140 | {
141 | return;
142 | }
143 | strncpy(node->title, title, sizeof(char) * MAX_GENRE_NAME_SIZE);
144 | genresListAddTail(node);
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/src/genresList.h:
--------------------------------------------------------------------------------
1 | /*
2 | genresList.h
3 | genres list functions header for iGame
4 |
5 | Copyright (c) 2018-2023, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef _GENRES_LIST_H
24 | #define _GENRES_LIST_H
25 |
26 | void genresListAddTail(genresList *);
27 | void genresListPrint(void);
28 | genresList *genresListSearchByTitle(char *, unsigned int);
29 | genresList *getGenresListHead(void);
30 | void emptyGenresList(void);
31 | int genresListNodeCount(int);
32 | void addGenreInList(char *);
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/src/iGameExtern.h:
--------------------------------------------------------------------------------
1 | /*
2 | iGameExtern.h
3 | Header file for iGame
4 |
5 | Copyright (c) 2019, Emmanuel Vasilakis and contributors
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef IGAME_EXT_H
24 | #define IGAME_EXT_H
25 |
26 | #define Dtpic_Classname "Dtpic.mui"
27 | // #define MUIA_Dtpic_Name 0x80423d72
28 | #define PROGDIR "PROGDIR:"
29 | #define DEFAULT_GAMESLIST_FILE "PROGDIR:gameslist"
30 | #define DEFAULT_REPOS_FILE "PROGDIR:repos.prefs"
31 | #define DEFAULT_GENRES_FILE "PROGDIR:genres"
32 | #define DEFAULT_SCREENSHOT_FILE "PROGDIR:igame.iff"
33 | #define DEFAULT_SETTINGS_FILE "igame.prefs"
34 | #define DEFAULT_IGAMEDATA_FILE "igame.data"
35 | // #define SLAVE_STRING "slave"
36 | // #define WB_PUBSCREEN_NAME "Workbench"
37 |
38 | // #define FILENAME_HOTKEY 'f'
39 | // #define QUALITY_HOTKEY 'q'
40 | // #define QUALITY_DEFAULT MUIV_Guigfx_Quality_Low
41 | // #define SCALEUP_HOTKEY 'u'
42 | // #define SCALEUP_DEFAULT FALSE
43 | // #define SCALEDOWN_HOTKEY 'd'
44 | // #define SCALEDOWN_DEFAULT TRUE
45 | // #define TRANSMASK_HOTKEY 'm'
46 | // #define TRANSMASK_DEFAULT FALSE
47 | // #define TRANSCOLOR_HOTKEY 'c'
48 | // #define TRANSCOLOR_DEFAULT FALSE
49 | // #define TRANSRGB_HOTKEY 'r'
50 | // #define TRANSRGB_DEFAULT (0x0)
51 | // #define PICASPECT_DEFAULT TRUE
52 | // #define PICASPECT_HOTKEY 'a'
53 | // #define SCREENASPECT_DEFAULT TRUE
54 | // #define SCREENASPECT_HOTKEY 's'
55 | // #define SCALEMODEMASK(u,d,p,s) (((u)?GGSMF_SCALEUP:0)|((d)?GGSMF_SCALEDOWN:0)|((p)?GGSMF_KEEPASPECT_PICTURE:0)|((s)?GGSMF_KEEPASPECT_SCREEN:0))
56 |
57 | #define MENU_SCANREPOS_HOTKEY "R"
58 | #define MENU_ADDNONWHDLOADGAME_HOTKEY "A"
59 | #define MENU_OPENLIST_HOTKEY "O"
60 | #define MENU_SAVELIST_HOTKEY "S"
61 | #define MENU_ABOUT_HOTKEY "?"
62 | #define MENU_QUIT_HOTKEY "Q"
63 | #define MENU_PROPERTIES_HOTKEY "P"
64 | #define MENU_DELETE_HOTKEY "D"
65 |
66 | #define MAX_SLAVE_TITLE_SIZE 128
67 | #define MAX_GENRE_NAME_SIZE 32
68 | #define MAX_PATH_SIZE 256
69 | #define MAX_EXEC_SIZE 256
70 | #define MAX_TOOLTYPE_SIZE 64
71 | #define MAX_ARGUMENTS_SIZE 64
72 | #define MIN_TITLE_FILTER_CHARS 3
73 | #define MAX_CHIPSET_SIZE 16
74 |
75 | typedef struct settings
76 | {
77 | int filter_use_enter;
78 | int save_stats_on_exit;
79 | int no_smart_spaces;
80 | int titles_from_dirs;
81 | int hide_screenshots;
82 | int screenshot_width;
83 | int screenshot_height;
84 | int hide_side_panel;
85 | int no_guigfx;
86 | int start_with_favorites;
87 | int useIgameDataTitle;
88 | int lastScanSetup; // It keeps info of the settings on the last scan
89 | // that influence the item data
90 | // It is a bitfield with the following structure
91 | // ------------ no_smart_spaces
92 | // | --------- titles_from_dirs
93 | // | | ------ useIgameDataTitle
94 | // | | |
95 | // 0 0 0
96 | } igame_settings;
97 |
98 | typedef struct genresList
99 | {
100 | char title[MAX_GENRE_NAME_SIZE];
101 | struct genresList *next;
102 | } genresList;
103 |
104 | typedef struct chipsetList
105 | {
106 | char title[MAX_CHIPSET_SIZE];
107 | struct chipsetList *next;
108 | } chipsetList;
109 |
110 | typedef struct repos
111 | {
112 | char repo[256];
113 | struct repos* next;
114 | } repos_list;
115 |
116 | typedef struct slavesList
117 | {
118 | char title[MAX_SLAVE_TITLE_SIZE];
119 | char user_title[MAX_SLAVE_TITLE_SIZE];
120 | char path[MAX_PATH_SIZE];
121 | char genre[MAX_GENRE_NAME_SIZE];
122 | char arguments[MAX_ARGUMENTS_SIZE];
123 | char chipset[MAX_CHIPSET_SIZE];
124 |
125 | int instance;
126 | int times_played;
127 |
128 | int favourite;// TODO: IDEA - This could be a tag
129 |
130 | int last_played; //indicates whether this one was the last game played
131 |
132 | int exists; // indicates whether this game still exists after a scan
133 | // TODO: IDEA - Maybe needs to be removed when game deletion removes files as well
134 |
135 | int hidden; // game is hidden from normal operation
136 | // TODO: This could be a tag
137 |
138 | int deleted; // indicates this entry should be deleted when the list is saved
139 |
140 | int year; // Year of release
141 | int players; // Maximum number of players
142 |
143 | struct slavesList *next;
144 | } slavesList;
145 |
146 | typedef struct listFilters
147 | {
148 | char title[MAX_SLAVE_TITLE_SIZE];
149 | BOOL showHiddenOnly;
150 | int showGroup;
151 | char showGenre[MAX_GENRE_NAME_SIZE];
152 | char showChipset[MAX_CHIPSET_SIZE];
153 | } listFilters;
154 |
155 | enum {
156 | MENU_ACTIONS=1,
157 | MENU_SCAN,
158 | MENU_ADDGAME,
159 | MENU_SHOWHIDDEN,
160 | MENU_ABOUT,
161 | MENU_QUIT,
162 | MENU_GAME,
163 | MENU_GAMEPROPERTIES,
164 | MENU_GAMEFOLDER,
165 | MENU_PREFERENCES,
166 | MENU_SETTINGS,
167 | MENU_REPOSITORIES,
168 | MENU_MUISETTINGS,
169 | MENU_LAST
170 | };
171 |
172 | enum {
173 | GROUP_SHOWALL,
174 | GROUP_FAVOURITES,
175 | GROUP_LAST_PLAYED,
176 | GROUP_MOST_PLAYED,
177 | GROUP_NEVER_PLAYED,
178 | GROUP_LAST
179 | };
180 |
181 | #endif
182 |
--------------------------------------------------------------------------------
/src/iGameGUI.h:
--------------------------------------------------------------------------------
1 | /*
2 | iGameGUI.h
3 | GUI header file for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef GUI_FILE_H
24 | #define GUI_FILE_H
25 |
26 | #define STR_HELPER(s) #s //stringify argument
27 | #define STR(s) STR_HELPER(s) //indirection to expand argument macros
28 |
29 | /* Types */
30 | #include
31 |
32 | struct ObjApp
33 | {
34 | APTR App;
35 | APTR WI_MainWindow;
36 | APTR MN_MainMenu;
37 | APTR STR_Filter;
38 | APTR GR_leftpanel;
39 | APTR GR_sidepanel;
40 | APTR GR_spacedScreenshot;
41 | APTR IM_GameImage_0;
42 | APTR IM_GameImage_1;
43 | APTR Space_Sidepanel;
44 | APTR LV_GamesList;
45 | APTR CY_FilterList;
46 | APTR LV_GenresList;
47 | APTR CY_ChipsetList;
48 | APTR TX_Status;
49 | APTR WI_Properties;
50 | APTR STR_PropertiesGameTitle;
51 | APTR CY_PropertiesGenre;
52 | APTR CH_PropertiesFavorite;
53 | APTR CH_PropertiesHidden;
54 | APTR TX_PropertiesTimesPlayed;
55 | APTR TX_PropertiesSlavePath;
56 | APTR TX_PropertiesTooltypes;
57 | APTR BT_PropertiesOK;
58 | APTR BT_PropertiesCancel;
59 | APTR WI_GameRepositories;
60 | APTR PA_RepoPath;
61 | APTR STR_PA_RepoPath;
62 | APTR BT_AddRepo;
63 | APTR LV_GameRepositories;
64 | APTR BT_RemoveRepo;
65 | APTR BT_CloseRepoWindow;
66 | APTR WI_AddNonWHDLoad;
67 | APTR STR_AddTitle;
68 | APTR PA_AddGame;
69 | APTR STR_PA_AddGame;
70 | APTR CY_AddGameGenre;
71 | APTR BT_AddGameOK;
72 | APTR BT_AddGameCancel;
73 | APTR WI_About;
74 | APTR TX_About;
75 | APTR BT_AboutOK;
76 | APTR WI_Settings;
77 | APTR CH_Screenshots;
78 | APTR CH_NoGuiGfx;
79 | APTR CY_ScreenshotSize;
80 | APTR STR_Width;
81 | APTR STR_Height;
82 | APTR RA_TitlesFrom;
83 | APTR CH_SmartSpaces;
84 | APTR CH_UseIgameDataTitle;
85 | APTR CH_SaveStatsOnExit;
86 | APTR CH_FilterUseEnter;
87 | APTR CH_HideSidepanel;
88 | APTR CH_StartWithFavorites;
89 | APTR BT_SettingsSave;
90 | APTR BT_SettingsUse;
91 | APTR BT_SettingsCancel;
92 | CONST_STRPTR STR_TX_Status;
93 | CONST_STRPTR STR_TX_PropertiesTimesPlayed;
94 | CONST_STRPTR STR_TX_PropertiesSlavePath;
95 | CONST_STRPTR STR_TX_PropertiesTooltypes;
96 | CONST_STRPTR STR_TX_About;
97 | CONST_STRPTR CY_PropertiesGenreContent[256];
98 | CONST_STRPTR CY_ScreenshotSizeContent[4];
99 | CONST_STRPTR RA_TitlesFromContent[3];
100 | CONST_STRPTR CY_FilterListContent[6];
101 | CONST_STRPTR CY_ChipsetListContent[16];
102 | };
103 |
104 | struct ObjApp *CreateApp(void);
105 | void DisposeApp(struct ObjApp *);
106 |
107 | BOOL checkImageDatatype(STRPTR);
108 |
109 | #endif
110 |
--------------------------------------------------------------------------------
/src/iGameMain.c:
--------------------------------------------------------------------------------
1 | /*
2 | iGameMain.c
3 | Main source for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #define MUI_OBSOLETE
24 |
25 | /* MUI */
26 | #include
27 |
28 | /* Prototypes */
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | /* ANSI C */
36 | #include
37 |
38 | #ifndef __amigaos4__
39 | #define __NOLIBBASE__
40 | #include
41 | #undef __NOLIBBASE__
42 | #else
43 | #include
44 | #endif
45 |
46 | #include "iGameExtern.h"
47 | #include "fsfuncs.h"
48 | #include "funcs.h"
49 | #include "iGameGUI.h"
50 |
51 | /* Increase stack size */
52 | #if defined(__amigaos4__)
53 | static const char USED min_stack[] = "$STACK:102400";
54 | #else
55 | LONG __stack = 32768;
56 | #endif
57 |
58 | #ifndef MAKE_ID
59 | #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
60 | #endif
61 |
62 | struct ObjApp* app = NULL; /* Object */
63 | struct Catalog *Catalog;
64 |
65 | struct Library* MUIMasterBase;
66 | #ifndef __amigaos4__
67 | struct IntuitionBase *IntuitionBase;
68 | #else
69 | struct Library *IntuitionBase;
70 | struct DataTypesIFace *IDataTypes;
71 | struct MUIMasterIFace *IMUIMaster;
72 | struct GraphicsIFace *IGraphics;
73 | struct IconIFace *IIcon;
74 | struct IntuitionIFace *IIntuition;
75 | struct LocaleIFace *ILocale;
76 | struct UtilityIFace *IUtility;
77 | struct WorkbenchIFace *IWorkbench;
78 | #endif
79 | struct Library *DataTypesBase;
80 | struct Library *GfxBase;
81 | struct Library *IconBase;
82 | struct Library *LocaleBase;
83 | struct Library *GuiGfxMCC;
84 | struct Library *GuiGfxBase;
85 | struct Library *LowLevelBase;
86 | struct Library *RenderLibBase;
87 | struct Library *TextEditorMCC;
88 | struct Library *NListviewMCC;
89 | struct Library *UtilityBase;
90 | struct Library *WorkbenchBase;
91 |
92 | char *executable_name; // TODO: Why global?
93 |
94 | igame_settings* iGameSettings = NULL;
95 | BOOL blockGuiGfx = FALSE;
96 |
97 | static int initLibraries(void);
98 | static void cleanupLibraries(void);
99 |
100 | static void cleanUp(void)
101 | {
102 | if (app)
103 | app_stop();
104 |
105 | executable_name = NULL;
106 |
107 | cleanupLibraries();
108 |
109 | DisposeApp(app);
110 | }
111 |
112 | static int clean_exit(STRPTR msg)
113 | {
114 | if (msg)
115 | {
116 | PutStr(msg);
117 | return RETURN_ERROR;
118 | }
119 |
120 | return RETURN_OK;
121 | }
122 |
123 | int main(int argc, char **argv)
124 | {
125 | executable_name = get_executable_name(argc, argv);
126 |
127 | if (initLibraries() != RETURN_OK)
128 | {
129 | cleanUp();
130 | return RETURN_ERROR;
131 | }
132 |
133 | app = CreateApp();
134 | if (app)
135 | {
136 | app_start();
137 | }
138 | else
139 | {
140 | cleanUp();
141 | return RETURN_ERROR;
142 | }
143 |
144 | const int unit = 1;
145 | ULONG old = 0;
146 | ULONG signals;
147 | BOOL running = TRUE;
148 |
149 | while (running)
150 | {
151 | ULONG eventId = DoMethod(app->App, MUIM_Application_Input, &signals);
152 |
153 | switch (eventId)
154 | {
155 | case MENU_QUIT:
156 | case MUIV_Application_ReturnID_Quit:
157 | running = FALSE;
158 | break;
159 |
160 | case MENU_SCAN:
161 | scan_repositories();
162 | break;
163 |
164 | case MENU_ADDGAME:
165 | add_non_whdload();
166 | break;
167 |
168 | case MENU_ABOUT:
169 | set(app->WI_About, MUIA_Window_Open, TRUE);
170 | break;
171 |
172 | case MENU_GAMEPROPERTIES:
173 | slaveProperties();
174 | break;
175 |
176 | case MENU_GAMEFOLDER:
177 | open_current_dir();
178 | break;
179 |
180 | case MENU_SHOWHIDDEN:
181 | list_show_hidden();
182 | break;
183 |
184 | case MENU_SETTINGS:
185 | set(app->WI_Settings, MUIA_Window_Open, TRUE);
186 | break;
187 |
188 | case MENU_REPOSITORIES:
189 | set(app->WI_GameRepositories, MUIA_Window_Open, TRUE);
190 | break;
191 |
192 | case MENU_MUISETTINGS:
193 | DoMethod(app->App, MUIM_Application_OpenConfigWindow, 0);
194 | break;
195 | }
196 |
197 | // TODO: This doesn't work on AmigaOS 4. Needs to be updated with compatible code
198 | #if !defined(__amigaos4__)
199 | if (LowLevelBase)
200 | {
201 | const ULONG new = ReadJoyPort(unit);
202 | if (new != old)
203 | {
204 | old = new;
205 | joystick_input(new);
206 | }
207 |
208 | Delay(1);
209 | }
210 | #endif
211 |
212 | if (running && signals) Wait(signals);
213 | }
214 |
215 | cleanUp();
216 | return RETURN_OK;
217 | }
218 |
219 | static BOOL initLocale(void)
220 | {
221 | if ((LocaleBase = OpenLibrary("locale.library", 37)))
222 | {
223 | #ifdef __amigaos4__
224 | ILocale = (struct LocaleIFace *)GetInterface( LocaleBase, "main", 1, NULL );
225 | if(!ILocale) return clean_exit("Can't open locale.library Interface");
226 | #endif
227 |
228 | Catalog = OpenCatalog(NULL, "iGame.catalog", OC_BuiltInLanguage, (ULONG) "english", TAG_DONE);
229 | }
230 | else
231 | {
232 | return clean_exit("Can't open locale.library v37 or greater\n");
233 | }
234 |
235 | return TRUE;
236 | }
237 |
238 | static void cleanupLocale(void)
239 | {
240 | if (Catalog)
241 | {
242 | CloseCatalog(Catalog);
243 | Catalog = NULL;
244 | }
245 |
246 | #if defined(__amigaos4__)
247 | if (ILocale)
248 | DropInterface((struct Interface *)ILocale);
249 | #endif
250 |
251 | if (LocaleBase) {
252 | CloseLibrary(LocaleBase);
253 | LocaleBase = NULL;
254 | }
255 | }
256 |
257 | static int initLibraries(void)
258 | {
259 | if ((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, 19)))
260 | {
261 | #ifdef __amigaos4__
262 | IMUIMaster = (struct MUIMasterIFace *)GetInterface(MUIMasterBase, "main", 1, NULL);
263 | if(!IMUIMaster) return clean_exit("Can't open muimaster Interface\n");
264 | #endif
265 | }
266 | else return clean_exit("Can't open muimaster.library v19\n");
267 |
268 | if (!(TextEditorMCC = OpenLibrary("mui/TextEditor.mcc", 15)))
269 | {
270 | return clean_exit("Can't open TextEditor.mcc v15 or greater\n");
271 | }
272 |
273 | if (!(NListviewMCC = OpenLibrary("mui/NListview.mcc", 19)))
274 | {
275 | return clean_exit("Can't open NListview.mcc v19 or greater\n");
276 | }
277 |
278 | if (!(LowLevelBase = OpenLibrary("lowlevel.library", 0)))
279 | {
280 | return clean_exit("Can't open lowlevel.library\n");
281 | }
282 |
283 | if ((IconBase = OpenLibrary("icon.library", 37)))
284 | {
285 | #ifdef __amigaos4__
286 | IIcon = (struct IconIFace *)GetInterface( IconBase, "main", 1, NULL );
287 | if(!IIcon) return clean_exit("Can't open icon.library Interface\n");
288 | #endif
289 | }
290 | else return clean_exit("Can't open icon.library v37 or greater\n");
291 |
292 | #ifndef __amigaos4__
293 | if ((IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 37)))
294 | #else
295 | if ((IntuitionBase = OpenLibrary("intuition.library", 37)))
296 | #endif
297 | {
298 | #ifdef __amigaos4__
299 | IIntuition = (struct IntuitionIFace *)GetInterface( IntuitionBase, "main", 1, NULL );
300 | if(!IIntuition) return clean_exit("Can't open intuition.library Interface\n");
301 | #endif
302 | }
303 | else return clean_exit("Can't open intuition.library v37 or greater\n");
304 |
305 | if ((GfxBase = OpenLibrary("graphics.library", 37)))
306 | {
307 | #ifdef __amigaos4__
308 | IGraphics = (struct GraphicsIFace *)GetInterface( GfxBase, "main", 1, NULL );
309 | if(!IGraphics) return clean_exit("Can't open graphics.library Interface\n");
310 | #endif
311 | }
312 | else return clean_exit("Can't open graphics.library v37 or greater\n");
313 |
314 | if ((WorkbenchBase = OpenLibrary("workbench.library", 37)))
315 | {
316 | #ifdef __amigaos4__
317 | IWorkbench = (struct WorkbenchIFace *)GetInterface( WorkbenchBase, "main", 1, NULL );
318 | if(!IWorkbench) return clean_exit("Can't open workbench.library Interface\n");
319 | #endif
320 | }
321 | else return clean_exit("Can't open workbench.library v37 or greater\n");
322 |
323 | if ((DataTypesBase = OpenLibrary("datatypes.library", 37)))
324 | {
325 | #ifdef __amigaos4__
326 | IDataTypes = (struct DataTypesIFace *)GetInterface( DataTypesBase, "main", 1, NULL );
327 | if(!IDataTypes) return clean_exit("Can't open datatypes.library Interface\n");
328 | #endif
329 | }
330 | else return clean_exit("Can't open datatypes.library v37 or greater\n");
331 |
332 | if ((UtilityBase = OpenLibrary("utility.library", 37)))
333 | {
334 | #ifdef __amigaos4__
335 | IUtility = (struct UtilityIFace *)GetInterface( UtilityBase, "main", 1, NULL );
336 | if(!IUtility) return clean_exit("Can't open Utility.library Interface\n");
337 | #endif
338 | }
339 | else return clean_exit("Can't open utility.library v37 or greater\n");
340 |
341 | if (!initLocale())
342 | {
343 | return RETURN_ERROR;
344 | }
345 |
346 | // Load settings here, after we load the icon.library
347 | iGameSettings = load_settings(DEFAULT_SETTINGS_FILE);
348 |
349 | if (
350 | !(RenderLibBase = OpenLibrary("render.library", 30)) ||
351 | !(GuiGfxBase = OpenLibrary("guigfx.library", 17)) ||
352 | !(GuiGfxMCC = OpenLibrary("mui/Guigfx.mcc", 19))
353 | ) {
354 | iGameSettings->no_guigfx = 1;
355 | blockGuiGfx = TRUE;
356 | }
357 |
358 | return RETURN_OK;
359 | }
360 |
361 | static void cleanupLibraries(void)
362 | {
363 | #ifdef __amigaos4__
364 | if(IDataTypes) DropInterface((struct Interface *) IDataTypes);
365 | if(IMUIMaster) DropInterface((struct Interface *) IMUIMaster);
366 | if(IGraphics) DropInterface((struct Interface *) IGraphics);
367 | if(IIcon) DropInterface((struct Interface *) IIcon);
368 | if(IIntuition) DropInterface((struct Interface *) IIntuition);
369 | if(ILocale) DropInterface((struct Interface *) ILocale);
370 | if(IUtility) DropInterface((struct Interface *) IUtility);
371 | if(IWorkbench) DropInterface((struct Interface *) IWorkbench);
372 | #endif
373 |
374 | if (TextEditorMCC) CloseLibrary(TextEditorMCC);
375 | if (NListviewMCC) CloseLibrary(NListviewMCC);
376 | if (LowLevelBase) CloseLibrary(LowLevelBase);
377 | if (RenderLibBase) CloseLibrary(RenderLibBase);
378 | if (GfxBase) CloseLibrary(GfxBase);
379 | if (GuiGfxBase) CloseLibrary(GuiGfxBase);
380 | if (GuiGfxMCC) CloseLibrary(GuiGfxMCC);
381 | if (DataTypesBase) CloseLibrary(DataTypesBase);
382 | if (IconBase) CloseLibrary(IconBase);
383 | if (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
384 | if (DataTypesBase) CloseLibrary(DataTypesBase);
385 | if (UtilityBase) CloseLibrary(UtilityBase);
386 | if (WorkbenchBase) CloseLibrary(WorkbenchBase);
387 |
388 | cleanupLocale();
389 |
390 | #if defined(__amigaos4__)
391 | if (IMUIMaster) DropInterface((struct Interface *)IMUIMaster);
392 | #endif
393 | if (MUIMasterBase) CloseLibrary(MUIMasterBase);
394 | }
395 |
--------------------------------------------------------------------------------
/src/slavesList.c:
--------------------------------------------------------------------------------
1 | /*
2 | slavesList.c
3 | slaves list functions source for iGame
4 |
5 | Copyright (c) 2018-2022, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include
28 |
29 | #include "iGameExtern.h"
30 | #include "slavesList.h"
31 |
32 | slavesList *slavesListHead = NULL;
33 | slavesList *slavesListTail = NULL;
34 | slavesList *slavesListBuffer = NULL;
35 |
36 | static int isListEmpty(const void *head)
37 | {
38 | return head == NULL;
39 | }
40 |
41 | void slavesListAddHead(slavesList *node)
42 | {
43 | if (node != NULL)
44 | {
45 | node->next = NULL;
46 |
47 | if (isListEmpty(slavesListHead))
48 | {
49 | slavesListHead = node;
50 | }
51 | else
52 | {
53 | node->next = slavesListHead;
54 | slavesListHead = node;
55 | }
56 | }
57 | }
58 |
59 | void slavesListAddTail(slavesList *node)
60 | {
61 | if (node != NULL)
62 | {
63 | node->next = NULL;
64 |
65 | if (isListEmpty(slavesListHead))
66 | {
67 | slavesListHead = node;
68 | slavesListTail = node;
69 | }
70 | else
71 | {
72 | slavesListTail->next = node;
73 | slavesListTail = node;
74 | }
75 | }
76 | }
77 |
78 | static BOOL slavesListRemoveHead(void) {
79 |
80 | if (isListEmpty(slavesListHead)) {
81 | return FALSE;
82 | }
83 |
84 | slavesList *nextPtr = slavesListHead->next;
85 | free(slavesListHead);
86 | slavesListHead = nextPtr;
87 | return TRUE;
88 | }
89 |
90 | void slavesListPrint(void)
91 | {
92 | int cnt = 0;
93 | slavesList *currPtr = slavesListHead;
94 | while (currPtr != NULL)
95 | {
96 | printf("----> %d\t%s\t%s\n", currPtr->instance, currPtr->title, currPtr->genre);
97 | printf("----> %s\t%d\t%d\n", currPtr->path, currPtr->favourite, currPtr->times_played);
98 | printf("----> %d\t%d\t%s\n\n", currPtr->last_played, currPtr->hidden, currPtr->user_title);
99 | currPtr = currPtr->next;
100 | cnt++;
101 | }
102 | printf("END OF LIST: %d items\n", cnt);
103 | }
104 |
105 | /*
106 | * Search the slavesList by item path.
107 | * If found returns the node pointer, otherwise returns NULL
108 | *
109 | * TODO: When we have the list sorted make this binary search, if possible
110 | */
111 | slavesList *slavesListSearchByPath(char *path, unsigned int pathSize)
112 | {
113 | if (isListEmpty(slavesListHead))
114 | {
115 | return NULL;
116 | }
117 |
118 | slavesList *currPtr = slavesListHead;
119 | while (currPtr != NULL && strncmp(currPtr->path, path, pathSize))
120 | {
121 | currPtr = currPtr->next;
122 | }
123 |
124 | return currPtr;
125 | }
126 |
127 | slavesList *slavesListSearchByTitle(char *title, unsigned int titleSize)
128 | {
129 | if (isListEmpty(slavesListHead))
130 | {
131 | return NULL;
132 | }
133 |
134 | slavesList *currPtr = slavesListHead;
135 | while (
136 | currPtr != NULL &&
137 | strncmp(currPtr->user_title, title, titleSize) &&
138 | strncmp(currPtr->title, title, titleSize)
139 | ) {
140 | currPtr = currPtr->next;
141 | }
142 |
143 | return currPtr;
144 | }
145 |
146 | void slavesListCountInstancesByTitle(slavesList *node)
147 | {
148 | if (isListEmpty(slavesListHead))
149 | {
150 | return;
151 | }
152 |
153 | slavesList *currPtr = slavesListHead;
154 | node->instance = 0;
155 | while (currPtr != NULL)
156 | {
157 | if(
158 | currPtr->title[0] == node->title[0] &&
159 | !strncmp(currPtr->title, node->title, sizeof(currPtr->title)) &&
160 | strncmp(currPtr->path, node->path, sizeof(currPtr->path))
161 | ) {
162 | node->instance++;
163 | }
164 | currPtr = currPtr->next;
165 | }
166 | free(currPtr);
167 | }
168 |
169 | slavesList *getSlavesListHead(void)
170 | {
171 | return slavesListHead;
172 | }
173 |
174 | void setSlavesListBuffer(slavesList *node)
175 | {
176 | slavesListBuffer = node;
177 | }
178 |
179 | slavesList *getSlavesListBuffer(void)
180 | {
181 | return slavesListBuffer;
182 | }
183 |
184 | void emptySlavesList(void)
185 | {
186 | while(slavesListRemoveHead())
187 | {}
188 | }
189 |
190 | int slavesListNodeCount(int cnt)
191 | {
192 | static int nodeCount = 0;
193 |
194 | if (cnt == -1)
195 | {
196 | return nodeCount;
197 | }
198 |
199 | nodeCount = cnt;
200 | return nodeCount;
201 | }
202 |
--------------------------------------------------------------------------------
/src/slavesList.h:
--------------------------------------------------------------------------------
1 | /*
2 | slavesList.h
3 | slaves list functions header for iGame
4 |
5 | Copyright (c) 2018-2022, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef _SLAVES_LIST_H
24 | #define _SLAVES_LIST_H
25 |
26 |
27 | void slavesListAddHead(slavesList *);
28 | void slavesListAddTail(slavesList *);
29 | void slavesListPrint(void);
30 | void slavesListClearTitles(void);
31 | slavesList *slavesListSearchByPath(char *, unsigned int);
32 | slavesList *slavesListSearchByTitle(char *, unsigned int);
33 | void slavesListCountInstancesByTitle(slavesList *);
34 | slavesList *getSlavesListHead(void);
35 | void setSlavesListBuffer(slavesList *);
36 | slavesList *getSlavesListBuffer(void);
37 | void emptySlavesList(void);
38 | int slavesListNodeCount(int);
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/src/strfuncs.c:
--------------------------------------------------------------------------------
1 | /*
2 | strfuncs.c
3 | String functions source for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #include
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | // #define iGame_CODE
31 | #define iGame_NUMBERS
32 | #define iGame_ARRAY
33 | #include "iGame_strings.h"
34 | #include "iGameExtern.h"
35 |
36 | #include "strfuncs.h"
37 |
38 | // extern struct LocaleBase *LocaleBase;
39 | #ifndef __amigaos4__
40 | extern struct Library *LocaleBase;
41 | #else
42 | extern struct LocaleIFace *ILocale;
43 | #endif
44 | extern struct Catalog *Catalog;
45 |
46 | /*
47 | * strcasestr() implementation for AmigaOS
48 | *
49 | * This function finds the first occurrence of the substring needle in the
50 | * string haystack, ignoring the case of both arguments. The terminating
51 | * null bytes ('\0') are not compared.
52 | *
53 | * Cribbed from https://stackoverflow.com/a/45109082/5697 and renamed from
54 | * stristr() to strcasestr() to match GCC function of same name
55 | */
56 | char *strcasestr(const char *haystack, const char *needle)
57 | {
58 | int c = tolower((unsigned char)*needle);
59 | if (c == '\0')
60 | return (char *)haystack;
61 |
62 | for (; *haystack; haystack++) {
63 | if (tolower((unsigned char)*haystack) == c) {
64 | for (int i = 0;;) {
65 | if (needle[++i] == '\0')
66 | return (char *)haystack;
67 | if (tolower((unsigned char)haystack[i]) != tolower((unsigned char)needle[i]))
68 | break;
69 | }
70 | }
71 | }
72 |
73 | return NULL;
74 | }
75 |
76 |
77 | /*
78 | * POSIX Compatibility Library for AmigaOS
79 | *
80 | * Written by Frank Wille in 2003
81 | *
82 | * $Id: strdup.c,v 1.2 2005/02/27 13:45:27 phx Exp $
83 | */
84 | char* strdup(const char* s)
85 | {
86 | char* new;
87 |
88 | if ((new = malloc(strlen(s) + 1)))
89 | strcpy(new, s);
90 | return new;
91 | }
92 |
93 |
94 | /*
95 | * Convert a string to lower case
96 | */
97 | void string_to_lower(char *text)
98 | {
99 | for (int i = 0; i <= strlen(text) - 1; i++)
100 | text[i] = tolower(text[i]);
101 | }
102 |
103 |
104 | /*
105 | * Splits a string using spl
106 | */
107 | char** my_split(char* str, char* spl)
108 | {
109 | char **ret, *buffer[256], buf[4096];
110 | int i;
111 |
112 | if (!spl)
113 | {
114 | ret = (char **)malloc(2 * sizeof(char *));
115 | ret[0] = (char *)strdup(str);
116 | ret[1] = NULL;
117 | return (ret);
118 | }
119 |
120 | int count = 0;
121 |
122 | char* fptr = str;
123 | const int spl_len = strlen(spl);
124 | char* sptr = strstr(fptr, spl);
125 | while (sptr)
126 | {
127 | i = sptr - fptr;
128 | memcpy(buf, fptr, i);
129 | buf[i] = '\0';
130 | buffer[count++] = (char *)strdup(buf);
131 | fptr = sptr + spl_len;
132 | sptr = strstr(fptr, spl);
133 | }
134 | sptr = strchr(fptr, '\0');
135 | i = sptr - fptr;
136 | memcpy(buf, fptr, i);
137 | buf[i] = '\0';
138 | buffer[count++] = (char *)strdup(buf);
139 |
140 | ret = (char **)malloc((count + 1) * sizeof(char *));
141 |
142 | for (i = 0; i < count; i++)
143 | {
144 | ret[i] = buffer[i];
145 | }
146 | ret[count] = NULL;
147 |
148 | return ret;
149 | }
150 |
151 | char **str_split(char *a_str, const char a_delim)
152 | {
153 | char** result = 0;
154 | size_t count = 0;
155 | char* tmp = a_str;
156 | char* last_comma = 0;
157 | char delim[2];
158 | delim[0] = a_delim;
159 | delim[1] = 0;
160 |
161 | /* Count how many elements will be extracted. */
162 | while (*tmp)
163 | {
164 | if (a_delim == *tmp)
165 | {
166 | count++;
167 | last_comma = tmp;
168 | }
169 | tmp++;
170 | }
171 |
172 | /* Add space for trailing token. */
173 | count += last_comma < (a_str + strlen(a_str) - 1);
174 |
175 | /* Add space for terminating null string so caller
176 | knows where the list of returned strings ends. */
177 | count++;
178 |
179 | result = malloc(sizeof(char*) * count);
180 |
181 | if (result)
182 | {
183 | size_t idx = 0;
184 | char* token = strtok(a_str, delim);
185 |
186 | while (token)
187 | {
188 | // assert(idx < count);
189 | *(result + idx++) = strdup(token);
190 | token = strtok(0, delim);
191 | }
192 | // assert(idx == count - 1);
193 | *(result + idx) = 0;
194 | }
195 |
196 | return result;
197 | }
198 |
199 | int get_delimiter_position(const char* str)
200 | {
201 | char* delimiter = strrchr(str, '/');
202 | if (!delimiter)
203 | delimiter = strrchr(str, ':');
204 |
205 | if (!delimiter)
206 | {
207 | return 0;
208 | }
209 |
210 | return delimiter - str;
211 | }
212 |
213 | // Add spaces to a string, based on letter capitalization and numbers
214 | // E.g. input "A10TankKiller2Disk" -> "A10 Tank Killer 2 Disk"
215 | void add_spaces_to_string(const char* input, char *result, int resultSize)
216 | {
217 | char input_string[MAX_SLAVE_TITLE_SIZE];
218 | strcpy(input_string, input);
219 | char* output = (char*)malloc(sizeof(input_string) * 2);
220 |
221 | // Special case for the first character, we don't touch it
222 | output[0] = input_string[0];
223 |
224 | unsigned int output_index = 1;
225 | unsigned int input_index = 1;
226 | unsigned int capital_found = 0;
227 | unsigned int number_found = 0;
228 | while (input_string[input_index])
229 | {
230 | if (isspace(input_string[input_index]))
231 | {
232 | strncpy(result, input, resultSize);
233 | free(output);
234 | return;
235 | }
236 |
237 | if (isdigit(input_string[input_index]))
238 | {
239 | if (number_found < input_index - 1)
240 | {
241 | output[output_index] = ' ';
242 | output_index++;
243 | output[output_index] = input_string[input_index];
244 | }
245 | number_found = input_index;
246 | }
247 |
248 | else if (isupper(input_string[input_index]))
249 | {
250 | if (capital_found < input_index - 1)
251 | {
252 | output[output_index] = ' ';
253 | output_index++;
254 | output[output_index] = input_string[input_index];
255 | }
256 | capital_found = input_index;
257 | }
258 |
259 | output[output_index] = input_string[input_index];
260 | output_index++;
261 | input_index++;
262 | }
263 | output[output_index] = '\0';
264 |
265 | strncpy(result, output, resultSize);
266 | free(output);
267 | }
268 |
269 | STRPTR substring(STRPTR string, int position, int length)
270 | {
271 | STRPTR p;
272 | unsigned int c;
273 | if (position < 0) position = 0;
274 | if (length < 0) length = strlen(string) + length;
275 |
276 | p = malloc(length+1);
277 |
278 | if (p == NULL)
279 | {
280 | return NULL;
281 | }
282 |
283 | for (c = 0; c < length; c++)
284 | {
285 | *(p+c) = *(string + position);
286 | string++;
287 | }
288 |
289 | *(p+c) = '\0';
290 |
291 | return p;
292 | }
293 |
294 | STRPTR GetMBString(ULONG refId)
295 | {
296 | const struct iGame_ArrayType *t = iGame_Array + refId;
297 |
298 | #ifndef __amigaos4__
299 | return LocaleBase ? GetCatalogStr(Catalog, t->cca_ID, t->cca_Str) : t->cca_Str;
300 | #else
301 | return GetCatalogStr(Catalog, t->cca_ID, t->cca_Str);
302 | #endif
303 | }
304 |
305 | BOOL isStringEmpty(const char *string)
306 | {
307 | if (string == NULL)
308 | return TRUE;
309 |
310 | return string[0] == '\0';
311 | }
312 |
313 | BOOL isNumeric(const char *string)
314 | {
315 | while(*string)
316 | {
317 | if(*string < '0' || *string > '9')
318 | return FALSE;
319 | ++string;
320 | }
321 | return TRUE;
322 | }
323 |
--------------------------------------------------------------------------------
/src/strfuncs.h:
--------------------------------------------------------------------------------
1 | /*
2 | strfuncs.h
3 | String functions header for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef _STR_FUNCS_H
24 | #define _STR_FUNCS_H
25 |
26 | char *strcasestr(const char *, const char *);
27 | char* strdup(const char *);
28 | void string_to_lower(char *);
29 | char** my_split(char *, char *);
30 | char **str_split(char *, const char);
31 | int get_delimiter_position(const char *);
32 | void add_spaces_to_string(const char *, char *, int);
33 | STRPTR substring(STRPTR, int, int);
34 | STRPTR GetMBString(ULONG);
35 | BOOL isStringEmpty(const char *);
36 | BOOL isNumeric(const char *);
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | version.h
3 | Version manipulation header for iGame
4 |
5 | Copyright (c) 2018, Emmanuel Vasilakis
6 |
7 | This file is part of iGame.
8 |
9 | iGame is free software: you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation, either version 3 of the License, or
12 | (at your option) any later version.
13 |
14 | iGame is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with iGame. If not, see .
21 | */
22 |
23 | #ifndef MAJOR_VERS
24 | #define MAJOR_VERS 2
25 | #endif
26 |
27 | #ifndef MINOR_VERS
28 | #define MINOR_VERS 4
29 | #endif
30 |
31 | #ifndef PATCH_VERS
32 | #define PATCH_VERS 0
33 | #endif
34 |
35 | #ifndef RELEASE_DATE
36 | #define RELEASE_DATE "2023"
37 | #endif
38 |
39 | #define COPY_END_YEAR 2023
40 |
41 | #ifndef VERSION
42 | #define VERSION "$VER: iGame " STR(MAJOR_VERS) "." STR(MINOR_VERS) "." STR(PATCH_VERS) " (" STR(RELEASE_DATE) ")"
43 | #endif
44 |
--------------------------------------------------------------------------------