Compare commits

...

274 commits

Author SHA1 Message Date
NepDisk
457527d77a GL renderer changes
Always draw the skybox to prevent it from randomly going black and remove deprecated polyskys define. Thaanks Alug for suggestion and assistance.
2025-06-11 13:40:11 -04:00
NepDisk
12c93988e6 Experiment: always stack rubberband boost 2025-06-11 00:39:15 -04:00
NepDisk
a306d117a8 Fix music going away on unfocus 2025-06-11 00:38:15 -04:00
NepDisk
b93a8215c8 Make bonuschars.kart an Iwad 2025-06-10 18:41:20 -04:00
NepDisk
64fd5b93ac raise skinlimit to 4096
Why not UINT16_MAX? Thats 22gb of allocation lmao
2025-06-10 15:38:11 -04:00
Alug
37ea829b2f fix the horrible ffloorclip clearing loops
if yall ever decide to get rid of the static screensize buffer, the compiler will just straight up never optimize those loops and it will turn some maps into absolute cache miss hell, using std::fill only cause it looks fancy lmao
2025-06-08 22:16:30 +02:00
Alug
cd3715bfaa fix portals not accounting for slopes (only for kartmaps)
fixes the last portal paths on ante station
2025-06-08 22:07:30 +02:00
Alug
e63f68e732 fix portal clipping being completely completely broken on kart maps
truly amazing
2025-06-08 22:01:41 +02:00
Alug
1c5dc89b33 fix non papersprite clipping in R_ProjectSprite overflowing 2025-06-06 15:31:38 +02:00
Alug
7247768278 fix 2560x1440 resolution crashing 2025-06-06 15:12:11 +02:00
NepDisk
dcc8b1d868 Stop bots from moving when exiting properly. 2025-06-05 08:35:53 -04:00
NepDisk
a47594d4be Make this code look less ass 2025-06-04 17:52:23 -04:00
NepDisk
656268f31d Merge pull request 'Port I_Video refactor' (#62) from ivideorefactor into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/62
2025-06-03 20:15:14 +02:00
NepDisk
6c10edcdb4 Fix OpenGL gif recording issues 2025-06-03 14:07:08 -04:00
NepDisk
c958ce87ca I_RegisterSysCommands so video cvars are registerd before menu init happens 2025-06-03 13:47:29 -04:00
NepDisk
d0d8236bad Fix waterpanel in deh_tables 2025-06-03 13:21:47 -04:00
NepDisk
de91aa3a13 Clean up of I_video port 2025-06-03 12:52:32 -04:00
NepDisk
00d08c851f i_video.c refactor port
based on 4de2d81815
2025-06-03 12:06:19 -04:00
GenericHeroGuy
0952b94d3f Update mappatch hash 2025-06-03 14:05:10 +02:00
GenericHeroGuy
1b0ea34476 Add No Spread flag for patch finish lines 2025-06-03 01:10:11 +02:00
NepDisk
10c858186f Change Ring Racers refernce in file to Blankart 2025-06-02 15:17:58 -04:00
NepDisk
c1ca05c6c5 Adjust some stuff to accout for how the map header toggle works 2025-06-02 15:11:39 -04:00
NepDisk
b087b5e372 Port JugadorXEI's Terrain library for Lua
Credits go to JugadorXEI for the code in this. https://git.do.srb2.org/KartKrew/RingRacers/-/merge_requests/103\#d1c6f6fa1ba8207cb6aaef9f4a47d9a0b6b8b5c1

Modifications have been made to account for extra terrainflags, new terraintypes and removal of Ring Racers specfic types
2025-06-02 14:38:33 -04:00
NepDisk
9d864729db Port v.cachePatch second parameter for rotation from Classic
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2662
2025-06-02 11:23:51 -04:00
NepDisk
4a29babb66 Inline P_MobjWasRemoved 2025-06-02 11:14:16 -04:00
GenericHeroGuy
f63e6d5462 Fix missing hitbox for Mementos Reaper 2025-06-02 16:22:55 +02:00
NepDisk
b0b9d97b1f add MF_PAIN fallback just in case 2025-06-02 09:39:49 -04:00
NepDisk
3f98670fa4 Prevent antigrief from affecting bots 2025-06-02 09:10:13 -04:00
NepDisk
d6a7c5d5a1 Const void not void const 2025-06-01 20:34:47 -04:00
NepDisk
d3567cf7d4 Add back prev and next check 2025-06-01 10:09:23 -04:00
NepDisk
ea2677b3d4 Warning cleanup 2025-06-01 09:35:41 -04:00
NepDisk
d371be5c45 Clear more stuff on player exit like kart 2025-06-01 08:42:44 -04:00
NepDisk
cea824d5a5 This is a dev branch we don't need the beta tag 2025-05-31 14:03:59 -04:00
NepDisk
e1bda81f2c Server Commit system to prevent old clients from joining then desynching 2025-05-31 14:02:07 -04:00
NepDisk
cdff8d6c7c Be quiet you 2025-05-31 13:33:58 -04:00
NepDisk
39b4248983 Simple fix for fog planes until blendtran is properly fixed 2025-05-31 13:04:34 -04:00
NepDisk
45b92e7cf2 Clear boost info when hit
Should hopefully resolve instances where you blast off after a hit
2025-05-31 11:05:06 -04:00
NepDisk
989f01d644 Kill SF_HIGHRES 2025-05-31 09:23:36 -04:00
NepDisk
b59cf3c189 The acutal fix 2025-05-30 01:07:43 -04:00
NepDisk
bd5ebef91a Test Fix 2025-05-30 00:45:02 -04:00
NepDisk
9cf5b4e79f Update stuff for new menu additions 2025-05-30 00:14:15 -04:00
NepDisk
3decf36748 Fix this if statement 2025-05-29 13:36:57 -04:00
NepDisk
5ce7eef8d8 Add some encore stuff to GL renderer 2025-05-29 13:14:57 -04:00
NepDisk
e78e49e3c1 Texture precaching
A simple port from saturn
2025-05-29 12:06:51 -04:00
NepDisk
06ce9ddac8 Don't free sprites on addon load 2025-05-29 10:29:29 -04:00
NepDisk
cda4515780 Fix bananadrag wrap around 2025-05-29 10:10:08 -04:00
NepDisk
03c78ea8a5 I forgor these return 0 on match 2025-05-28 18:41:48 -04:00
NepDisk
3a38c437c2 Port support for interpoints for non powerlevel scoring 2025-05-28 16:23:33 -04:00
NepDisk
9dabf34da0 Merge pull request 'More Voting Rows' (#61) from morevotingrows into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/61
2025-05-28 21:57:13 +02:00
NepDisk
c130467233 Fix buffer overflow due to smaller array define 2025-05-28 15:53:34 -04:00
NepDisk
156fddad1c Backwards compat for certain powers 2025-05-28 13:39:55 -04:00
NepDisk
c96662e714 Fix incorrect gametype 2025-05-28 11:03:06 -04:00
NepDisk
8faba2dd35 Basic voting rows port
Still crashes and seems to mess with the newgametype
2025-05-28 10:51:18 -04:00
NepDisk
6d071fd23a Allow you to toggle how many encore votes appear at once when encore is on 2025-05-28 01:35:08 -04:00
NepDisk
1884d6db2a Fix annoying encore behaviour in voting 2025-05-28 01:19:08 -04:00
NepDisk
df1da401b3 Server background in MS
Thanks luigibud
2025-05-27 15:11:18 -04:00
NepDisk
705c4530af [PATCH] Fix models causing an overflow 2025-05-27 13:43:32 -04:00
NepDisk
c348dbdd08 [PATCH] Fix Shadow caching crashing with PU_SPRITE 2025-05-27 13:42:21 -04:00
NepDisk
4d3ba6e448 Update hashes 2025-05-27 12:35:17 -04:00
NepDisk
a109b8cdb6 Merge branch 'improveddrifiting' into blankart-dev 2025-05-27 11:29:20 -04:00
GenericHeroGuy
454c62413e Update hash 2025-05-27 17:21:42 +02:00
GenericHeroGuy
7fbf5830a7 Trying to handle various different speeds... 2025-05-27 17:05:09 +02:00
NepDisk
2424c2ccb8 Cache Shadows and make them PU_STATIC
By just doing this performanc has shot up.
2025-05-27 10:27:58 -04:00
NepDisk
3e070a9cb0 Lua compatmode changes for 'players' 2025-05-27 01:31:01 -04:00
NepDisk
ee7546f40a Default to OpenGL until software works proper on windows 2025-05-26 22:09:44 -04:00
NepDisk
6b314ef4da Update MapPatch hash for server test 2025-05-26 21:56:50 -04:00
GenericHeroGuy
553ce473b1 Use turnvalue for handling instead of some weird approximation 2025-05-26 23:53:24 +02:00
NepDisk
950c6b4f2d Add support for max translations 2025-05-26 17:38:32 -04:00
GenericHeroGuy
b6b3920a17 Merge branch 'blankart-dev' into improveddrifiting 2025-05-26 22:09:34 +02:00
NepDisk
6127729ca6 Fix Thwomps causing I_Error in tclasses 2025-05-26 11:48:15 -04:00
GenericHeroGuy
91ec80d9ed Fix the bad cycle message 2025-05-26 17:34:33 +02:00
GenericHeroGuy
5683b62155 Fix Slipgate Cup the Correct Way(tm) 2025-05-26 17:13:02 +02:00
NepDisk
c06e3d3352 Catch Animdefs error instead of I_Erroring 2025-05-26 10:38:44 -04:00
NepDisk
5b50bc72df Fix up antigrief 2025-05-26 09:14:20 -04:00
GenericHeroGuy
c89333a924 Get rid of the ancient Android backend
Doesn't seem to have been properly maintained since 2009
2025-05-25 22:33:24 +02:00
NepDisk
eab0f94106 Make accel stacking more accurate to neptune 2025-05-25 14:54:37 -04:00
NepDisk
a2063584f5 Merge pull request 'Remove Flats' (#56) from removeflats into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/56
2025-05-25 20:08:00 +02:00
NepDisk
8cfa0fa74f Remove leftover flat animdef code 2025-05-25 14:00:41 -04:00
GenericHeroGuy
f96c9e9095 Forgot why this is necessary 2025-05-25 19:51:06 +02:00
GenericHeroGuy
647bc08b3f Fix chromakey in encore mode (+ cleanup) 2025-05-25 19:36:37 +02:00
GenericHeroGuy
2642e8d972 Get flat palremap working again 2025-05-25 18:18:48 +02:00
GenericHeroGuy
fc03c880fb Fix flat corruption (from lacto's feffdb37) 2025-05-25 18:18:48 +02:00
Lactozilla
fbea771486 Cleanup R_GetFlatForTexture 2025-05-25 18:18:48 +02:00
NepDisk
41a62d7823 Do palette hack for flats as well 2025-05-25 11:30:07 -04:00
NepDisk
b429a3e74c Repair removeflats commit to make it function correctly with colormapping 2025-05-25 10:57:49 -04:00
NepDisk
c83d5cebd4 AAAAAA
I'll be honest what am I doing???
2025-05-25 02:01:33 -04:00
NepDisk
6874f7ca70 Fix brightmap overlays being drawn instead of regular texture: 2025-05-25 00:48:25 -04:00
NepDisk
c7cbc27efb completly borked remove flats port
Completey fucked color and brightmap handling for floors.
2025-05-24 23:41:33 -04:00
GenericHeroGuy
9ef9e41dba Use prediction/pathfinding for drift waypoints 2025-05-25 02:44:36 +02:00
NepDisk
0a453db80d Readd extra bouncyfloor feature for binary backwards compat 2025-05-24 20:37:45 -04:00
NepDisk
b1550d0508 Use built in backwards compat instead of Dofloor/Doceiling old on special 403 2025-05-24 20:14:40 -04:00
NepDisk
d95b9210e9 Invert binary conversion code for spikes
This has been the cause of the most annoying long standing bug to date. Who knew this got inverted in 2.2
2025-05-24 18:34:17 -04:00
NepDisk
9a21eaee0b Basic Startboost timing code 2025-05-24 17:47:07 -04:00
NepDisk
4d4a6a29f1 Prevent sigsevs 2025-05-24 10:18:36 -04:00
GenericHeroGuy
481053a232 An attempt at timing and setting up drifts 2025-05-24 00:33:04 +02:00
GenericHeroGuy
abd496bd61 Behavior fixes, changed variables, an actual bot debugging HUD 2025-05-23 21:11:42 +02:00
NepDisk
479af14832 Add sliptide tilt toggle
Thanks Jon for the idea!
2025-05-23 13:51:57 -04:00
NepDisk
25a8e3dd4d Don't fallback for change viewpoint 2025-05-23 13:31:33 -04:00
GenericHeroGuy
4812a25f95 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2025-05-23 18:35:00 +02:00
GenericHeroGuy
6657cd2c46 What!? Help me! 2025-05-22 23:33:35 +02:00
NepDisk
199dd2c85d This is supposed to be blockplayer 2025-05-22 09:31:33 -04:00
NepDisk
153838b7c2 Fix firstperson POSTIMG for heat and water 2025-05-22 09:27:17 -04:00
NepDisk
171eafee1f Use a Custom sound for Low Rings
Yes its the same one from Gunstar heroes like RR
2025-05-22 09:08:24 -04:00
NepDisk
43ad4b045b Play sound when getting low on rings 2025-05-22 08:48:49 -04:00
NepDisk
7d7e107fc2 Lower starting Rings back to 5 2025-05-22 08:30:51 -04:00
NepDisk
04d3cea9e6 Fix flipcam playerflag sticking 2025-05-22 08:17:36 -04:00
NepDisk
c8d5ef46be Disable Floor ring drain sector special 2025-05-21 20:26:13 -04:00
NepDisk
44ce0fd448 Only do particles on real landing and make exiting pit hits not instashield 2025-05-21 16:10:42 -04:00
GenericHeroGuy
11b4d9606e Merge branch 'blankart-dev' into improveddrifiting 2025-05-21 20:34:22 +02:00
NepDisk
64e99e8c26 fix video menu coloring and add extra video modes 2025-05-21 10:43:31 -04:00
NepDisk
92375116e6 Fix movefloor/ceiling using wrong args 2025-05-21 10:04:09 -04:00
NepDisk
2ee8729585 Fix Music Remap 2025-05-21 07:25:56 -04:00
NepDisk
5ce5f607c8 Fix Special 403 for bowling pin cut 2025-05-21 07:07:26 -04:00
NepDisk
deb447aec7 Port salty hop, changes for new terraindefs in assets 2025-05-20 17:07:13 -04:00
NepDisk
869255f9ec Merge branch 'infostuff' into blankart-dev 2025-05-20 09:40:44 -04:00
NepDisk
2e0516305c Fix bowling pin count 2025-05-20 08:25:37 -04:00
NepDisk
a0db165e93 Some small changes for respawn 2025-05-19 18:20:19 -04:00
GenericHeroGuy
da226e75a5 More robust(?) finish line handling 2025-05-20 00:07:37 +02:00
NepDisk
fbccc955c9 Only Drop rings if mobj2 is a player 2025-05-19 17:17:33 -04:00
GenericHeroGuy
6e8e027a6e Fix incorrect parsing of map patches 2025-05-19 20:44:38 +02:00
NepDisk
cfe10eb5c1 Use char* instead of void * to avoid using GCC extension of void being 1 2025-05-19 13:43:57 -04:00
GenericHeroGuy
4d2dc53972 Fix warnings 2025-05-19 19:36:49 +02:00
NepDisk
6c2efa96a5 Somewhat fix jank air animation 2025-05-19 12:56:06 -04:00
NepDisk
7a7d9bcd97 always AIZ driftdust 2025-05-19 12:23:55 -04:00
GenericHeroGuy
f5b779c7db Avoid duplicating freeslots and clean up lua_infolib 2025-05-19 18:22:34 +02:00
GenericHeroGuy
13a0378cea Turn namehash/nameofs into a struct, and linearly allocate freeslots
Also fix bugged skincolor & precipprops clear in lua_infolib
2025-05-19 18:22:00 +02:00
GenericHeroGuy
4d3f43b8e4 Move skincolors definition from doomdef.h to info.h
Recompiling 80% of the codebase every time was getting on my nerves...
also clean up initialization a bit
2025-05-19 17:29:55 +02:00
GenericHeroGuy
360e7419e8 Merge branch 'blankart-dev' into infostuff 2025-05-19 15:23:51 +02:00
NepDisk
83312b6e26 Fix TA menu menucaps 2025-05-19 09:16:43 -04:00
NepDisk
3c941ac6a4 Remove OPUS
As much as I would like it, Windows is garbage. Assets update coming soon
2025-05-19 08:09:45 -04:00
NepDisk
7d67d7b03b Disable the gainax until we have graphics for it. 2025-05-19 00:39:43 -04:00
NepDisk
62537cece1 Fix sneaker stacks sometimes sticking 2025-05-19 00:12:55 -04:00
NepDisk
bfa520f5a4 Add Menucaps to kartstats menu 2025-05-18 23:58:51 -04:00
NepDisk
05f1e18084 Large Menu commit
Ports 2.2's scrolling menu, port SRB2Kart Custom build Menucap cvar, register new menus
2025-05-18 23:55:03 -04:00
NepDisk
bafc9c3bd2 Fix rocket sneakers 2025-05-18 21:19:44 -04:00
NepDisk
32043b3825 Fix brakemod dropoff cvar not being registerd 2025-05-18 21:02:29 -04:00
NepDisk
cab441bad4 Fix diagonal squares 2025-05-18 19:58:50 -04:00
NepDisk
9179c6620c Remove air drifitng jitter
It looked really strange since you aren't on the ground to jitter in the first place.
2025-05-18 19:37:38 -04:00
NepDisk
1897f9d1e7 Fix weird stacking speed dropoff issue
Thanks so much Indev!
2025-05-18 18:56:11 -04:00
NepDisk
e9b79efe2d rename calc_arg_offset to match newest booststack 2025-05-18 17:48:57 -04:00
NepDisk
99daf2efd8 Use sneakerstacking sound cvar and use stacking helper func 2025-05-18 17:33:21 -04:00
NepDisk
f8443108a7 More various fixes 2025-05-18 15:44:30 -04:00
NepDisk
30eb87487b Use negative here instead 2025-05-18 14:19:33 -04:00
NepDisk
4950069cd6 Fix other minor issues brought up
Thanks again Jon
2025-05-18 14:18:06 -04:00
NepDisk
5f2fd005f0 Revert rocketsneaker usage nerf 2025-05-18 14:15:39 -04:00
NepDisk
91c4e0e7f0 Use Neptune shadow scales
Thanks Jon for the suggestion
2025-05-18 14:12:44 -04:00
NepDisk
b9836e4925 Add toggle for deadzone style
The game now defaults to Kart style deadzone to remove that stiffness felt on shallower angles
2025-05-18 14:06:56 -04:00
GenericHeroGuy
1d0a066590 Add name hashing for supported info types 2025-05-18 18:13:04 +02:00
GenericHeroGuy
0009807746 Unify info lookup functions for SOC/Lua/ACS
Use MAX* constants instead of -1 for invalid values, because enum signedness
is implementation-defined
2025-05-18 17:37:47 +02:00
GenericHeroGuy
95ae54fd08 Actually inline strbuf_get 2025-05-18 14:47:50 +02:00
GenericHeroGuy
c3fe5e80ac Screw checking for nameofs being zero, just keep count of mobjs/states 2025-05-18 14:46:24 +02:00
NepDisk
39f507d2b5 Make Ring drop on bumps consistent 2025-05-17 20:23:18 -04:00
NepDisk
a3b6a13e95 Fix retry softlock 2025-05-17 17:15:52 -04:00
NepDisk
e78877783e Fix buffer overflow in HWR_InitModels
Idk who did this
2025-05-17 16:27:09 -04:00
NepDisk
ff2f058972 refactor giveitem and port other RR cheats. 2025-05-17 12:46:37 -04:00
NepDisk
bf4e879c82 Update hash 2025-05-17 07:27:02 -04:00
NepDisk
575c6551ea Add mappatch.pk3, Allow patches to remove existing mapthings. 2025-05-16 08:41:14 -04:00
NepDisk
ab6962e05b Update hash for 1st map patch 2025-05-15 21:08:16 -04:00
NepDisk
9c164ce438 Use CEP itemoddscale code for 32p shit later 2025-05-15 20:56:51 -04:00
NepDisk
61e7d86d78 Instashield on Clash 2025-05-15 19:27:18 -04:00
NepDisk
2eaaf088de Bananas dont make you scream 2025-05-15 15:15:29 -04:00
NepDisk
8aba05d503 [PATCH] Try to make bots better at drifting
By GenericHeroGuy
2025-05-15 14:38:07 -04:00
NepDisk
3163dcf9c4 Remove bird window shake
sorry jartha
2025-05-15 14:35:46 -04:00
NepDisk
4e42d1ac75 Ensure good respawn angle from fallback 2025-05-15 11:57:45 -04:00
NepDisk
378d887a5c check for null pls 2025-05-15 11:42:02 -04:00
NepDisk
08408831bf the safeguardist of safeguards 2025-05-15 11:38:43 -04:00
NepDisk
5b8f200e1a Safeguard respawn next even more 2025-05-14 23:18:20 -04:00
GenericHeroGuy
4e66cb67a8 Fix returned mobj/state index in compatmode 2025-05-14 19:03:29 +02:00
GenericHeroGuy
711944350e Deduplicated freeslotting code 2025-05-14 18:56:28 +02:00
Alug
f072746216 unlock everything when using modkartdata save
doesent make too much sense having to unlock everything again when playing mods
2025-05-14 11:45:27 -04:00
GenericHeroGuy
1fa9a7cb8e Refactor info table initialization
We SOCced this stuff ages ago, time to exploit it
Also fixes resetdata kek
2025-05-14 17:28:41 +02:00
GenericHeroGuy
e3f8019b84 And menus 2025-05-14 16:43:20 +02:00
GenericHeroGuy
1b095d220e Why stop there? Go for skincolors too :^) 2025-05-14 16:06:11 +02:00
GenericHeroGuy
1793c2ea95 Use string buffers for mobjs and states 2025-05-14 15:35:26 +02:00
GenericHeroGuy
536075b00a Add string buffer library 2025-05-14 15:06:29 +02:00
NepDisk
1886b6708f Fix inaccurate header 2025-05-13 16:19:30 -04:00
NepDisk
f05c8ee548 fix oob write when map has playerstarts for 32 players 2025-05-13 16:08:20 -04:00
NepDisk
cd24b68517 Revert "Use 32 instead of maxplayers"
This reverts commit 769f41dba1.
2025-05-13 15:57:23 -04:00
NepDisk
bd233a9201 Per map track complexity and modifier max 2025-05-13 15:49:21 -04:00
NepDisk
9a45acdd7d Fix item rolls 2025-05-13 13:53:46 -04:00
NepDisk
18c17b6b7c ugly looking line fix 2025-05-13 13:39:19 -04:00
NepDisk
a1c3c6b9e1 Reimplement ringloss on bump. Also fix some shield issues. 2025-05-13 13:36:11 -04:00
NepDisk
2399cb4f70 I forgor
I need to stop doing stuff with lack of sleep
2025-05-13 05:49:19 -04:00
NepDisk
654aaa6065 Fix bad copy paste 2025-05-13 05:34:39 -04:00
NepDisk
1ef87baf3f refactor kartspeed code and add respawn point safety 2025-05-12 22:25:11 -04:00
NepDisk
72130dfd99 Update hash for assets additions 2025-05-12 12:47:58 -04:00
NepDisk
1790eb413c Call LUA_HookLinedefExecute from LUA_HookSpecialExecute
Lets me directly use activator and means cleaner looking special code
2025-05-10 08:51:45 -04:00
NepDisk
f5f878e2eb Nerf the landmine. 2025-05-10 08:14:48 -04:00
NepDisk
9b538c9db2 Update hashbrown 2025-05-10 07:54:45 -04:00
NepDisk
1d6dd4125a Remove Droptarget. 2025-05-10 07:31:51 -04:00
NepDisk
d69c999890 Allow both Execute hooks in UDMF 2025-05-10 06:27:32 -04:00
NepDisk
16b4ea9b6f Remove Mapping configs
They Have been moved to ULB
2025-05-09 01:27:18 -04:00
NepDisk
0699647d60 Merge pull request 'Map Patches' (#52) from mappatch into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/52
2025-05-08 21:51:03 +00:00
GenericHeroGuy
a5ec18ead7 Fix regression in checkpoint handling for unpatched waypoint maps 2025-05-08 23:20:52 +02:00
GenericHeroGuy
b7afe4f347 Use legacy checkpoint threshold for patched maps 2025-05-08 22:23:03 +02:00
GenericHeroGuy
d0ed82a540 Allow multiple checksums to be specified in a patch
...and while I'm at it, actually pad the printed hash
2025-05-08 22:00:46 +02:00
NepDisk
97fe82afc9 Merge branch 'blankart-dev' into mappatch 2025-05-08 09:27:16 -04:00
NepDisk
fa750c450a Make sneaker types no longer a magic number 2025-05-08 09:23:55 -04:00
NepDisk
0c185993b9 Merge branch 'blankart-dev' into mappatch 2025-05-07 15:42:22 -04:00
NepDisk
e8c8763a83 Show finished players on map by default 2025-05-07 15:19:12 -04:00
NepDisk
c2619c39f6 Update README.md 2025-05-07 14:41:29 +00:00
NepDisk
fe6fe57a55 Make a better readme. 2025-05-07 14:40:41 +00:00
NepDisk
1c213fddc2 Merge branch 'blankart-dev' into mappatch 2025-05-06 17:31:05 -04:00
NepDisk
7ce830218c ACUTALLY register this lmao 2025-05-06 17:30:16 -04:00
NepDisk
707d8bc88b Allow setting base track complexity 2025-05-06 17:26:30 -04:00
NepDisk
8c7d45b062 Merge branch 'blankart-dev' into mappatch 2025-05-06 15:11:51 -04:00
GenericHeroGuy
20396e14cb Operation: Save Megablock Castle
Two new finish line flags:
Single-Use, to make a finish line that only works on lap 0 and nowhere else
Require Sector Special, for the maps with FOF finish lines

For waypoints, the "flip finish line" flag on arg0 has been removed.
Instead, arg4 is now dedicated to holding flags applied to the finish line.
2025-05-06 20:43:31 +02:00
James R
67888c237d Activate sector each time / once actions when mobj touches the ground
Before

- Each time / once only activates when the mobj's sector
  changes
- The activation may depend on the mobj touching the floor
- If the mobj is in the air when the sector changes, the
  action will never be activated

After

- Each time / once actions that require floor touching
  also activate every time the mobj lands on the ground
  from the air (regardless of whether the sector changed)
2025-05-06 19:07:53 +02:00
NepDisk
6541ea08f0 Tweak BASE_TRACK_COMPLEXITY 2025-05-06 10:18:49 -04:00
NepDisk
cc6e2ed490 Port SFG SPB minimap behaviour 2025-05-06 10:17:10 -04:00
NepDisk
cc694a31b7 Kick BASE_TRACK_COMPLEXTIY back to RR value 2025-05-05 21:24:31 -04:00
NepDisk
19e8dc6691 Remove Check water from spots that shouldn't use it 2025-05-05 18:59:13 -04:00
NepDisk
b1c7d65633 Small feedback changes for hud stuff 2025-05-05 18:28:52 -04:00
NepDisk
d8e1083429 Refactor some HUD elements and bring colorized hud support 2025-05-05 17:51:39 -04:00
NepDisk
4beb4e6f02 Only Run patch waypoint functionality on patched maps
The Wiki says its only active on patched maps, so I'm acutally making that true.
2025-05-05 09:08:17 -04:00
GenericHeroGuy
0239543d3f Fix the binary config interface 2025-05-04 00:24:34 +02:00
NepDisk
c786331bbc Merge branch 'blankart-dev' into mappatch 2025-05-03 17:51:03 -04:00
GenericHeroGuy
0a02cc84dd Add finish line flip to config 2025-05-03 23:45:22 +02:00
GenericHeroGuy
144b93f262 Misc waypoint fixes, make bogus finish line waypoints work 2025-05-03 22:41:09 +02:00
NepDisk
fea7aa001b Use constants instead of magic numbers for roulette info 2025-05-03 12:48:02 -04:00
NepDisk
ee92faabba Refactor some item related things. 2025-05-03 12:48:02 -04:00
GenericHeroGuy
54a628bdfd Enable waypoints for patched maps 2025-05-03 18:09:40 +02:00
NepDisk
c20a785119 Merge pull request 'Rework powersliding' (#51) from Anonimus/blankart:dobotsdrift into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/51
2025-05-03 15:18:26 +00:00
Anonimus
eb02d18181 Rework powersliding
Was placebo before, now forces inward drifts.
2025-05-02 19:48:17 -04:00
NepDisk
82a150c670 Fix tripwire wall issue 2025-05-02 12:18:56 -04:00
GenericHeroGuy
d58aa37228 Loading map patches 2025-05-02 16:51:06 +02:00
NepDisk
bd7ab20efc Some Cmake fixes 2025-05-01 20:03:51 -04:00
NepDisk
dd176a9efd Clang fixes 2025-05-01 15:16:53 -04:00
NepDisk
ecfc29ac8a Revert Test rewrite for R_FFloorCanClip
This reverts commit 86e1a65502.
2025-05-01 12:13:12 -04:00
NepDisk
ed0a3ecbc6 whoops 2025-05-01 12:05:21 -04:00
NepDisk
d9e12f138f Revert "Update SDL2 for windows"
This reverts commit 6479b84f5c.
2025-05-01 11:57:14 -04:00
NepDisk
6479b84f5c Update SDL2 for windows 2025-05-01 11:20:27 -04:00
NepDisk
86e1a65502 Test rewrite for R_FFloorCanClip
Wanna see if this fixes software for windows users.
2025-05-01 11:09:55 -04:00
GenericHeroGuy
a25fbac276 Update libdivide, fix compiling with GCC 15 2025-05-01 17:03:56 +02:00
James R
6019b8b96a R_ProjectSprite: fix overflow in sideways perspective clipping
Multiplications of perspective values can easily overflow
and flip sign bit at far distances. Instead, divide the
left operand.
2025-05-01 10:22:42 -04:00
NepDisk
c3bae82317 Update waterrun conditions and make water trails spawn on items 2025-05-01 10:22:09 -04:00
NepDisk
b0d7eab749 Use GP difficulty in RPC 2025-04-30 19:05:20 -04:00
NepDisk
3ece20fb67 Show Grandprix in RPC 2025-04-30 18:56:26 -04:00
NepDisk
1fba237ef2 Merge pull request 'Revert mines' (#49) from revertmines into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/49
2025-04-30 22:36:39 +00:00
NepDisk
560917544a Update mine branch hash 2025-04-30 18:36:36 -04:00
NepDisk
89a0b216a1 Report stale skincolor crash fix 2025-04-30 18:23:58 -04:00
NepDisk
a53de0d11e Fix mineexplosion compiler warning 2025-04-30 18:11:11 -04:00
NepDisk
8f04562e4c Merge branch 'blankart-dev' into revertmines 2025-04-30 17:21:57 -04:00
NepDisk
f85473a405 Add support for showing maps on discord RPC 2025-04-30 16:56:08 -04:00
NepDisk
0d3b0e2e0e Show TA mode in discord RPC 2025-04-29 19:47:26 -04:00
NepDisk
c5d7fc4a36 Fix off by one in discord rpc 2025-04-29 19:43:36 -04:00
NepDisk
9584982685 Revert Rewrite mines
As much as this pains me, this might be needed for lua compat.

This reverts commit 1381a56077.
2025-04-29 18:10:57 -04:00
Alug
ebb86169a9 fix rare double free when getting hit at the same tic as a resynch occurs 2025-04-29 19:24:03 +02:00
NepDisk
c5eb38bd0e Don't do air safety on levelstart
Prevents breaking some levels that drop you in
2025-04-29 12:06:39 -04:00
GenericHeroGuy
528049527f Clean up palette loading 2025-04-29 17:50:20 +02:00
NepDisk
ed010edbc2 Frying hashbrowns 2025-04-29 11:21:38 -04:00
NepDisk
00ed0194e6 Be quiet compiler. 2025-04-29 11:02:11 -04:00
NepDisk
6b46ff7bb5 Disallow ring use and kickstart accel before starttime 2025-04-29 09:18:08 -04:00
NepDisk
d67fd9cb76 Do more work to account for screen layout cvars
This is complete ass pain but what can you do?
2025-04-28 17:32:47 -04:00
NepDisk
5d3be6db81 Allow clutching in kickstart accel 2025-04-28 15:24:56 -04:00
NepDisk
36f324db2a [PATCH] Fix palette mismatch crash
Out of bounds writing is cool eh? Thanks alug!
2025-04-28 15:18:25 -04:00
NepDisk
1c22f3870b Fix gaining rings on respawn when roulette is active 2025-04-27 10:14:04 -04:00
James R
ea32b85587 Kill mine when running into it during explosion state
Fixes punting a mine if you run straight into it while
invincible.
2025-04-26 23:11:37 -04:00
NepDisk
b3922d1316 Merge pull request 'Make bots drift' (#47) from Anonimus/blankart:dobotsdrift into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/47
2025-04-27 02:43:45 +00:00
NepDisk
e5386110d3 Merge pull request 'Use xxhash for file hashing instead of md5' (#48) from xxhash into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/48
2025-04-26 21:54:15 +00:00
NepDisk
b1268b7a52 Why Does this use args2 2025-04-26 08:44:19 -04:00
NepDisk
a1e4263429 Revert 'Polyobject transparency issuse quote on quote fix'
This reverts commit 500c5a4609.
2025-04-26 08:25:19 -04:00
GenericHeroGuy
4e9ffdaf13 Scrub more references to MD5 2025-04-26 00:57:51 +02:00
GenericHeroGuy
b7f4effe9b Replace MD5 with xxHash for file hashing
Yes, I had to do everything in one sweep, everything's connected...
Incremented demoversion since this changes the header format
2025-04-26 00:25:23 +02:00
Anonimus
eb1e914231 Use generic distancing for the radius check 2025-04-25 16:21:57 -04:00
Anonimus
360653e68d Split botvar and cmd handling for drifts 2025-04-25 16:21:57 -04:00
Anonimus
00470714c0 Make bots drift 2025-04-25 16:21:57 -04:00
NepDisk
dba4448645 Fix bots using the wrong speed value in precentage 2025-04-25 15:17:08 -04:00
GenericHeroGuy
0466d767f6 xxHash 0.8.3 2025-04-25 17:46:40 +02:00
GenericHeroGuy
544409090b Fix file extensions on the license files
Thank you CMake for pointing out this grave mistake
2025-04-25 16:59:06 +02:00
NepDisk
d56a5188d1 Fix item usage during respawn and buff flame shield slightly 2025-04-24 17:47:13 -04:00
AJ Martinez
5b4d571310 Update more third-party licenses 2025-04-24 23:34:28 +02:00
NepDisk
d563ca62e3 Update licenses 2025-04-24 17:17:25 -04:00
NepDisk
6ee27d76de Fix up and remove some objects 2025-04-24 16:07:37 -04:00
295 changed files with 15715 additions and 57825 deletions

View file

@ -1,6 +0,0 @@
# Build both the native piece of SRB2 for Android, and the Java frontend.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
include $(call all-makefiles-under,$(LOCAL_PATH))

View file

@ -72,6 +72,7 @@ cmake_dependent_option(
OFF
)
option(SRB2_CONFIG_ENABLE_DISCORDRPC "Enable Discord RPC features" ON)
option(SRB2_CONFIG_STATIC_STDLIB "Link static version of standard library. All dependencies must also be static" ON)
option(SRB2_CONFIG_HWRENDER "Enable hardware render (OpenGL) support" ON)
option(SRB2_CONFIG_STATIC_OPENGL "Enable static linking GL (do not do this)" OFF)
option(SRB2_CONFIG_ERRORMODE "Compile C code with warnings treated as errors." OFF)

View file

@ -17,6 +17,19 @@
Copyright (c) 2010, The WebM Project authors. All rights reserved.
All rights reserved.
https://chromium.googlesource.com/webm/libvpx
- libvorbis + libvorbisenc
Copyright (c) 2002-2020 Xiph.org Foundation
https://github.com/xiph/vorbis
- Tracy
Copyright (c) 2017-2025, Bartosz Taudul <wolf@nereid.pl>
All rights reserved.
https://github.com/wolfpld/tracy
- OpenMPT
Copyright (c) 2004-2025, OpenMPT Project Developers and Contributors
Copyright (c) 1997-2003, Olivier Lapicque
All rights reserved.
https://source.openmpt.org/
--------------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -42,6 +55,55 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
2-Clause BSD License
applies to:
- xxHash Library
Copyright (c) 2012-2021 Yann Collet
All rights reserved.
--------------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
0-Clause BSD License
applies to:
- qs22j
Copyright (c) 2022, Raymond Gardner
https://github.com/raygard/qsort_dev
--------------------------------------------------------------------------------
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--------------------------------------------------------------------------------
curl License
applies to:
@ -843,6 +905,10 @@ Public License instead of this License. But first, please read
- libxmp
https://github.com/libxmp/libxmp/blob/master/docs/CREDITS
https://github.com/libxmp/libxmp
- ACSVM
https://github.com/DavidPH/ACSVM
--------------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
@ -1603,6 +1669,9 @@ freely, subject to the following restrictions:
- imgui
Copyright (c) 2014-2023 Omar Cornut
https://github.com/ocornut/imgui
- stb_vorbis + stb_rect_pack
Copyright (c) 2017 Sean Barrett
https://github.com/nothings/stb
--------------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
@ -1653,3 +1722,9 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------------------------
In addition to the above, we make use of the following public-domain software:
* glad - https://github.com/Dav1dde/glad

View file

@ -1,6 +1,33 @@
# SRB2Kart
# BlanKart
[SRB2Kart](https://srb2.org/mods/) is a kart racing mod based on the 3D Sonic the Hedgehog fangame [Sonic Robo Blast 2](https://srb2.org/), based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/).
BlanKart is a modification of SRB2Kart v2 Indev to make it closer to SRB2Kart gameplay while adding new features, and techincal improvements.
# Notice
This is still in active development and things are going to change. If you find any bugs besure to report to the [issue tracker](https://codeberg.org/NepDisk/blankart/issues)!
## Techincal Features
- Full Support for UDMF, Terrain, Bots, ACS, New Waypoints and many other technical features backported from Ring Racers. Also includes some extensions to these features such as bot drifting, new terrain effects and map header toggles.
- Ring Racers' software renderer and its multithreading.
- Backwards compatiblity with most SRB2Kart maps, assets* and scripts\*.
- A map patching system to allow custom map things to be patched onto maps. Useful for adding rings, waypoints and other objects to existing maps.
- Support for many SRB2Kart v1 custom client extensions from Saturn and other clients such as vote themes.
- A hardcoded Lua library for adding custom boosts and boost chains to the game.
*Art assets are remapped from the SRB2Kart v1 palette to the SRB2 2.2 palette automatically based on addon file name. This also affects scripts as well making them run as they would in SRB2Kart v1. Having the K prefix or the .kart extension triggers this. You can also do addfile -c to enable it or addfile -n to disable it.
## Optional Features
- Colorized player hud
- Minimap Angle display
- Many features ported from Saturn
## Optional Gameplay Features
- Rings (Based on how they were in v2 Indev)
- New items (Such as the Flame Shield and the Bubble Shield)
- 4 tier drifts (Blue, Red, Purple, Rainbow)
- Boost Stacking
- Boost Chaining
- Slipdashing
## Dependencies
- SDL2 (Linux/OS X only)
@ -27,11 +54,17 @@ git clone https://codeberg.org/NepDisk/blankart.git
cd blankart
mkdir build
cd build
cmake -G "MSYS Makefiles" ..ƒƒ
./_deps/sdl2_mixer-src/external/download.sh
cmake -G "MSYS Makefiles" ..ƒƒ
cmake -G "MSYS Makefiles" ..
make -j$(nproc)
```
## Disclaimer
Kart Krew is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2.
## How to install
- Obtain an executable
- Grab the assets from the [blankart-assets repo](https://codeberg.org/NepDisk/blankart-assets)
- Compile the pk3s by running buildall.bat on windows or buildall.sh on *nix.
- Copy the generated pk3s from the folder `out/` and your compiled executable into a folder with the [SRB2Kart 1.6 assets](https://github.com/STJr/Kart-Public/releases/download/v1.6/AssetsLinuxOnly.zip) (such as an existing install).
# Disclaimer
BlanKart is in no way affiliated with Kart Krew Dev or Sonic Team Jr. This is just a project meant for fun. If you have any issues report to us not them.
We also do not claim ownership of any of SEGA's intellectual property used in BlanKart.

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SRB2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,5 +0,0 @@
#Mon Nov 09 14:38:16 EST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

View file

@ -1,17 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := user
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := SRB2
LOCAL_CERTIFICATE := media
LOCAL_REQUIRED_MODULES := libsrb2
LOCAL_JNI_SHARED_LIBRARIES := libsrb2
include $(BUILD_PACKAGE)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.srb2"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".SRB2Game"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>

View file

@ -1,13 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-4
# Indicates whether an apk should be generated for each density.
split.density=false

View file

@ -1,26 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package org.srb2;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int SoftwareRendererDisplay=0x7f050000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<SurfaceView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/SoftwareRendererDisplay"></SurfaceView>
</LinearLayout>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, SRB2Game!</string>
<string name="app_name">SRB2</string>
</resources>

View file

@ -1,25 +0,0 @@
package org.srb2;
import org.srb2.nativecode.SRB2;
import android.graphics.Canvas;
import android.util.Log;
import android.view.SurfaceHolder;
public class GameThread extends Thread {
public static String TAG = "SRB2-GameThread";
private SurfaceHolder sh;
private SRB2 srb2;
public GameThread(SurfaceHolder h) {
super();
this.srb2 = new SRB2(h);
this.sh = h;
}
@Override
public void run() {
Log.d(TAG, "Starting thread!");
this.srb2.run();
}
}

View file

@ -1,39 +0,0 @@
package org.srb2;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.SurfaceHolder.Callback;
import android.app.Activity;
import android.os.Bundle;
public class SRB2Game extends Activity implements Callback {
public static String TAG = "SRB2-Activity";
private SurfaceView sv;
private GameThread thread;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
sv = (SurfaceView) findViewById(R.id.SoftwareRendererDisplay);
sv.getHolder().addCallback(this);
}
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
Log.e(TAG, "Output surface changed? OHSHI-");
}
public void surfaceCreated(SurfaceHolder arg0) {
Log.d(TAG, "Output surface ready! Instantiating and starting game...");
thread = new GameThread(sv.getHolder());
thread.start();
}
public void surfaceDestroyed(SurfaceHolder arg0) {
// TODO shutdown SRB2 as cleanly as possible.
}
}

View file

@ -1,13 +0,0 @@
package org.srb2.nativecode;
import java.nio.ByteBuffer;
public class Main {
private SRB2 srb2;
public Main(SRB2 srb2) {
this.srb2 = srb2;
}
public native int main(Video v);
}

View file

@ -1,35 +0,0 @@
package org.srb2.nativecode;
import android.util.Log;
import android.view.SurfaceHolder;
/// Wraps the entire native game. This object should be wholly owned
/// by the thread it's going to run in.
public class SRB2 {
public static String TAG = "SRB2-Wrapper";
private Main main;
public Video video;
public SRB2(SurfaceHolder videoOut) {
try {
Log.i(TAG, "Loading native SRB2 shared object from package...");
System.load("/data/data/org.srb2/lib/libsrb2.so");
} catch (UnsatisfiedLinkError ule) {
Log.i(TAG, "... it doesn't appear to be installed in the package. Looking for native library in the global search path.");
try {
System.load("libsrb2.so");
} catch (UnsatisfiedLinkError ule2) {
Log.e("JNI", "... no luck. Could not load libsrb2.so!");
return;
}
}
this.video = new Video(this, videoOut);
this.main = new Main(this);
}
public void run() {
this.main.main(this.video);
}
}

View file

@ -1,39 +0,0 @@
package org.srb2.nativecode;
import java.nio.ByteBuffer;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.view.SurfaceHolder;
public class Video {
public static int width = 340;
public static int height = 240;
private SurfaceHolder sh;
public ByteBuffer fb;
public Bitmap bmp;
public Video(SRB2 srb2, SurfaceHolder sh) {
this.sh = sh;
fb = ByteBuffer.allocateDirect(fbSize());
bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
}
private int fbSize() {
// naively assuming RGBA8888 now, even though that is entirely wrong.
// ... well, at least, that's what the Canvas/Bitmap will expect.
return width * height * 4;
}
public void gotFrame() {
Canvas canvas = sh.lockCanvas();
canvas.drawARGB(0xff, 0, 0, 0);
// ugh, an extra copy. the only way to avoid this, I suppose,
// is to use the surface in native code directly.
bmp.copyPixelsFromBuffer(fb);
canvas.drawBitmap(bmp, 0, 0, null);
sh.unlockCanvasAndPost(canvas);
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
../LICENSE-3RD-PARTY

View file

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

1
assets/LICENSE.txt Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

File diff suppressed because it is too large Load diff

View file

@ -1,382 +0,0 @@
###############################################################################
GDCC ACS Language Extensions
###############################################################################
===============================================================================
Lexical Elements
===============================================================================
===========================================================
Punctuators
===========================================================
Syntax:
punctuator: add one of
. ... ##
===========================================================
Keywords
===========================================================
Syntax:
keyword: add
<enum>
<fixed>
<float>
<sizeof>
<struct>
===============================================================================
Expressions
===============================================================================
===========================================================
Suffix Expressions
===========================================================
Syntax:
suffix-expression: add
suffix-expression . identifier
===========================================================
Prefix Expressions
===========================================================
Syntax:
prefix-expression: add
<sizeof> ( type-name )
<sizeof> prefix-expression
print-expression: add
print-identifier ( print-specifier-string print-argument-list(opt) )
print-specifier-string:
string-literal
string-literal , print-specifier-argument-list
print-specifier-argument-list:
print-specifier-argument
print-specifier-argument-list , print-specifier-argument
-----------------------------------------------------------
Print Expressions
-----------------------------------------------------------
Semantics:
A print expression using a print specifier string uses a string literal to
describe print specifiers. Within the string, a sequence beginning with a
percent (%) and ending with a colon (:) is a print specifier using the same
names as a print specifier list. All other sequences are taken as literal
characters to print.
===========================================================
Cast Expressions
===========================================================
Syntax:
cast-expression: add
( type ) cast-expression
===============================================================================
Declarations
===============================================================================
Syntax:
external-declaration: add
enumeration-declaration
print-declaration
structure-declaration
===========================================================
Function Declarations
===========================================================
Syntax:
function-declaration: add
<function> declaration-specifiers identifier ( parameter-type-list )
identifier-sequence(opt) ;
<function> declaration-specifiers identifier ( parameter-type-list )
identifier-sequence compound-statement
parameter-type-list: add
parameter-list , ...
identifier-sequence:
identifier identifier-sequence(opt)
===========================================================
Script Declarations
===========================================================
Syntax:
script-declaration: add
<script> script-address script-parameters(opt) identifier-sequence(opt)
compound-statement
===========================================================
Special Declarations
===========================================================
Syntax:
special-item: add
type-name special-address identifier ( special-parameters )
special-address: add
{ special-address-value } :
{ special-address-value , special-address-value } :
special-address-value: add
string-literal
special-parameters: add
integer-literal , parameter-type-list
parameter-type-list
===========================================================
Object Declarations
===========================================================
Syntax:
declaration-specifiers: add
type-qualifier declaration-specifiers(opt)
type-qualifier:
<const>
type-specifier: add
<fixed>
<float>
direct-declarator: add
( declarator )
===========================================================
CreateTranslation Declarations
===========================================================
Syntax:
create-translation-declaration:
<createtranslation> identifier ( create-translation-property-list ) ;
create-translation-property-list:
create-translation-property
create-translation-property-list , create-translation-property
create-translation-property:
create-translation-property-prefix(opt) ( create-translation-property-name
) : constant-expression
create-translation-property-prefix:
%
create-translation-property-name:
identifier
constant-expression : constant-expression = constant-expression :
constant-expression
===========================================================
Enumeration Declarations
===========================================================
Syntax:
enumeration-declaration:
<enum> identifier(opt) { enumeration-member-declaration-list }
<enum> identifier(opt) { enumeration-member-declaration-list , }
enumeration-member-declaration-list:
enumeration-member-declaration
enumeration-member-declaration-list , enumeration-member-declaration
enumeration-member-declaration:
identifier
identifier = constant-expression
===========================================================
Print Declarations
===========================================================
Syntax:
print-declaration:
<print> identifier ( print-property-list ) ;
print-property-list:
print-property
print-property-list , print-property
print-property:
identifier : constant-expression
identifier(opt) ( identifier ) : constant-expression
===========================================================
Structure Declarations
===========================================================
Syntax:
structure-declaration:
<struct> identifier { structure-member-declaration-sequence }
<struct> identifier ;
structure-member-declaration-sequence:
structure-member-declaration
structure-member-declaration-sequence structure-member-declaration
structure-member-declaration:
specifier-qualifier-sequence structure-member-declarator-list ;
specifier-qualifier-sequence:
type-specifier specifier-qualifier-sequence(opt)
type-qualifier specifier-qualifier-sequence(opt)
structure-member-declarator-list:
structure-member-declarator
structure-member-declarator-list , structure-member-declarator
structure-member-declarator:
declarator
===============================================================================
Preprocessor Directives
===============================================================================
Syntax:
preprocessing-line: add
if-section
if-section:
if-line elif-line-sequence(opt) else-line(opt) endif-line
if-line:
# <if> constant-expression new-line preprocessing-line-sequence(opt)
# <ifdef> identifier new-line preprocessing-line-sequence(opt)
# <ifndef> identifier new-line preprocessing-line-sequence(opt)
elif-line-sequence:
elif-line
elif-line-sequence elif-line
elif-line:
# <elif> constant-expression new-line preprocessing-line-sequence(opt)
else-line:
# <else> new-line preprocessing-line-sequence(opt)
endif-line:
# <endif> new-line
control-line: add
# define-name identifier lparen identifier-list(opt) )
preprocessing-token-sequence(opt)new-line
# define-name identifier lparen ... ) preprocessing-token-sequence(opt)
new-line
# define-name identifier lparen identifier-list , ... )
preprocessing-token-sequence(opt) new-line
# <pragma> preprocessing-token-sequence new-line
# <undef> identifier new-line
# new-line
identifier-list:
identifier
identifier-list , identifier
===========================================================
Conditional Inclusion
===========================================================
===========================================================
Macro Replacement
===========================================================
===========================================================
Pragma Directives
===========================================================
-----------------------------------------------------------
block_scope
-----------------------------------------------------------
Syntax:
# <pragma> <block_scope> on-off-switch
Semantics:
When not in effect, block scope object declarations are visible at function
scope.
When in effect, block scope object declarations are block scoped.
Follows the same scoping rules as STDC pragmas. The default state is OFF.
-----------------------------------------------------------
define raw
-----------------------------------------------------------
Syntax:
# <pragma> <define> <raw> on-off-switch
Semantics:
When not in effect, object-like macro definitions are preprocessed and
altered to make them act like a primary-expression rather than simple token
substitution.
When in effect, object-like macro definitions are taken as-is as in C.
Follows the same scoping rules as STDC pragmas. The default state is OFF.
-----------------------------------------------------------
fixed
-----------------------------------------------------------
Syntax:
# <pragma> <fixed> on-off-switch
Semantics:
Equivalent to setting both the fixed_literal and fixed_type pragmas to the
specified state.
-----------------------------------------------------------
fixed_literal
-----------------------------------------------------------
Syntax:
# <pragma> <fixed_literal> on-off-switch
Semantics:
When in effect, fixed-point literals have fixed type.
When not in effect, fixed-point literals have int type.
Follows the same scoping rules as STDC pragmas. The default state is OFF.
-----------------------------------------------------------
fixed_type
-----------------------------------------------------------
Syntax:
# <pragma> <fixed_type> on-off-switch
Semantics:
When in effect, the fixed keyword indicates a fixed-point type.
When not in effect, the fixed keyword is a synonym for int.
Follows the same scoping rules as STDC pragmas. The default state is OFF.
-----------------------------------------------------------
state
-----------------------------------------------------------
Syntax:
# <pragma> <state> <save>
# <pragma> <state> <restore>
Semantics:
Saves or restores the pragma state, as though entering or leaving a compound
statement, respectively.
###############################################################################
Grammar
###############################################################################
###############################################################################
EOF
###############################################################################

View file

@ -1,818 +0,0 @@
###############################################################################
ACS Language Specification
###############################################################################
This is an unofficial specification of the ACS language implemented by various
versions of acc.
Where not stated otherwise, semantics should be assumed to be equivalent to C.
Due to lack of an official standard, gdcc-acc is implemented to this document.
In addition, gdcc-acc implements the extensions documented in ACS-ext.txt.
This document is incomplete and potentially inaccurate. Some liberties have
been taken in the exact grammar with respect to acc's implementation. An
attempt has been made to note where deviations occur, but there may be
unrealized errors. Comments and corrections are welcome.
===============================================================================
Lexical Elements
===============================================================================
Syntax:
preprocessing-token:
identifier
pp-number
character-literal
string-literal
punctuator
token:
identifier
keyword
literal
punctuator
===========================================================
Identifiers
===========================================================
Syntax:
identifier:
nondigit
identifier nondigit
identifier digit
nondigit: one of
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
_
digit: one of
0 1 2 3 4 5 6 7 8 9
Semantics:
Lowercase and uppercase letters are equivalent in identifiers and keywords.
===========================================================
Preprocessing Numbers
===========================================================
Syntax:
pp-number:
digit
. digit
pp-number digit
pp-number nondigit
pp-number .
===========================================================
Punctuators
===========================================================
Syntax:
punctuator: one of
[ ] ( ) { } ++ -- & * - ~ ! / % << >> < > <= >= == != ^ | && || ? : ; = *=
/= %= += -= >>= <<= &= ^= |= , #
===========================================================
Keywords
===========================================================
Syntax:
keyword:
<acs_executewait>
<acs_namedexecutewait>
<bluereturn>
<bool>
<break>
<case>
<clientside>
<const>
<continue>
<createtranslation>
<death>
<default>
<disconnect>
<do>
<else>
<enter>
<event>
<for>
<function>
<global>
<goto>
<hudmessage>
<hudmessagebold>
<if>
<int>
<kill>
<lightning>
<log>
<net>
<open>
<pickup>
<print>
<printbold>
<redreturn>
<reopen>
<respawn>
<restart>
<return>
<script>
<special>
<static>
<str>
<strcpy>
<strparam>
<suspend>
<switch>
<terminate>
<unloading>
<until>
<void>
<while>
<whitereturn>
<world>
Semantics:
Keywords are identifiers with special meaning and/or usage. They shall not be
used except as described in this document.
===========================================================
Literals
===========================================================
Syntax:
literal:
character-literal
floating-literal
integer-literal
string-literal
-----------------------------------------------------------
Character Literals
-----------------------------------------------------------
Syntax:
character-literal:
' c-char-sequence '
c-char-sequence:
c-char
c-char-sequence c-char
c-char:
any member of the source character set except the single-quote, backslash,
or new-line character.
escape-sequence
escape-sequence:
simple-escape-sequence
octal-escape-sequence
hexadecimal-escape-sequence
simple-escape-sqeuence: one of
\' \" \\ \a \b \c \f \n \r \t \v
octal-escape-sequence:
\ octal-digit
\ octal-digit octal-digit
\ octal-digit octal-digit octal-digit
octal-digit: one of
0 1 2 3 4 5 6 7
hexadecimal-escape-sequence:
\x hexadecimal-digit
hexadecimal-escape-sequence hexadecimal-digit
hexadecimal-digit: one of
0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
-----------------------------------------------------------
Floating Literals
-----------------------------------------------------------
Syntax:
floating-literal:
decimal-floating-literal
decimal-floating-literal:
decimal-fractional-literal
decimal-fractional-literal:
digit-sequence(opt) . digit-sequence
digit-sequence .
digit-sequence:
digit
digit-sequence digit
-----------------------------------------------------------
Integer Literals
-----------------------------------------------------------
Syntax:
integer-literal:
decimal-integer-literal
hexadecimal-integer-literal
decimal-integer-literal:
digit
decimal-integer-literal digit
hexadecimal-integer-literal:
hexadecimal-prefix hexadecimal-digit
hexadecimal-integer-literal hexadecimal-digit
hexadecimal-prefix:
0X
0x
-----------------------------------------------------------
String Literals
-----------------------------------------------------------
Syntax:
string-literal:
" s-char-sequence(opt) "
s-char-sequence:
s-char
s-char-sequence s-char
s-char:
any member of the source character set except the double-quote, backslash,
or new-line character
escape-sequence
===============================================================================
Expressions
===============================================================================
===========================================================
Primary Expressions
===========================================================
Syntax:
primary-expression:
identifier
literal
( expression )
===========================================================
Suffix Expressions
===========================================================
Syntax:
suffix-expression:
primary-expression
suffix-expression [ expression ]
suffix-expression ( const-call-specifier(opt) expression-list(opt) )
suffix-expression ++
suffix-expression --
const-call-specifier:
<const> :
expression-list:
assignment-expression
expression-list , assignment-expression
===========================================================
Prefix Expressions
===========================================================
Syntax:
prefix-expression:
suffix-expression
create-translation-expression
print-expression
strcpy-expression
++ prefix-expression
-- prefix-expression
+ cast-expression
- cast-expression
~ cast-expression
! cast-expression
create-translation-expression:
<createtranslation> ( assignment-expression )
<createtranslation> ( assignment-expression , translation-list )
translation-list:
translation
translation-list , translation
translation:
conditional-expression : conditional-expression = translation-part
translation-part:
translation-palette
translation-rgb
translation-saturated
translation-palette:
conditional-expression : conditional-expression
translation-rgb:
translation-triple : translation-triple
translation-saturated:
% translation-triple : translation-triple
translation-triple:
[ conditional-expression , conditional-expression , conditional-expression ]
print-expression:
print-identifier ( print-specifier-list(opt) print-argument-list(opt) )
print-specifier-list:
print-specifier
print-specifier-list , print-specifier
print-specifier:
identifier : print-specifier-argument
print-sepcifier-argument:
( expression-list )
assignment-expression
print-argument-list:
; expression-list
strcpy-expression:
<strcpy> ( <a> : ( expression-list ) , assignment-expression )
<strcpy> ( <a> : ( expression-list ) , assignment-expression ,
assignment-expression )
<strcpy> ( <a> : assignment-expression , assignment-expression )
<strcpy> ( <a> : assignment-expression , assignment-expression ,
assignment-expression )
===========================================================
Cast Expressions
===========================================================
Syntax:
cast-expression:
prefix-expression
===========================================================
Multiplicative Expressions
===========================================================
Syntax:
multiplicative-expression:
cast-expression
multiplicative-expression * cast-expression
multiplicative-expression / cast-expression
multiplicative-expression % cast-expression
===========================================================
Additive Expressions
===========================================================
Syntax:
additive-expression:
multiplicative-expression
additive-expression + multiplicative-expression
additive-expression - multiplicative-expression
===========================================================
Shift Expressions
===========================================================
Syntax:
shift-expression:
additive-expression
shift-expression << additive-expression
shift-expression >> additive-expression
===========================================================
Relational Expressions
===========================================================
Syntax:
relational-expression:
shift-expression
relational-expression < shift-expression
relational-expression > shift-expression
relational-expression <= shift-expression
relational-expression >= shift-expression
===========================================================
Equality Expressions
===========================================================
Syntax:
equality-expression:
relational-expression
equality-expression == relational-expression
equality-expression != relational-expression
===========================================================
Bitwise AND Expressions
===========================================================
Syntax:
bitwise-and-expression:
equality-expression
bitwise-and-expression & equality-expression
===========================================================
Bitwise Exclusive OR Expressions
===========================================================
Syntax:
bitwise-xor-expression:
bitwise-and-expression
bitwise-xor-expression ^ bitwise-and-expression
===========================================================
Bitwise Inclusive OR Expressions
===========================================================
Syntax:
bitwise-ior-expression:
bitwise-xor-expression
bitwise-ior-expression | bitwise-xor-expression
===========================================================
Logical AND Expressions
===========================================================
Syntax:
logical-and-expression:
bitwise-ior-expression
logical-and-expression && bitwise-ior-expression
===========================================================
Logical Inclusive OR Expressions
===========================================================
Syntax:
logical-ior-expression:
logical-and-expression
logical-ior-expression || logical-and-expression
===========================================================
Conditional Expressions
===========================================================
Syntax:
conditional-expression:
logical-ior-expression
logical-ior-expression ? expression : conditional-expression
Notes:
The conditional operator is not implemented in acc.
===========================================================
Assignment Expressions
===========================================================
Syntax:
assignment-expression:
conditional-expression
conditional-expression assignment-operator assignment-expression
assignment-operator: one of
= *= /= %= += -= <<= >>= &= ^= |=
Notes:
In acc, The assignment expression can only be the full expression of an
expression statement.
===========================================================
Comma Expressions
===========================================================
Syntax:
expression:
assignment-expression
expression , assignment-expression
Notes:
The comma operator is not implemented in acc.
===========================================================
Constant Expressions
===========================================================
Syntax:
constant-expression:
conditional-expression
===============================================================================
Declarations
===============================================================================
Syntax:
external-declaration:
function-declaration
script-declaration
special-declaration
declaration
declaration:
object-declaration
===========================================================
Function Declarations
===========================================================
Syntax:
function-declaration:
<function> declaration-specifiers identifier ( parameter-type-list )
compound-statement
parameter-type-list:
parameter-list
parameter-list:
parameter-declaration
parameter-list , parameter-declaration
parameter-declaration:
declaration-specifiers declarator
===========================================================
Script Declarations
===========================================================
Syntax:
script-declaration:
<script> script-address script-parameters(opt) script-type
script-flag-sequence(opt) compound-statement
<script> script-address script-parameters script-flag-sequence(opt)
compound-statement
script-address:
integer-literal
string-literal
script-parameters:
( parameter-type-list )
script-type:
<bluereturn>
<death>
<disconnect>
<enter>
<event>
<lightning>
<open>
<pickup>
<redreturn>
<respawn>
<return>
<unloading>
<whitereturn>
script-flag-sequence:
script-flag script-flag-sequence(opt)
script-flag:
<clientside>
<net>
===========================================================
Special Declarations
===========================================================
Syntax:
special-declaration:
<special> special-list ;
special-list:
special-item
special-list , special-item
special-item:
special-address identifier ( special-parameters )
special-address:
special-address-value :
- special-address-value :
special-address-value:
integer-literal
special-parameters:
integer-literal
integer-literal , integer-literal
===========================================================
Object Declarations
===========================================================
Syntax:
object-declaration:
declaration-specifiers init-declarator-list ;
declaration-specifiers:
storage-class-specifier declaration-specifiers(opt)
type-specifier declaration-specifiers(opt)
storage-class-specifier:
<global>
<static>
<world>
type-specifier:
<bool>
<int>
<str>
<void>
init-declarator-list:
init-declarator
init-declarator-list , init-declarator
init-declarator:
declarator
declarator = initializer
declarator:
direct-declarator
direct-declarator:
object-address(opt) identifier
( declarator )
direct-declarator [ expression(opt) ]
object-address:
integer-literal :
===============================================================================
Statements
===============================================================================
Syntax:
statement:
labeled-statement
compound-statement
expression-statement
selection-statement
iteration-statement
jump-statement
===========================================================
Labeled Statements
===========================================================
Syntax:
labeled-statement:
<case> expression : statement
<default> : statement
===========================================================
Compound Statements
===========================================================
Syntax:
compound-statement:
{ block-item-list(opt) }
block-item-list:
block-item
block-item-list block-item
block-item:
declaration
statement
===========================================================
Expression Statements
===========================================================
Syntax:
expression-statement:
expression(opt) ;
===========================================================
Selection Statements
===========================================================
Syntax:
selection-statement:
<if> ( expression ) statement
<if> ( expression ) statement <else> statement
<switch> ( expression ) statement
===========================================================
Iteration Statements
===========================================================
Syntax:
iteration-statement:
<while> ( expression ) statement
<until> ( expression ) statement
<do> statement <while> ( expression ) ;
<do> statement <until> ( expression ) ;
<for> ( expression(opt) ; expression(opt) ; expression(opt) ) statement
<for> ( declaration expression(opt) ; expression(opt) ) statement
===========================================================
Jump Statements
===========================================================
Syntax:
jump-statement:
<continue> ;
<break> ;
<return> expression(opt) ;
<restart> ;
<terminate> ;
===============================================================================
Preprocessing Directives
===============================================================================
Syntax:
preprocessing-file:
preprocessing-line-sequence(opt)
preprocessing-line-sequence:
preprocessing-line
preprocessing-line-sequence preprocessing-line
preprocessing-line:
control-line
text-line
control-line:
# define-name identifier preprocessing-token-sequence(opt) new-line
# <import> string-literal new-line
# <include> string-literal new-line
# <library> string-literal new-line
define-name:
<define>
<libdefine>
text-line:
preprocessing-token-sequence(opt) new-line
preprocessing-token-sequence
preprocessing-token
preprocessing-token-sequence preprocessing-token
===========================================================
Source File Inclusion
===========================================================
Semantics:
Except when importing, a preprocessing directive of the form
# <include> string-literal new-line
causes the replacement of that directive by the entire contents of the source
file identified by the string literal.
Except when importing, a preprocessing directive of the form
# <import> string-literal new-line
causes the identified file to be processed for declarations.
Both forms have no effect while importing.
===========================================================
Macro Replacement
===========================================================
Semantics:
A preprocessing directive of the form
# define-name identifier preprocessing-token-sequence new-line
defines a macro as in C, except that an implementation may require the
preprocessing token sequence to be in the form of a constant expression to be
evaluated immediately.
When the define name is define and used when importing, the macro is removed
at the end of the file.
If a macro is defined with one define name and then later redefined using a
different define name the behavior is undefined.
Notes:
In acc, macro definitions result in named constants rather than token
substitution. In gdcc-acc, it uses token substitution with implicitly added
tokens to make the sequence a primary expression.
===========================================================
Library Directive
===========================================================
Semantics:
When importing, a directive of the form
# <library> string-literal new-line
identifies a library to link with at runtime.
The directive has no effect when not importing.
###############################################################################
Grammar
###############################################################################
###############################################################################
EOF
###############################################################################

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

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

View file

@ -1,502 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

File diff suppressed because it is too large Load diff

View file

@ -1,168 +0,0 @@
//-----------------------------------------------------------------------------
//
// Example ACS code for GDCC.
//
//-----------------------------------------------------------------------------
// This include may be needed even when acc would compile without it, as GDCC
// does not implicitly declare any ACS functions.
#include "zcommon.acs"
// Global and world arrays can be given dimensions and initializers.
global int 7:SomeGlobalArray[2][5] = {{1, 1, 2, 3, 5}, {8, 13, 21, 34, 55}};
// GDCC's ACS supports enumeration declarations. The syntax is as in C, except
// that it is not a type specifier and therefore no terminating semicolon is
// required. The contained names are available as constants of type int.
enum SomeEnum
{
FIRST,
SECOND = 5,
THIRD, // A trailing comma is allowed, as in C.
}
// The name of the enumeration becomes a type name, which behaves like an int.
SomeEnum EnumMapVar = THIRD;
// GDCC's ACS supports structure declarations. The syntax is mostly the same as
// in C, except that it is not a type specifier and therefore no terminating
// semicolon is required.
struct SomeStruct
{
// Members are declared like variables.
int i;
// Strings and integers can be mixed in structures.
str s;
// Members can be arrays. Structure types with array members can only have
// their array members accessed if they are themselves stored in an array.
int a[4];
}
// The name of the structure becomes an ordinary type name, usable wherever one
// would use int or str.
SomeStruct StructMapArray[13];
// Functions can return structure types.
function SomeStruct StructRetFunc(int n)
{
// Structure initialization syntax as in C.
SomeStruct localStruct = {n * 3, "FOO", {89, 144, 233, 377}};
// And of course the members can be assigned directly.
localStruct.i = n % 4;
localStruct.s = "BAR";
// The previous note about array member access has one exception, and that
// is when the index is a constant.
localStruct.a[1] = localStruct.a[3] - localStruct.a[2];
// This would produce an error.
//localStruct.a[localStruct.i] = 55;
// But this is allowed.
SomeStuct arrayStruct[1];
arrayStruct[0].a[localStruct.i] = 55;
// Returning a structure works normally.
return localStruct;
}
// Functions can also take structure types as parameters.
function str StructParamFunc(SomeStruct ss)
{
// The ternary operator can be used to simplify cetain conditional code.
return ss.n > 0 ? ss.s : "ELSE";
}
// This function demonstrates use of the fixed type.
function void FixedFunc(void)
{
// To enable the fixed type and make fixed-point literals have fixed type, a
// pragma is needed. If used inside of a function like this, it will apply
// only inside the function. If used outside any function, it applies to the
// entire file after its use.
#pragma fixed on
// Variables with fixed type are declared as normal. Without the effect of
// the pragma, fixed is an alias for int.
fixed x;
// Similarly, without the pragma, fixed-point literals have int type.
x = 12.5;
// This will result in y being set to 6.25, as the use of FixedMul is
// implied by the fixed type.
fixed y = x * 0.5;
// And this will result in i being set to 6, the type conversion being
// performed implicitly.
int i = y;
// Similarly, this will result in x being set to 6.0.
x = i;
// When mixing int and fixed in an expression, the int expression will be
// converted to fixed type for the operation.
x = y + i; // x = 12.25
// Type conversion can be performed explicitly using the C type cast syntax.
y = (fixed)i / 8; // y = 0.75
// Without using the fixed pragma before including zcommon.acs, it is not
// possible to print actual fixed values. Attempting to do so will result in
// the value being converted and misinterpreted.
//Log(s: "A fixed number: ", f: x);
}
// In GDCC's ACS, it is not possible to forward reference functions. So if a
// function needs to be referred to prior to its definition, a forward
// declaration is needed.
function void StructPrinter(SomeStruct ss);
// It is possible in GDCC to declare extended print functions.
print CoolPrint
(
// This defines which function to call to start the print.
(begin): BeginPrint,
// And this defines which function to call to end the print. If this
// function returns a value, that value will be the result of the print.
(end): EndPrint,
// This is a macro in <zspecial.acs> which includes all the normal print
// specifiers. If none of them are desired, this can be omitted.
ACS_PrintPropertyBase(),
// Now to add our cool new print specifier.
ss: StructPrinter
// Note that the final specifier does not get a comma after it.
);
// Simple usage demonstration.
function void PrintSomeStructs(SomeStruct ss1, SomeStruct ss2)
{
// Such declared print functions are used exactly like the standard ones.
CoolPrint(s: "ss1: ", ss: ss1, s: "; ss2: ", ss: ss2);
}
// Do not forget to actually define forward declared functions. It can be
// defined in another source file, or even an imported bytecode module, but if
// a definition is not found, calls to the function will cause script
// termination or worse.
function void StructPrinter(SomeStruct ss)
{
// When writing a custom print routine, you do not want to invoke a separate
// print, so PrintRaw is used instead.
PrintRaw(i: ss.i, c: ':', s: ss.s);
}
// EOF

View file

@ -1,171 +0,0 @@
//-----------------------------------------------------------------------------
//
// Example C code for GDCC.
//
//-----------------------------------------------------------------------------
// Any project targeting ZDoom or other ZDACS-enabled engines will almost
// certainly need to include this, as it includes declarations for functions
// that acc declares implicitly.
#include <ACS_ZDoom.h>
#include <limits.h>
#include <stddef.h>
#include <stdfix.h>
#include <stdio.h>
// This declaration makes the DoAction function visible before its definition.
// It can also be used in other source files (usually by including a header
// file) to access functions and objects in other files.
void DoAction(void);
// This forward declares an address space.
__addrdef extern __map_arr map_var;
// And this forward declares an object in that address space.
extern int map_var MapInt;
// This declares and defines a map array address space. The name map_var is
// used as a type qualifier and all objects declared with a type qualified with
// it will be stored in the same underlying map array.
__addrdef __map_arr map_var;
// Declares and defines an int object in the map_var address space.
int map_var MapInt;
// Similarly, but for an array.
unsigned int map_var MapIntArr[16];
// If no address space is specified, objects declared at file-scope use the
// generic address space, which is implemented as a global array.
int IntVar;
// The typedef declaration can be used to give a type a new name, either for
// abstraction or convenience of typing. The declared name is identical to the
// underlying type, and either can be substituted for the other.
typedef int map_var map_int;
// This forward declaration of MapInt is equivalent to and compatible with the
// previous. Also worth noting that forward declarations can appear after the
// definition without error.
extern map_int MapInt;
// [[call("ScriptS")]] makes this function a named script.
// [[script("Open")]] gives it the OPEN type, making it an entry-point.
// By default, the name used will be the "mangled" name of the function. If the
// script needs to be referred to from outside GDCC, then [[extern("ACS")]]
// will make the mangled name the same as the declared name. Alternatively,
// [[address("Name Goes Here")]] will explicitly specify a name.
[[call("ScriptS"), script("Open")]]
void MainFunc(void)
{
while(1)
{
DoAction();
// ACS function names are prefixed to avoid name conflicts.
ACS_Delay(ACS_Random(35, 70));
}
}
// [[call("ScriptI")]] makes this function a numbered script. Its number will
// be automatically allocated. If a specific number is desired, then
// [[address(42)]] can be used with 42 replaced by the desired number.
// Automatically allocated numbers will avoid such explicit allocations.
[[call("ScriptI")]]
int CalcValue(void)
{
// This declares a local pointer object. The pointer itself is stored as a
// local variable, but the unsigned int objects that it accesses are stored
// as map_var. Pointer declarators are best read right-to-left.
unsigned int map_var *mapIntPtr;
// Store the address of an element of MapIntArr in mapIntPtr.
mapIntPtr = &MapIntArr[ACS_Timer() & 15];
// Do stuff with the referenced element.
*mapIntPtr += ACS_Timer() * *mapIntPtr;
// Being functions, scripts return values and are terminated using the
// return statement.
return *mapIntPtr & INT_MAX;
}
void DoAction(void)
{
// Being functions, scripts can be called like functions.
int val = CalcValue();
// An ACS string variable.
__str msg = NULL;
if(val == 42)
{
// ACS string literals have an s prefixed to them. Otherwise, it is a C
// string, which is addressed differently.
msg = s"Enjoying yourself?";
}
if(msg)
{
// This is used to initialize the native print buffer for a single print.
ACS_BeginPrint();
// __nprintf performs formatting the same as printf, but the output is
// sent to the native print buffer. The format string must be a C string.
// %S is used to print ACS strings.
__nprintf("George says, \"%S\"", msg);
// This prints the native print buffer to the screen as in ACS's Print.
ACS_EndPrint();
}
else
{
// This is equivalent to a Log call in ACS. Note the trailing linefeed.
// The buffer used by printf is only written when a linefeed is used.
printf("Nothing to say, move along.\n");
}
}
// This function demonstrates basic usage of floating and fixed point types.
void FloatVsFixed(void)
{
// GDCC supports single and double precision floating point.
float f;
double lf;
// The name accum is the canonical name for fixed-point (from Embedded C,
// short for accumulator), however stdfix.h also defines fixed.
accum k;
fixed x;
// The long accum type is an extended type with 1 sign bit, 31 integer bits,
// and 32 fractional bits. It can be used for calculations needing some
// extra intermediary precision.
long accum lk;
// Unsuffixed floating-point literals have type double. To give them accum
// type, use the k suffix.
f = 8.125f;
lf = 8.125;
k = 8.125k;
x = 8.125k;
lk = 8.125lk;
// Conversions between types is automatic, following normal C promotion
// rules.
lf = f * lf * k * x * lk;
lk = lf;
// Casts can also be explicit.
k = (accum)lf;
// Or using casts to improve intermediary precision. Note that type
// promotion causes both operations to be done as type double.
k = (double)k * x / 10;
}
// EOF

File diff suppressed because it is too large Load diff

View file

@ -1,31 +0,0 @@
###############################################################################
Software Floating Point Implementation Notes
###############################################################################
Big thanks to MageofMystra for providing a C implementation from which to base.
And for his ongoing assistance with mathematics questions.
For targets that do not have native support for floating-point operations, GDCC
will emulate them. Where possible and reasonably efficient, the implementation
follows the IEEE-754 standard.
===============================================================================
ZDoom ACS
===============================================================================
Supports both single and double precision formats.
Subnormal numbers are not supported and are never generated. Other special
exponent values (infinity, signed zero, NaN) are supported.
NaNs are supported, but may not be detected unless at least one mantissa bit in
the highest word is set. Generated NaNs always meet this requirement.
Rounding mode is always truncation.
Exceptions are not recorded and all NaNs are quiet.
###############################################################################
EOF
###############################################################################

Binary file not shown.

View file

@ -1,16 +0,0 @@
compilers
{
// This defines what files a compiler uses
// The setting named "program" defines what .exe to run
// The "interface" setting defines what interal interface to use for processing and error feedback
// All others are the required files (the setting names do not matter)
gdcc-acc-blan
{
interface = "AccCompiler";
program = "gdcc-acc.exe";
zcommon = "bkcommon.acs";
zdefs = "bkdefs.acs";
zspecial = "bkspecial.acs";
}
}

View file

@ -1,26 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015 David Hill
// Copyright(C) 2022 Sally Cochenour
// Copyright(C) 2025 NepDisk
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Defines for BlanKart's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__ACS__bkcommon_acs__
#define __GDCC_Header__ACS__bkcommon_acs__
#pragma fixed ON
#include "bkspecial.acs"
#include "bkdefs.acs"
#endif//__GDCC_Header__ACS__bkcommon_acs__

View file

@ -1,706 +0,0 @@
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Defines for BlanKart ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__ACS__bkdefs_acs__
#define __GDCC_Header__ACS__bkdefs_acs__
//----------------------------------------------------------------------------|
// Macros |
//
#define TRUE (1)
#define FALSE (0)
#define ON (1)
#define OFF (0)
#define YES (1)
#define NO (0)
#define TICRATE (35)
#define FRACBITS (16)
#define FRACUNIT (1 << FRACBITS)
#define MAXPLAYERS (16)
#define MAXBOTDIFFICULTY (13)
#define TAG_ALL (65535)
enum
{
FLAG_NOCHANGE,
FLAG_ADD,
FLAG_REMOVE,
};
enum
{
PLANE_FLOOR,
PLANE_CEILING,
PLANE_BOTH,
};
enum
{
SIDE_ACTIVATOR = -1,
SIDE_FRONT,
SIDE_BACK,
SIDE_BOTH,
};
enum
{
TEXTURE_TOP,
TEXTURE_MIDDLE,
TEXTURE_BOTTOM,
};
enum
{
TAG_REPLACEFIRST,
TAG_ADD,
TAG_REMOVE,
};
enum
{
LIGHT_COPY_NOSECTOR = 1,
LIGHT_COPY_NOFLOOR = 1<<1,
LIGHT_COPY_NOCEILING = 1<<2,
};
enum
{
LIGHT_BLINK_USETARGET = 1,
LIGHT_BLINK_SYNC = 1<<1,
};
enum
{
LIGHT_FADE_RELATIVE = 1,
LIGHT_FADE_OVERRIDE = 1<<1,
LIGHT_FADE_TICBASED = 1<<2,
};
enum
{
LIGHT_AREA_SECTOR,
LIGHT_AREA_FLOOR,
LIGHT_AREA_CEILING,
};
enum
{
TELEPORT_SILENT = 1,
TELEPORT_KEEPANGLE = 1<<1,
TELEPORT_KEEPMOMENTUM = 1<<2,
TELEPORT_KEEPMOMENTUM = 1<<3,
};
enum
{
MUSIC_ALLPLAYERS = 1,
MUSIC_NOLOOP = 1<<1,
MUSIC_NOCREDIT = 1<<2,
MUSIC_NORELOAD = 1<<3,
MUSIC_FORCERESET = 1<<4,
MUSIC_OFFSET = 1<<5,
MUSIC_FADE = 1<<6,
};
enum
{
SFX_SOURCE_TRIGGERMOBJ,
SFX_SOURCE_TRIGGERSECTOR,
SFX_SOURCE_NOWHERE,
SFX_SOURCE_TAGGEDSECTOR,
};
enum
{
SFX_LISTEN_EVERYONE,
SFX_LISTEN_TRIGGERER,
SFX_LISTEN_TAGGEDSECTOR,
};
enum
{
CRUMBLE_NORETURN = 1,
CRUMBLE_CHECKFLAG = 1<<1,
};
enum
{
COLORMAP_RELATIVE = 1,
COLORMAP_SUBLIGHTR = 1<<1,
COLORMAP_SUBLIGHTG = 1<<2,
COLORMAP_SUBLIGHTB = 1<<3,
COLORMAP_SUBLIGHTA = 1<<4,
COLORMAP_SUBFADER = 1<<5,
COLORMAP_SUBFADEG = 1<<6,
COLORMAP_SUBFADEB = 1<<7,
COLORMAP_SUBFADEA = 1<<8,
COLORMAP_SUBFADESTART = 1<<9,
COLORMAP_SUBFADEEND = 1<<10,
COLORMAP_IGNOREFLAGS = 1<<11,
COLORMAP_FROMBLACK = 1<<12,
COLORMAP_OVERRIDE = 1<<13,
};
enum
{
SKYBOX_VIEWPOINT,
SKYBOX_CENTERPOINT,
SKYBOX_BOTH,
};
enum
{
ALPHA_SET_RELATIVE = 1,
ALPHA_SET_DONTDOTRANSLUCENT = 1<<1,
};
enum
{
ALPHA_FADE_RELATIVE = 1,
ALPHA_FADE_OVERRIDE = 1<<1,
ALPHA_FADE_TICBASED = 1<<2,
ALPHA_FADE_IGNORECOLLISION = 1<<3,
ALPHA_FADE_GHOSTFADE = 1<<4,
ALPHA_FADE_DONTDOTRANSLUCENT = 1<<5,
ALPHA_FADE_DONTDOEXISTS = 1<<6,
ALPHA_FADE_DONTDOLIGHTING = 1<<7,
ALPHA_FADE_DONTDOCOLORMAP = 1<<8,
ALPHA_FADE_USEEXACTALPHA = 1<<9,
};
enum
{
PROMPT_CLOSE = 1,
PROMPT_RUNPOSTEXEC = 1<<1,
PROMPT_CALLBYNAME = 1<<2,
PROMPT_KEEPCONTROLS = 1<<3,
PROMPT_KEEPREALTIME = 1<<4,
};
enum
{
PO_ROTATE_DONTROTATEOTHERS = 1,
PO_ROTATE_DONTROTATEPLAYERS = 1<<1,
PO_ROTATE_CONTINUOUS = 1<<2,
PO_ROTATE_OVERRIDE = 1<<3,
};
enum
{
PO_WP_RETURN_STOP,
PO_WP_RETURN_WRAP,
PO_WP_RETURN_COMEBACK,
};
enum
{
PO_WP_REVERSE = 1,
PO_WP_LOOP = 1<<1,
};
enum
{
PO_FADE_RELATIVE = 1,
PO_FADE_OVERRIDE = 1<<1,
PO_FADE_TICBASED = 1<<2,
PO_FADE_IGNORECOLLISION = 1<<3,
PO_FADE_GHOSTFADE = 1<<4,
};
enum
{
GAMESPEED_EASY,
GAMESPEED_NORMAL,
GAMESPEED_HARD,
};
enum
{
CAM_FOLLOW_FIRST = -1,
CAM_FOLLOW_SECOND = -2,
CAM_FOLLOW_THIRD = -3,
CAM_FOLLOW_CONSOLE = -4,
};
enum
{
BLEND_TRANSLUCENT,
BLEND_ADD,
BLEND_SUBTRACT,
BLEND_REVERSESUBTRACT,
BLEND_MODULATE,
BLEND_OVERLAY,
BLEND_FOG,
};
enum
{
LINE_PROP_FLAGS,
LINE_PROP_ALPHA,
LINE_PROP_BLENDMODE,
LINE_PROP_ACTIVATION,
LINE_PROP_ACTION,
LINE_PROP_ARG0,
LINE_PROP_ARG1,
LINE_PROP_ARG2,
LINE_PROP_ARG3,
LINE_PROP_ARG4,
LINE_PROP_ARG5,
LINE_PROP_ARG6,
LINE_PROP_ARG7,
LINE_PROP_ARG8,
LINE_PROP_ARG9,
LINE_PROP_ARG0STR,
LINE_PROP_ARG1STR,
LINE_PROP__MAX
};
enum
{
ML_IMPASSABLE = 0x00000001,
ML_BLOCKMONSTERS = 0x00000002,
ML_TWOSIDED = 0x00000004,
ML_DONTPEGTOP = 0x00000008,
ML_DONTPEGBOTTOM = 0x00000010,
ML_SKEWTD = 0x00000020,
ML_NOCLIMB = 0x00000040,
ML_NOSKEW = 0x00000080,
ML_MIDPEG = 0x00000100,
ML_MIDSOLID = 0x00000200,
ML_WRAPMIDTEX = 0x00000400,
ML_NETONLY = 0x00000800,
ML_NONET = 0x00001000,
ML_EFFECT6 = 0x00002000,
ML_NOTBOUNCY = 0x00004000,
ML_TFERLINE = 0x00008000,
};
enum
{
SPAC_REPEATSPECIAL = 0x00000001,
SPAC_CROSS = 0x00000002,
SPAC_CROSSMONSTER = 0x00000004,
SPAC_CROSSMISSILE = 0x00000008,
SPAC_PUSH = 0x00000010,
SPAC_PUSHMONSTER = 0x00000020,
SPAC_IMPACT = 0x00000040,
};
enum
{
SIDE_PROP_XOFFSET,
SIDE_PROP_YOFFSET,
SIDE_PROP_TOPTEXTURE,
SIDE_PROP_BOTTOMTEXTURE,
SIDE_PROP_MIDTEXTURE,
SIDE_PROP_REPEATCOUNT,
SIDE_PROP__MAX
};
enum
{
SECTOR_PROP_FLOORHEIGHT,
SECTOR_PROP_CEILINGHEIGHT,
SECTOR_PROP_FLOORPIC,
SECTOR_PROP_CEILINGPIC,
SECTOR_PROP_LIGHTLEVEL,
SECTOR_PROP_FLOORLIGHTLEVEL,
SECTOR_PROP_CEILINGLIGHTLEVEL,
SECTOR_PROP_FLOORLIGHTABSOLUTE,
SECTOR_PROP_CEILINGLIGHTABSOLUTE,
SECTOR_PROP_FLAGS,
SECTOR_PROP_SPECIALFLAGS,
SECTOR_PROP_GRAVITY,
SECTOR_PROP_ACTIVATION,
SECTOR_PROP_ACTION,
SECTOR_PROP_ARG0,
SECTOR_PROP_ARG1,
SECTOR_PROP_ARG2,
SECTOR_PROP_ARG3,
SECTOR_PROP_ARG4,
SECTOR_PROP_ARG5,
SECTOR_PROP_ARG6,
SECTOR_PROP_ARG7,
SECTOR_PROP_ARG8,
SECTOR_PROP_ARG9,
SECTOR_PROP_ARG0STR,
SECTOR_PROP_ARG1STR,
SECTOR_PROP__MAX
};
enum
{
MSF_FLIPSPECIAL_FLOOR = 1,
MSF_FLIPSPECIAL_CEILING = 1<<1,
MSF_FLIPSPECIAL_BOTH = (MSF_FLIPSPECIAL_FLOOR|MSF_FLIPSPECIAL_CEILING),
MSF_TRIGGERSPECIAL_TOUCH = 1<<2,
MSF_TRIGGERSPECIAL_HEADBUMP = 1<<3,
MSF_TRIGGERLINE_PLANE = 1<<4,
MSF_TRIGGERLINE_MOBJ = 1<<5,
MSF_INVERTPRECIP = 1<<6,
MSF_GRAVITYFLIP = 1<<7,
MSF_HEATWAVE = 1<<8,
MSF_NOCLIPCAMERA = 1<<9,
MSF_RIPPLE_FLOOR = 1<<10,
MSF_RIPPLE_CEILING = 1<<11,
MSF_INVERTENCORE = 1<<12,
};
enum
{
SSF_NOSTEPUP = 1,
SSF_DOUBLESTEPUP = 1<<1,
SSF_NOSTEPDOWN = 1<<2,
SSF_WINDCURRENT = 1<<3,
SSF_CONVEYOR = 1<<4,
SSF_SPEEDPAD = 1<<5,
SSF_STARPOSTACTIVATOR = 1<<6,
SSF_EXIT = 1<<7,
SSF_DELETEITEMS = 1<<8,
SSF_SNEAKERPANEL = 1<<9,
SSF_WATERPANEL = 1<<10,
SSF_REDPOGOSPRING = 1<<11,
SSF_YELLOWPOGOSPRING = 1<<12,
SSF_FAN = 1<<13,
SSF_FINISHLINE = 1<14,
SSF_ZOOMTUBESTART = 1<<15,
SSF_ZOOMTUBEEND = 1<<16,
};
enum
{
SECSPAC_TRIGGERMASK = 0x0000000F,
SECSPAC_ONCESPECIAL = 0x00000000,
SECSPAC_REPEATSPECIAL = 0x00000001,
SECSPAC_CONTINUOUSSPECIAL = 0x00000002,
SECSPAC_ENTER = 0x00000010,
SECSPAC_FLOOR = 0x00000020,
SECSPAC_CEILING = 0x00000040,
SECSPAC_ENTERMONSTER = 0x00000080,
SECSPAC_FLOORMONSTER = 0x00000100,
SECSPAC_CEILINGMONSTER = 0x00000200,
SECSPAC_ENTERMISSILE = 0x00000400,
SECSPAC_FLOORMISSILE = 0x00000800,
SECSPAC_CEILINGMISSILE = 0x00001000,
};
enum
{
THING_PROP_X,
THING_PROP_Y,
THING_PROP_Z,
THING_PROP_TYPE,
THING_PROP_ANGLE,
THING_PROP_PITCH,
THING_PROP_ROLL,
THING_PROP_SPRITEROLL,
THING_PROP_FRAME,
THING_PROP_SPRITE,
THING_PROP_SPRITE2,
THING_PROP_RENDERFLAGS,
THING_PROP_SPRITEXSCALE,
THING_PROP_SPRITEYSCALE,
THING_PROP_SPRITEXOFFSET,
THING_PROP_SPRITEYOFFSET,
THING_PROP_FLOORZ,
THING_PROP_CEILINGZ,
THING_PROP_RADIUS,
THING_PROP_HEIGHT,
THING_PROP_MOMX,
THING_PROP_MOMY,
THING_PROP_MOMZ,
THING_PROP_TICS,
THING_PROP_STATE,
THING_PROP_FLAGS,
THING_PROP_FLAGS2,
THING_PROP_EFLAGS,
THING_PROP_SKIN,
THING_PROP_COLOR,
THING_PROP_HEALTH,
THING_PROP_MOVEDIR,
THING_PROP_MOVECOUNT,
THING_PROP_REACTIONTIME,
THING_PROP_THRESHOLD,
THING_PROP_LASTLOOK,
THING_PROP_FRICTION,
THING_PROP_MOVEFACTOR,
THING_PROP_FUSE,
THING_PROP_WATERTOP,
THING_PROP_WATERBOTTOM,
THING_PROP_SCALE,
THING_PROP_DESTSCALE,
THING_PROP_SCALESPEED,
THING_PROP_EXTRAVALUE1,
THING_PROP_EXTRAVALUE2,
THING_PROP_CUSVAL,
THING_PROP_CVMEM,
THING_PROP_COLORIZED,
THING_PROP_MIRRORED,
THING_PROP_SHADOWSCALE,
THING_PROP_WHITESHADOW,
THING_PROP_WORLDXOFFSET,
THING_PROP_WORLDYOFFSET,
THING_PROP_WORLDZOFFSET,
THING_PROP_HITLAG,
THING_PROP_WATERSKIP,
THING_PROP_DISPOFFSET,
THING_PROP_TARGET,
THING_PROP_TRACER,
THING_PROP_HNEXT,
THING_PROP_HPREV,
THING_PROP_ITNEXT,
THING_PROP__MAX
};
enum
{
tr_trans10 = 1,
tr_trans20,
tr_trans30,
tr_trans40,
tr_trans50,
tr_trans60,
tr_trans70,
tr_trans80,
tr_trans90,
NUMTRANSMAPS,
};
enum
{
FF_FRAMEMASK = 0xff,
FF_SPR2SUPER = 0x80,
FF_SPR2ENDSTATE = 0x100,
FF_SPR2MIDSTART = 0x200,
FF_BLENDMASK = 0x7000,
FF_BLENDSHIFT = 12,
FF_ADD = ((BLEND_ADD-1) << FF_BLENDSHIFT),
FF_SUBTRACT = ((BLEND_SUBTRACT-1) << FF_BLENDSHIFT),
FF_REVERSESUBTRACT = ((BLEND_REVERSESUBTRACT-1) << FF_BLENDSHIFT),
FF_MODULATE = ((BLEND_MODULATE-1) << FF_BLENDSHIFT),
FF_OVERLAY = ((BLEND_OVERLAY-1) << FF_BLENDSHIFT),
FF_TRANSMASK = 0xf0000,
FF_TRANSSHIFT = 16,
FF_TRANS10 = (tr_trans10 << FF_TRANSSHIFT),
FF_TRANS20 = (tr_trans20 << FF_TRANSSHIFT),
FF_TRANS30 = (tr_trans30 << FF_TRANSSHIFT),
FF_TRANS40 = (tr_trans40 << FF_TRANSSHIFT),
FF_TRANS50 = (tr_trans50 << FF_TRANSSHIFT),
FF_TRANS60 = (tr_trans60 << FF_TRANSSHIFT),
FF_TRANS70 = (tr_trans70 << FF_TRANSSHIFT),
FF_TRANS80 = (tr_trans80 << FF_TRANSSHIFT),
FF_TRANS90 = (tr_trans90 << FF_TRANSSHIFT),
FF_BRIGHTMASK = 0x00300000,
FF_FULLBRIGHT = 0x00100000,
FF_FULLDARK = 0x00200000,
FF_SEMIBRIGHT = (FF_FULLBRIGHT|FF_FULLDARK),
FF_PAPERSPRITE = 0x00400000,
FF_FLOORSPRITE = 0x00800000,
FF_VERTICALFLIP = 0x01000000,
FF_HORIZONTALFLIP = 0x02000000,
FF_ANIMATE = 0x10000000,
FF_GLOBALANIM = 0x20000000,
FF_RANDOMANIM = 0x40000000,
};
enum
{
RF_HORIZONTALFLIP = 0x00000001,
RF_VERTICALFLIP = 0x00000002,
RF_ABSOLUTEOFFSETS = 0x00000004,
RF_FLIPOFFSETS = 0x00000008,
RF_SPLATMASK = 0x000000F0,
RF_SLOPESPLAT = 0x00000010,
RF_OBJECTSLOPESPLAT = 0x00000020,
RF_NOSPLATBILLBOARD = 0x00000040,
RF_NOSPLATROLLANGLE = 0x00000080,
RF_BRIGHTMASK = 0x00000300,
RF_FULLBRIGHT = 0x00000100,
RF_FULLDARK = 0x00000200,
RF_SEMIBRIGHT = (RF_FULLBRIGHT | RF_FULLDARK),
RF_NOCOLORMAPS = 0x00000400,
RF_ALWAYSONTOP = 0x00000800,
RF_SPRITETYPEMASK = 0x00003000,
RF_PAPERSPRITE = 0x00001000,
RF_FLOORSPRITE = 0x00002000,
RF_SHADOWDRAW = 0x00004000,
RF_SHADOWEFFECTS = 0x00008000,
RF_DROPSHADOW = (RF_SHADOWDRAW | RF_SHADOWEFFECTS | RF_FULLDARK),
RF_DONTDRAW = 0x00F00000,
RF_DONTDRAWP1 = 0x00100000,
RF_DONTDRAWP2 = 0x00200000,
RF_DONTDRAWP3 = 0x00400000,
RF_DONTDRAWP4 = 0x00800000,
RF_BLENDMASK = 0x07000000,
RF_BLENDSHIFT = (6*4),
RF_ADD = ((BLEND_ADD-1) << RF_BLENDSHIFT),
RF_SUBTRACT = ((BLEND_SUBTRACT-1) << RF_BLENDSHIFT),
RF_REVERSESUBTRACT = ((BLEND_REVERSESUBTRACT-1) << RF_BLENDSHIFT),
RF_MODULATE = ((BLEND_MODULATE-1) << RF_BLENDSHIFT),
RF_OVERLAY = ((BLEND_OVERLAY-1) << RF_BLENDSHIFT),
RF_TRANSMASK = 0xF0000000,
RF_TRANSSHIFT = (7*4),
RF_TRANS10 = (tr_trans10 << RF_TRANSSHIFT),
RF_TRANS20 = (tr_trans20 << RF_TRANSSHIFT),
RF_TRANS30 = (tr_trans30 << RF_TRANSSHIFT),
RF_TRANS40 = (tr_trans40 << RF_TRANSSHIFT),
RF_TRANS50 = (tr_trans50 << RF_TRANSSHIFT),
RF_TRANS60 = (tr_trans60 << RF_TRANSSHIFT),
RF_TRANS70 = (tr_trans70 << RF_TRANSSHIFT),
RF_TRANS80 = (tr_trans80 << RF_TRANSSHIFT),
RF_TRANS90 = (tr_trans90 << RF_TRANSSHIFT),
RF_GHOSTLY = (RF_TRANS80 | RF_FULLBRIGHT),
RF_GHOSTLYMASK = (RF_TRANSMASK | RF_FULLBRIGHT),
};
enum
{
MF_SPECIAL = 1,
MF_SOLID = 1<<1,
MF_SHOOTABLE = 1<<2,
MF_NOSECTOR = 1<<3,
MF_NOBLOCKMAP = 1<<4,
MF_PAPERCOLLISION = 1<<5,
MF_PUSHABLE = 1<<6,
MF_BOSS = 1<<7,
MF_SPAWNCEILING = 1<<8,
MF_NOGRAVITY = 1<<9,
MF_AMBIENT = 1<<10,
MF_SLIDEME = 1<<11,
MF_NOCLIP = 1<<12,
MF_FLOAT = 1<<13,
MF_BOXICON = 1<<14,
MF_MISSILE = 1<<15,
MF_SPRING = 1<<16,
MF_MONITOR = 1<<17,
MF_NOTHINK = 1<<18,
MF_FIRE = 1<<19,
MF_NOCLIPHEIGHT = 1<<20,
MF_ENEMY = 1<<21,
MF_SCENERY = 1<<22,
MF_PAIN = 1<<23,
MF_STICKY = 1<<24,
MF_APPLYTERRAIN = 1<<25,
MF_NOCLIPTHING = 1<<26,
MF_GRENADEBOUNCE = 1<<27,
MF_RUNSPAWNFUNC = 1<<28,
MF_DONTENCOREMAP = 1<<29,
MF_PICKUPFROMBELOW = 1<<30,
MF_BOUNCE = 1<<31,
};
enum
{
MF2_AXIS = 1,
// free: 1<<1
MF2_DONTRESPAWN = 1<<2,
MF2_AUTOMATIC = 1<<4,
MF2_RAILRING = 1<<5,
MF2_BOUNCERING = 1<<6,
MF2_EXPLOSION = 1<<7,
MF2_SCATTER = 1<<8,
MF2_BEYONDTHEGRAVE = 1<<9,
MF2_SLIDEPUSH = 1<<10,
MF2_CLASSICPUSH = 1<<11,
MF2_INVERTAIMABLE = 1<<12,
MF2_INFLOAT = 1<<13,
MF2_DEBRIS = 1<<14,
MF2_NIGHTSPULL = 1<<15,
MF2_JUSTATTACKED = 1<<16,
MF2_FIRING = 1<<17,
MF2_SUPERFIRE = 1<<18,
// free: 1<<19
MF2_STRONGBOX = 1<<20,
MF2_OBJECTFLIP = 1<<21,
MF2_SKULLFLY = 1<<22,
MF2_FRET = 1<<23,
MF2_BOSSNOTRAP = 1<<24,
MF2_BOSSFLEE = 1<<25,
MF2_BOSSDEAD = 1<<26,
MF2_AMBUSH = 1<<27,
MF2_LINKDRAW = 1<<28,
MF2_SHIELD = 1<<29,
MF2_SPLAT = 1<<30,
MF2_WATERRUN = 1<<31,
};
enum
{
MFE_ONGROUND = 1,
MFE_JUSTHITFLOOR = 1<<1,
MFE_TOUCHWATER = 1<<2,
MFE_UNDERWATER = 1<<3,
MFE_JUSTSTEPPEDDOWN = 1<<4,
MFE_VERTICALFLIP = 1<<5,
MFE_GOOWATER = 1<<6,
MFE_TOUCHLAVA = 1<<7,
MFE_PUSHED = 1<<8,
MFE_SPRUNG = 1<<9,
MFE_APPLYPMOMZ = 1<<10,
MFE_TRACERANGLE = 1<<11,
MFE_JUSTBOUNCEDWALL = 1<<12,
// SRB2Kart: free
// = 1<<13,
MFE_SLOPELAUNCHED = 1<<14,
// free: to and including 1<<15
};
enum
{
DI_NODIR = -1,
DI_EAST = 0,
DI_NORTHEAST = 1,
DI_NORTH = 2,
DI_NORTHWEST = 3,
DI_WEST = 4,
DI_SOUTHWEST = 5,
DI_SOUTH = 6,
DI_SOUTHEAST = 7,
NUMDIRS = 8,
};
enum
{
BOT_STYLE_NORMAL,
BOT_STYLE_STAY,
BOT_STYLE__MAX
};
enum
{
BOT_CONTROLLER_NORUBBERBAND = 1,
BOT_CONTROLLER_NOCONTROL = 1<<1,
BOT_CONTROLLER_FORCEDIR = 1<<2,
BOT_CONTROLLER_FASTFALL = 1<<3,
};
#endif//__GDCC_Header__ACS__bkdefs_acs__

View file

@ -1,468 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2017 David Hill
// Copyright(C) 2022-2023 Sally Cochenour
// Copyright(C) 2025 NepDisk
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Defines for BlanKart ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__ACS__bkspecial_acs__
#define __GDCC_Header__ACS__bkspecial_acs__
//----------------------------------------------------------------------------|
// Macros |
//
#define ACS_ExecuteWait(name, ...) \
do \
{ \
str __execute_wait_name = (name); \
ACS_Execute(__execute_wait_name, __VA_ARGS__ + 0); \
ScriptWait(__execute_wait_name); \
} \
while(0)
#define Dialogue_NewDismissText(text) \
do \
{ \
str __text = (text); \
Dialogue_NewText(__text); \
Dialogue_WaitForDismiss(); \
} \
while(0)
#define ACS_PrintPropertyBase() \
(char): PrintChar, \
(str): PrintString, \
\
a(global): PrintGlobalCharArray, \
a(global): PrintGlobalCharRange, \
a(local): PrintLocalCharArray, \
a(local): PrintLocalCharRange, \
a(module): PrintModuleCharArray, \
a(module): PrintModuleCharRange, \
a(world): PrintWorldCharArray, \
a(world): PrintWorldCharRange, \
\
b: PrintBinary, \
c: PrintChar, \
d: PrintInt, \
f: PrintFixed, \
i: PrintInt, \
s: PrintString, \
x: PrintHex
#pragma state save
#pragma define raw ON
#define suspend do (__suspend()); while(0)
#pragma state restore
//----------------------------------------------------------------------------|
// Functions |
//
// [type] [ID]:[function name]([required args], [optional args])
special
int 400:Sector_CopyHeights(3, 4),
int 402:Light_Copy(2, 3),
int 403:Sector_CopyHeightsMove(4, 6),
int 405:Sector_MovePlanes(4, 5),
int 408:Sector_CopyTextures(3),
int 409:Sector_ChangeTag(2, 3),
int 410:Line_ChangeFrontSectorTag(2, 3),
int 411:Sector_StopMovement(1),
int 412:Thing_Teleport(1, 5),
int 414:PlaySFX(1, 4),
int 415:Console_Execute(1),
int 416:Light_Flicker(5),
int 417:Light_Glow(5),
int 418:Light_Blink(6),
int 420:Light_Fade(3, 4),
int 421:Light_Stop(1),
int 422:Camera_CutAwayView(2, 5),
int 423:Level_SetSky(1, 2),
int 424:Level_SetWeather(1, 2),
int 425:Thing_SetState(2),
int 426:Thing_Stop(0, 1),
int 427:Player_AddScore(1),
int 428:Sector_PlatformMovement(2, 5),
int 429:Sector_Crush(3),
int 433:Thing_SetFlip(1),
int 435:Sector_ChangeScroll(3),
int 436:FOF_Shatter(2),
int 437:Player_ToggleControl(1),
int 438:Thing_SetScale(1),
int 439:Line_CopyTextures(3, 4),
int 440:Level_StartMetalSonicRace(0),
int 441:SetUnlockableTrigger(1),
int 442:Sector_ChangeThingStates(3, 4),
int 443:Lua_Execute(1, 12),
int 444:Earthquake(1, 3),
int 445:FOF_SetExists(3),
int 446:FOF_Crumble(2, 3),
int 447:Sector_SetColormap(2, 3),
int 448:Level_SetSkyboxViewpoints(3, 4),
int 449:Level_SetBossDisabled(2),
int 452:FOF_SetAlpha(3, 4),
int 453:FOF_Fade(4, 5),
int 454:FOF_StopFade(2, 3),
int 455:Sector_FadeColormap(3, 4),
int 456:Sector_StopColormapFade(1),
int 457:Thing_StartTracking(4, 5),
int 458:Thing_StopTracking(0),
int 460:Player_AddRings(1, 3),
int 461:Thing_Spawn(5, 9),
int 462:Level_StopClock(0),
int 463:Thing_Dye(1), // color
int 464:TriggerEggCapsule(1, 2),
int 466:Level_SetFailed(1),
int 467:Sector_SetLight(2, 4),
int 468:Line_SetArg(2, 4),
int 469:Sector_SetGravity(2, 4),
int 475:ACS_Execute(1, 10),
int 476:ACS_ExecuteAlways(1, 10),
int 477:ACS_Suspend(1),
int 478:ACS_Terminate(1),
int 480:Polyobj_DoorSlide(5),
int 481:Polyobj_DoorSwing(4),
int 482:Polyobj_Move(4, 5),
int 484:Polyobj_Rotate(3, 4),
int 488:Polyobj_MoveByWaypoints(3, 5),
int 489:Polyobj_SetVisibilityTangibility(3),
int 491:Polyobj_SetAlpha(2, 3),
int 492:Polyobj_FadeAlpha(3, 4),
int 499:Sector_ToggleWaypoints(2),
int 2001:FinishLine(0, 1),
int 2003:RespawnLine(0, 1),
int 2004:UpdateBotController(3, 4),
int 2005:DismountFlyingObject(0),
// Internal functions have negative values
// [type] [ID]:[function name]([required args], [type of each arg, including optional ones])
int -1:GetLineProperty(2, int, int),
fixed -1:GetLinePropertyFixed(2, int, int),
str -1:GetLinePropertyString(2, int, int),
bool -1:GetLinePropertyBool(2, int, int),
void -2:SetLineProperty(3, int, int, int),
void -2:SetLinePropertyFixed(3, int, int, fixed),
void -2:SetLinePropertyString(3, int, int, str),
void -2:SetLinePropertyBool(3, int, int, bool),
int -3:GetLineUserProperty(2, int, str),
fixed -3:GetLineUserPropertyFixed(2, int, str),
str -3:GetLineUserPropertyString(2, int, str),
bool -3:GetLineUserPropertyBool(2, int, str),
int -4:GetSectorProperty(2, int, int),
fixed -4:GetSectorPropertyFixed(2, int, int),
str -4:GetSectorPropertyString(2, int, int),
bool -4:GetSectorPropertyBool(2, int, int),
void -5:SetSectorProperty(3, int, int, int),
void -5:SetSectorPropertyFixed(3, int, int, fixed),
void -5:SetSectorPropertyString(3, int, int, str),
void -5:SetSectorPropertyBool(3, int, int, bool),
int -6:GetSectorUserProperty(2, int, str),
fixed -6:GetSectorUserPropertyFixed(2, int, str),
str -6:GetSectorUserPropertyString(2, int, str),
bool -6:GetSectorUserPropertyBool(2, int, str),
int -7:GetSideProperty(3, int, int, int),
fixed -7:GetSidePropertyFixed(3, int, int, int),
str -7:GetSidePropertyString(3, int, int, int),
bool -7:GetSidePropertyBool(3, int, int, int),
void -8:SetSideProperty(4, int, int, int, int),
void -8:SetSidePropertyFixed(4, int, int, int, fixed),
void -8:SetSidePropertyString(4, int, int, int, str),
void -8:SetSidePropertyBool(4, int, int, int, bool),
int -9:GetSideUserProperty(3, int, int, str),
fixed -9:GetSideUserPropertyFixed(3, int, int, str),
str -9:GetSideUserPropertyString(3, int, int, str),
bool -9:GetSideUserPropertyBool(3, int, int, str),
int -10:GetThingProperty(2, int, int),
fixed -10:GetThingPropertyFixed(2, int, int),
str -10:GetThingPropertyString(2, int, int),
bool -10:GetThingPropertyBool(2, int, int),
void -11:SetThingProperty(3, int, int, int),
void -11:SetThingPropertyFixed(3, int, int, fixed),
void -11:SetThingPropertyString(3, int, int, str),
void -11:SetThingPropertyBool(3, int, int, bool),
int -12:GetThingUserProperty(2, int, str),
fixed -12:GetThingUserPropertyFixed(2, int, str),
str -12:GetThingUserPropertyString(2, int, str),
bool -12:GetThingUserPropertyBool(2, int, str),
int -13:GetPlayerProperty(2, int, int),
fixed -13:GetPlayerPropertyFixed(2, int, int),
str -13:GetPlayerPropertyString(2, int, int),
bool -13:GetPlayerPropertyBool(2, int, int),
void -14:SetPlayerProperty(3, int, int, int),
void -14:SetPlayerPropertyFixed(3, int, int, fixed),
void -14:SetPlayerPropertyString(3, int, int, str),
void -14:SetPlayerPropertyBool(3, int, int, bool),
int -15:GetPolyobjProperty(2, int, int),
fixed -15:GetPolyobjPropertyFixed(2, int, int),
str -15:GetPolyobjPropertyString(2, int, int),
bool -15:GetPolyobjPropertyBool(2, int, int),
void -16:SetPolyobjProperty(3, int, int, int),
void -16:SetPolyobjPropertyFixed(3, int, int, fixed),
void -16:SetPolyobjPropertyString(3, int, int, str),
void -16:SetPolyobjPropertyBool(3, int, int, bool),
int -100:strcmp(2, str, str),
int -101:strcasecmp(2, str, str),
int -101:stricmp(2, str, str),
fixed -200:GetActorVelX(1),
fixed -201:GetActorVelY(1),
fixed -202:GetActorVelZ(1),
fixed -203:GetActorRoll(1),
int -204:GetActorFloorTexture(1),
bool -205:CheckActorState(2),
bool -206:CheckActorFlag(2),
int -207:GetActorClass(1),
int -208:GetActorDye(1),
void -209:SetActorVelocity(4,5),
void -210:SetActorRoll(2),
void -211:SetActorFlag(2,3),
void -212:SetActorClass(2),
void -213:SetActorDye(2),
void -214:SpawnForced(4,6),
// Reimplementations of trigger linedefs.
int -300:CountEnemies(0, int, int),
int -301:CountPushables(0, int, int),
//bool -302:HaveUnlockableTrigger(1, int),
//bool -303:HaveUnlockable(1, int),
str -304:PlayerSkin(0),
str -305:GetObjectDye(0),
int -306:PlayerEmeralds(0),
int -307:PlayerLap(0),
int -308:LowestLap(0),
bool -309:EncoreMode(0),
bool -310:ItemBreaker(0),
bool -311:TimeAttack(0),
int -312:ThingCount(0, str, int, int),
bool -313:GrandPrix(0),
//str -314:GetGrabbedSprayCan(0),
bool -315:PlayerBot(0),
bool -316:PositionStart(0),
bool -317:FreePlay(0),
//str -318:CheckTutorialChallenge(0),
bool -319:PlayerLosing(0),
bool -320:PlayerExiting(0),
void -322:Teleport(2,3),
void -323:SetViewpoint(1,2),
void -500:CameraWait(1, int),
int -501:PodiumPosition(0),
//void -502:PodiumFinish(0),
void -503:SetLineRenderStyle(3, int, int, fixed),
void -504:MapWarp(2, str, bool),
int -505:AddBot(0, str, int, int),
void -506:StopLevelExit(0),
void -507:ExitLevel(0, bool),
void -508:Music_Play(1, str, bool),
void -509:Music_StopAll(0, bool),
void -510:Music_Remap(2, str, str, bool),
//void -511:Freeze(1, bool),
//void -512:Music_Dim(1, int, int),
//void -600:Dialogue_SetSpeaker(2, str, int),
//void -601:Dialogue_SetCustomSpeaker(2, str, str, str, str),
//void -602:Dialogue_NewText(1, str),
//void -603:Dialogue_WaitForDismiss(0),
//void -604:Dialogue_WaitForText(0),
//void -605:Dialogue_AutoDismiss(0),
fixed -700:Tan(1),
fixed -701:Arcsin(1),
fixed -702:Arccos(1),
fixed -703:Hypot(2),
fixed -704:Sqrt(1),
fixed -705:Floor(1),
fixed -706:Ceil(1),
fixed -707:Round(1),
fixed -710:InvAngle(1),
str -711:OppositeColor(1),
// 0 to 56: Implemented by ACSVM
void { 2 }:__suspend(void),
void { 55, 56}:Delay(int),
int { 57, 58}:Random(int, int),
fixed { 57, 58}:RandomFixed(fixed, fixed),
int { 59, 60}:__ThingCountOld(str, int),
void { 61, 62}:TagWait(int),
void { 63, 64}:PolyWait(int),
void { 65, 66}:ChangeFloor(int, str),
void { 67, 68}:ChangeCeiling(int, str),
// 69 to 79: Implemented by ACSVM
int { 80 }:LineSide(void),
void { 81, 82}:__ScriptWaitDirect(int), // 81 to 82: Implemented by ACSVM
void { 83 }:ClearLineSpecial(void),
// 84 to 85: Implemented by ACSVM
void { 85 }:BeginPrint(void),
void { 85 }:BeginPrintBold(void),
void { 85 }:BeginLog(void),
void { 85 }:BeginStrParam(void),
void { 86 }:EndPrint(void),
void { 87 }:PrintString(str), // 87 to 89: Implemented by ACSVM
void { 88 }:PrintInt(int),
void { 88 }:PrintNumber(int),
void { 89 }:PrintChar(int),
int { 90 }:PlayerCount(void),
int { 91 }:GameType(void),
int { 92 }:GameSpeed(void),
int { 93 }:Timer(void),
void { 94 }:SectorSound(str, int),
void { 95 }:AmbientSound(str, int),
void { 97 }:SetLineTexture(int, int, int, str),
void { 98 }:SetLineBlocking(int, int),
void { 99 }:SetLineSpecial(int, int, int, int, int, int, int),
void {100 }:ThingSound(int, str, int),
void {101 }:EndPrintBold(void),
bool {118 }:IsNetworkGame(void),
int {119 }:PlayerTeam(void),
int {120 }:PlayerRings(void),
int {122 }:PlayerScore(void),
int {136 }:FixedMul(fixed, fixed), // 136 to 137: Implemented by ACSVM
int {137 }:FixedDiv(fixed, fixed),
void {157 }:PrintFixed(fixed), // 157: Implemented by ACSVM
// 167 to 173: Implemented by ACSVM
// 175 to 179: Implemented by ACSVM
// 181 to 189: Implemented by ACSVM
// 203 to 217: Implemented by ACSVM
// 225 to 243: Implemented by ACSVM
int {247 }:PlayerNumber(void),
int {248 }:ActivatorTID(void),
int {253 }:strlen(str), // 253: Implemented by ACSVM
// 256 to 257: Implemented by ACSVM
void {257 }:SetResultValue(int),
void {257 }:SetResultValueFixed(fixed),
// 263: Implemented by ACSVM
void {270 }:EndLog(void),
void {273 }:PrintModuleCharArray(int, int), // 273 to 275: Implemented by ACSVM
void {274 }:PrintWorldCharArray(int, int),
void {275 }:PrintGlobalCharArray(int, int),
// 291 to 325: Implemented by ACSVM
// 330: Implemented by ACSVM
void {349 }:PrintBinary(bool), // 349 to 361: Implemented by ACSVM
void {350 }:PrintHex(int),
str {352 }:EndStrParam(void),
void {353 }:PrintModuleCharRange(int, int, int, int),
void {354 }:PrintWorldCharRange(int, int, int, int),
void {355 }:PrintGlobalCharRange(int, int, int, int),
int {356 }:StrCpyToModuleCharRange(int, int, int, int, str, int),
int {357 }:StrCpyToWorldCharRange(int, int, int, int, str, int),
int {358 }:StrCpyToGlobalCharRange(int, int, int, int, str, int),
void {361 }:ScriptWait(str),
// 363 to 380: Implemented by ACSVM
void {378 }:PrintLocalCharArray(int, int),
void {379 }:PrintLocalCharRange(int, int, int, int),
int {380 }:StrCpyToLocalCharRange(int, int, int, int, str, int);
print __Print
(
(begin): BeginPrint,
(end): EndPrint,
ACS_PrintPropertyBase()
);
print __PrintBold
(
(begin): BeginPrintBold,
(end): EndPrintBold,
ACS_PrintPropertyBase()
);
print PrintRaw
(
ACS_PrintPropertyBase()
);
print __Log
(
(begin): BeginLog,
(end): EndLog,
ACS_PrintPropertyBase()
);
print __StrParam
(
(begin): BeginStrParam,
(end): EndStrParam,
ACS_PrintPropertyBase()
);
#endif//__GDCC_Header__ACS__bkspecial_acs__

View file

@ -1,37 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2015 Benjamin Moir
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Header for target library libacs.
// Declarations and definitions from GLOOME's ACS.
#ifndef __GDCC_Header__C__ACS_GLOOME_h__
#define __GDCC_Header__C__ACS_GLOOME_h__
#include <ACS_Zandronum.h>
#include <ACS_GLOOME/Native.h>
#include <ACS_GLOOME/defs.h>
#endif //__GDCC_Header__C__ACS_GLOOME_h__

View file

@ -1,54 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2015 Benjamin Moir
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Header for target library libacs.
// "Native" functions from GLOOME's ACS.
#ifndef __GDCC_Header__C__ACS_GLOOME__Native_h__
#define __GDCC_Header__C__ACS_GLOOME__Native_h__
#include <ACS_Zandronum/Native.h>
// Global Functions
ACS_NativeDeclFull(11192, 3, int, ChangeFlag, (int, __str, int, int));
//ACS_NativeDeclFull(11193, 0, int, SetTicrate, (int));
ACS_NativeDeclFull(11194, 0, int, GetTicrate, (void));
ACS_NativeDeclFull(11195, 0, __str, GetActorFloorTexture, (int));
ACS_NativeDeclFull(11196, 0, __str, GetActorCeilingTexture, (int));
ACS_NativeDeclFull(11197, 0, int, SetPlayerBobMul, (_Accum, int));
ACS_NativeDeclFull(11198, 0, int, GetPlayerBobMul, (int));
ACS_NativeDeclFull(11199, 0, int, SetGameProperty, (int, int));
ACS_NativeDeclFull(11200, 0, int, GetGameProperty, (int));
ACS_NativeDeclFull(11201, 6, int, Warp, (int, _Accum, _Accum, _Accum, _Accum, int, __str, int));
ACS_NativeDeclFull(11202, 0, int, SetInputLock, (int));
ACS_NativeDeclFull(11203, 0, int, GetInputLock, (void));
ACS_NativeDeclFull(11204, 0, int, KeyIsBoundSym, (int, __str));
ACS_NativeDeclFull(11205, 0, __str, ReadUserData, (__str));
ACS_NativeDeclFull(11206, 0, int, ReadUserDataChar, (__str, int));
ACS_NativeDeclFull(11207, 0, int, Squat, (int, _Accum));
ACS_NativeDeclFull(11028, 0, int, GetUserDataSize, (__str));
ACS_NativeDeclFull(11029, 0, int, GetThingSpecial, (int, int));
#endif //__GDCC_Header__C__ACS_GLOOME__Native_h__

View file

@ -1,46 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2015 Benjamin Moir
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Header for target library libacs.
// Defines from GLOOME's ACS.
#ifndef __GDCC_Header__C__ACS_GLOOME__defs_h__
#define __GDCC_Header__C__ACS_GLOOME__defs_h__
#include <ACS_Zandronum/defs.h>
#define APROP_MaxStepHeight 44
#define APROP_MaxDropOffHeight 45
#define PAF_FORCETID 1
#define PAF_RETURNTID 2
#define BOB_STILL 0
#define BOB_MOVE 1
#define GPROP_DeathRestarts 0
#define GPROP_SavesEnabled 1
#endif //__GDCC_Header__C__ACS_GLOOME__defs_h__

View file

@ -1,23 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Declarations and definitions from Hexen's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Hexen_h__
#define __GDCC_Header__C__ACS_Hexen_h__
#include <ACS_Hexen/AsmFunc.h>
#include <ACS_Hexen/Special.h>
#include <ACS_Hexen/defs.h>
#endif//__GDCC_Header__C__ACS_Hexen_h__

View file

@ -1,97 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "AsmFunc" functions from Hexen's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Hexen__AsmFunc_h__
#define __GDCC_Header__C__ACS_Hexen__AsmFunc_h__
//----------------------------------------------------------------------------|
// Macros |
//
//
// ACS_AsmFuncDecl
//
#if __GDCC__
#define ACS_AsmFuncDecl(addr, alit, oarg, ...) \
[[__address(addr), __address_Lit(alit), __call("AsmFunc"), \
__optional_args(oarg), __VA_ARGS__]]
#else
#define ACS_AsmFuncDecl(addr, alit, oarg, ...)
#endif
//
// ACS_AsmFuncDeclFull
//
#ifndef ACS_SHORT_NAMES
#define ACS_AsmFuncDeclFull(addr, alit, oarg, retn, name, args, ...) \
ACS_AsmFuncDeclPre(addr, alit, oarg, retn, name, args, __VA_ARGS__)
#else
#define ACS_AsmFuncDeclFull(addr, alit, oarg, retn, name, args, ...) \
ACS_AsmFuncDeclPre(addr, alit, oarg, retn, name, args, __VA_ARGS__); \
ACS_AsmFuncDeclRaw(addr, alit, oarg, retn, name, args, __VA_ARGS__)
#endif
//
// ACS_AsmFuncDeclPre
//
#define ACS_AsmFuncDeclPre(addr, alit, oarg, retn, name, args, ...) \
ACS_AsmFuncDecl(addr, alit, oarg, __VA_ARGS__) extern retn (ACS_##name) args
//
// ACS_AsmFuncDeclRaw
//
#define ACS_AsmFuncDeclRaw(addr, alit, oarg, retn, name, args, ...) \
ACS_AsmFuncDecl(addr, alit, oarg, __VA_ARGS__) extern retn (name) args
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_AsmFuncDeclFull( 55, 56, 0, void, Delay, (int), delay);
ACS_AsmFuncDeclFull( 57, 58, 0, int, Random, (int, int));
ACS_AsmFuncDeclFull( 57, 58, 0, _Accum, RandomFixed, (_Accum, _Accum));
ACS_AsmFuncDeclFull( 59, 60, 0, int, ThingCount, (int, int));
ACS_AsmFuncDeclFull( 61, 62, 0, void, TagWait, (int), delay);
ACS_AsmFuncDeclFull( 63, 64, 0, void, PolyWait, (int), delay);
ACS_AsmFuncDeclFull( 65, 66, 0, void, ChangeFloor, (int, __str));
ACS_AsmFuncDeclFull( 67, 68, 0, void, ChangeCeiling, (int, __str));
ACS_AsmFuncDeclFull( 80, , 0, int, LineSide, (void));
ACS_AsmFuncDeclFull( 81, 82, 0, void, ScriptWait, (int), delay);
ACS_AsmFuncDeclFull( 83, , 0, void, ClearLineSpecial, (void));
ACS_AsmFuncDeclFull( 85, , 0, void, BeginPrint, (void));
ACS_AsmFuncDeclFull( 85, , 0, void, BeginPrintBold, (void));
ACS_AsmFuncDeclFull( 86, , 0, void, EndPrint, (void));
ACS_AsmFuncDeclFull( 87, , 0, void, PrintString, (__str));
ACS_AsmFuncDeclFull( 88, , 0, void, PrintInt, (int));
ACS_AsmFuncDeclFull( 88, , 0, void, PrintNumber, (int));
ACS_AsmFuncDeclFull( 89, , 0, void, PrintChar, (char));
ACS_AsmFuncDeclFull( 90, , 0, int, PlayerCount, (void));
ACS_AsmFuncDeclFull( 91, , 0, int, GameType, (void));
ACS_AsmFuncDeclFull( 92, , 0, int, GameSkill, (void));
ACS_AsmFuncDeclFull( 93, , 0, int, Timer, (void));
ACS_AsmFuncDeclFull( 94, , 0, void, SectorSound, (__str, int));
ACS_AsmFuncDeclFull( 95, , 0, void, AmbientSound, (__str, int));
ACS_AsmFuncDeclFull( 96, , 0, void, SoundSequence, (__str));
ACS_AsmFuncDeclFull( 97, , 0, void, SetLineTexture, (int, int, int, __str));
ACS_AsmFuncDeclFull( 98, , 0, void, SetLineBlocking, (int, int));
ACS_AsmFuncDeclFull( 99, , 5, void, SetLineSpecial, (int, int, int, int, int, int, int));
ACS_AsmFuncDeclFull(100, , 0, void, ThingSound, (int, __str, int));
ACS_AsmFuncDeclFull(101, , 0, void, EndPrintBold, (void));
#endif//__GDCC_Header__C__ACS_Hexen__AsmFunc_h__

View file

@ -1,153 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "Special" functions from Hexen's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Hexen__Special_h__
#define __GDCC_Header__C__ACS_Hexen__Special_h__
//----------------------------------------------------------------------------|
// Macros |
//
//
// ACS_SpecialDecl
//
#if __GDCC__
#define ACS_SpecialDecl(addr, oarg, ...) \
[[__address(addr), __call("Special"), __optional_args(oarg)]] [[__VA_ARGS__]]
#else
#define ACS_SpecialDecl(addr, oarg, ...)
#endif
//
// ACS_SpecialDeclFull
//
#ifndef ACS_SHORT_NAMES
#define ACS_SpecialDeclFull(addr, oarg, retn, name, args, ...) \
ACS_SpecialDeclPre(addr, oarg, retn, name, args, __VA_ARGS__)
#else
#define ACS_SpecialDeclFull(addr, oarg, retn, name, args, ...) \
ACS_SpecialDeclPre(addr, oarg, retn, name, args, __VA_ARGS__); \
ACS_SpecialDeclRaw(addr, oarg, retn, name, args, __VA_ARGS__)
#endif
//
// ACS_SpecialDeclPre
//
#define ACS_SpecialDeclPre(addr, oarg, retn, name, args, ...) \
ACS_SpecialDecl(addr, oarg, __VA_ARGS__) extern retn (ACS_##name) args
//
// ACS_SpecialDeclRaw
//
#define ACS_SpecialDeclRaw(addr, oarg, retn, name, args, ...) \
ACS_SpecialDecl(addr, oarg, __VA_ARGS__) extern retn (name) args
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_SpecialDeclFull( 2, 0, int, Polyobj_RotateLeft, (int, int, int));
ACS_SpecialDeclFull( 3, 0, int, Polyobj_RotateRight, (int, int, int));
ACS_SpecialDeclFull( 4, 0, int, Polyobj_Move, (int, int, int, int));
ACS_SpecialDeclFull( 6, 0, int, Polyobj_MoveTimes8, (int, int, int, int));
ACS_SpecialDeclFull( 7, 0, int, Polyobj_DoorSwing, (int, int, int, int));
ACS_SpecialDeclFull( 8, 0, int, Polyobj_DoorSlide, (int, int, int, int, int));
ACS_SpecialDeclFull( 10, 1, int, Door_Close, (int, int, int));
ACS_SpecialDeclFull( 11, 1, int, Door_Open, (int, int, int));
ACS_SpecialDeclFull( 12, 1, int, Door_Raise, (int, int, int, int));
ACS_SpecialDeclFull( 13, 1, int, Door_LockedRaise, (int, int, int, int, int));
ACS_SpecialDeclFull( 20, 0, int, Floor_LowerByValue, (int, int, int));
ACS_SpecialDeclFull( 21, 0, int, Floor_LowerToLowest, (int, int));
ACS_SpecialDeclFull( 22, 0, int, Floor_LowerToNearest, (int, int));
ACS_SpecialDeclFull( 23, 0, int, Floor_RaiseByValue, (int, int, int));
ACS_SpecialDeclFull( 24, 0, int, Floor_RaiseToHighest, (int, int));
ACS_SpecialDeclFull( 25, 0, int, Floor_RaiseToNearest, (int, int));
ACS_SpecialDeclFull( 26, 0, int, Stairs_BuildDown, (int, int, int, int, int));
ACS_SpecialDeclFull( 27, 0, int, Stairs_BuildUp, (int, int, int, int, int));
ACS_SpecialDeclFull( 28, 1, int, Floor_RaiseAndCrush, (int, int, int, int));
ACS_SpecialDeclFull( 29, 0, int, Pillar_Build, (int, int, int));
ACS_SpecialDeclFull( 30, 0, int, Pillar_Open, (int, int, int, int));
ACS_SpecialDeclFull( 31, 0, int, Stairs_BuildDownSync, (int, int, int, int));
ACS_SpecialDeclFull( 32, 0, int, Stairs_BuildUpSync, (int, int, int, int));
ACS_SpecialDeclFull( 35, 0, int, Floor_RaiseByValueTimes8, (int, int, int));
ACS_SpecialDeclFull( 36, 0, int, Floor_LowerByValueTimes8, (int, int, int));
ACS_SpecialDeclFull( 40, 0, int, Ceiling_LowerByValue, (int, int, int));
ACS_SpecialDeclFull( 41, 0, int, Ceiling_RaiseByValue, (int, int, int));
ACS_SpecialDeclFull( 42, 1, int, Ceiling_CrushAndRaise, (int, int, int, int));
ACS_SpecialDeclFull( 43, 1, int, Ceiling_LowerAndCrush, (int, int, int, int));
ACS_SpecialDeclFull( 44, 0, int, Ceiling_CrushStop, (int));
ACS_SpecialDeclFull( 45, 1, int, Ceiling_CrushRaiseAndStay, (int, int, int, int));
ACS_SpecialDeclFull( 46, 0, int, Floor_CrushStop, (int));
ACS_SpecialDeclFull( 60, 0, int, Plat_PerpetualRaise, (int, int, int));
ACS_SpecialDeclFull( 61, 0, int, Plat_Stop, (int));
ACS_SpecialDeclFull( 62, 0, int, Plat_DownWaitUpStay, (int, int, int));
ACS_SpecialDeclFull( 63, 0, int, Plat_DownByValue, (int, int, int, int));
ACS_SpecialDeclFull( 64, 0, int, Plat_UpWaitDownStay, (int, int, int));
ACS_SpecialDeclFull( 65, 0, int, Plat_UpByValue, (int, int, int, int));
ACS_SpecialDeclFull( 66, 0, int, Floor_LowerInstant, (int, int, int));
ACS_SpecialDeclFull( 67, 0, int, Floor_RaiseInstant, (int, int, int));
ACS_SpecialDeclFull( 68, 0, int, Floor_MoveToValueTimes8, (int, int, int, int));
ACS_SpecialDeclFull( 69, 0, int, Ceiling_MoveToValueTimes8, (int, int, int, int));
ACS_SpecialDeclFull( 70, 2, int, Teleport, (int, int, int));
ACS_SpecialDeclFull( 71, 3, int, Teleport_NoFog, (int, int, int, int));
ACS_SpecialDeclFull( 72, 2, int, ThrustThing, (int, int, int, int));
ACS_SpecialDeclFull( 73, 1, int, DamageThing, (int, int));
ACS_SpecialDeclFull( 74, 1, int, Teleport_NewMap, (int, int, int));
ACS_SpecialDeclRaw( 80, 4, int, ACS_Execute, (int, int, int, int, int));
ACS_SpecialDeclRaw( 81, 0, int, ACS_Suspend, (int, int));
ACS_SpecialDeclRaw( 82, 0, int, ACS_Terminate, (int, int));
ACS_SpecialDeclRaw( 83, 0, int, ACS_LockedExecute, (int, int, int, int, int));
ACS_SpecialDeclFull( 90, 0, int, Polyobj_OR_RotateLeft, (int, int, int));
ACS_SpecialDeclFull( 91, 0, int, Polyobj_OR_RotateRight, (int, int, int));
ACS_SpecialDeclFull( 92, 0, int, Polyobj_OR_Move, (int, int, int, int));
ACS_SpecialDeclFull( 93, 0, int, Polyobj_OR_MoveTimes8, (int, int, int, int));
ACS_SpecialDeclFull( 94, 0, int, Pillar_BuildAndCrush, (int, int, int, int));
ACS_SpecialDeclFull( 95, 0, int, FloorAndCeiling_LowerByValue, (int, int, int));
ACS_SpecialDeclFull( 96, 0, int, FloorAndCeiling_RaiseByValue, (int, int, int));
ACS_SpecialDeclFull(109, 0, int, Light_ForceLightning, (int));
ACS_SpecialDeclFull(110, 0, int, Light_RaiseByValue, (int, int));
ACS_SpecialDeclFull(111, 0, int, Light_LowerByValue, (int, int));
ACS_SpecialDeclFull(112, 0, int, Light_ChangeToValue, (int, int));
ACS_SpecialDeclFull(113, 0, int, Light_Fade, (int, int, int));
ACS_SpecialDeclFull(114, 0, int, Light_Glow, (int, int, int, int));
ACS_SpecialDeclFull(115, 0, int, Light_Flicker, (int, int, int));
ACS_SpecialDeclFull(116, 0, int, Light_Strobe, (int, int, int, int, int));
ACS_SpecialDeclFull(120, 0, int, Radius_Quake, (int, int, int, int, int));
ACS_SpecialDeclFull(130, 0, int, Thing_Activate, (int));
ACS_SpecialDeclFull(131, 0, int, Thing_Deactivate, (int));
ACS_SpecialDeclFull(132, 0, int, Thing_Remove, (int));
ACS_SpecialDeclFull(133, 2, int, Thing_Destroy, (int, int, int));
ACS_SpecialDeclFull(134, 0, int, Thing_Projectile, (int, int, int, int, int));
ACS_SpecialDeclFull(135, 1, int, Thing_Spawn, (int, int, int, int));
ACS_SpecialDeclFull(136, 0, int, Thing_ProjectileGravity, (int, int, int, int, int));
ACS_SpecialDeclFull(137, 1, int, Thing_SpawnNoFog, (int, int, int, int));
ACS_SpecialDeclFull(138, 0, int, Floor_Waggle, (int, int, int, int, int));
ACS_SpecialDeclFull(140, 0, int, Sector_ChangeSound, (int, int));
#endif//__GDCC_Header__C__ACS_Hexen__Special_h__

View file

@ -1,161 +0,0 @@
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Defines from Hexen's ACS.
//
// This file incorporates definitions from Hexen's acc's defs.acs.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Hexen__defs_h__
#define __GDCC_Header__C__ACS_Hexen__defs_h__
//----------------------------------------------------------------------------|
// Macros |
//
#define TRUE 1
#define FALSE 0
#define ON 1
#define OFF 0
#define YES 1
#define NO 0
#define LINE_FRONT 0
#define LINE_BACK 1
#define SIDE_FRONT 0
#define SIDE_BACK 1
#define TEXTURE_TOP 0
#define TEXTURE_MIDDLE 1
#define TEXTURE_BOTTOM 2
#define GAME_SINGLE_PLAYER 0
#define GAME_NET_COOPERATIVE 1
#define GAME_NET_DEATHMATCH 2
#define CLASS_FIGHTER 0
#define CLASS_CLERIC 1
#define CLASS_MAGE 2
#define SKILL_VERY_EASY 0
#define SKILL_EASY 1
#define SKILL_NORMAL 2
#define SKILL_HARD 3
#define SKILL_VERY_HARD 4
#define T_NONE 0
#define T_CENTAUR 1
#define T_CENTAURLEADER 2
#define T_DEMON 3
#define T_ETTIN 4
#define T_FIREGARGOYLE 5
#define T_WATERLURKER 6
#define T_WATERLURKERLEADER 7
#define T_WRAITH 8
#define T_WRAITHBURIED 9
#define T_FIREBALL1 10
#define T_MANA1 11
#define T_MANA2 12
#define T_ITEMBOOTS 13
#define T_ITEMEGG 14
#define T_ITEMFLIGHT 15
#define T_ITEMSUMMON 16
#define T_ITEMTPORTOTHER 17
#define T_ITEMTELEPORT 18
#define T_BISHOP 19
#define T_ICEGOLEM 20
#define T_BRIDGE 21
#define T_DRAGONSKINBRACERS 22
#define T_ITEMHEALTHPOTION 23
#define T_ITEMHEALTHFLASK 24
#define T_ITEMHEALTHFULL 25
#define T_ITEMBOOSTMANA 26
#define T_FIGHTERAXE 27
#define T_FIGHTERHAMMER 28
#define T_FIGHTERSWORD1 29
#define T_FIGHTERSWORD2 30
#define T_FIGHTERSWORD3 31
#define T_CLERICSTAFF 32
#define T_CLERICHOLY1 33
#define T_CLERICHOLY2 34
#define T_CLERICHOLY3 35
#define T_MAGESHARDS 36
#define T_MAGESTAFF1 37
#define T_MAGESTAFF2 38
#define T_MAGESTAFF3 39
#define T_MORPHBLAST 40
#define T_ROCK1 41
#define T_ROCK2 42
#define T_ROCK3 43
#define T_DIRT1 44
#define T_DIRT2 45
#define T_DIRT3 46
#define T_DIRT4 47
#define T_DIRT5 48
#define T_DIRT6 49
#define T_ARROW 50
#define T_DART 51
#define T_POISONDART 52
#define T_RIPPERBALL 53
#define T_STAINEDGLASS1 54
#define T_STAINEDGLASS2 55
#define T_STAINEDGLASS3 56
#define T_STAINEDGLASS4 57
#define T_STAINEDGLASS5 58
#define T_STAINEDGLASS6 59
#define T_STAINEDGLASS7 60
#define T_STAINEDGLASS8 61
#define T_STAINEDGLASS9 62
#define T_STAINEDGLASS0 63
#define T_BLADE 64
#define T_ICESHARD 65
#define T_FLAME_SMALL 66
#define T_FLAME_LARGE 67
#define T_MESHARMOR 68
#define T_FALCONSHIELD 69
#define T_PLATINUMHELM 70
#define T_AMULETOFWARDING 71
#define T_ITEMFLECHETTE 72
#define T_ITEMTORCH 73
#define T_ITEMREPULSION 74
#define T_MANA3 75
#define T_PUZZSKULL 76
#define T_PUZZGEMBIG 77
#define T_PUZZGEMRED 78
#define T_PUZZGEMGREEN1 79
#define T_PUZZGEMGREEN2 80
#define T_PUZZGEMBLUE1 81
#define T_PUZZGEMBLUE2 82
#define T_PUZZBOOK1 83
#define T_PUZZBOOK2 84
#define T_METALKEY 85
#define T_SMALLMETALKEY 86
#define T_AXEKEY 87
#define T_FIREKEY 88
#define T_GREENKEY 89
#define T_MACEKEY 90
#define T_SILVERKEY 91
#define T_RUSTYKEY 92
#define T_HORNKEY 93
#define T_SERPENTKEY 94
#define T_WATERDRIP 95
#define T_TEMPSMALLFLAME 96
#define T_PERMSMALLFLAME 97
#define T_TEMPLARGEFLAME 98
#define T_PERMLARGEFLAME 99
#define T_DEMON_MASH 100
#define T_DEMON2_MASH 101
#define T_ETTIN_MASH 102
#define T_CENTAUR_MASH 103
#define T_THRUSTSPIKEUP 104
#define T_THRUSTSPIKEDOWN 105
#define T_FLESH_DRIP1 106
#define T_FLESH_DRIP2 107
#define T_SPARK_DRIP 108
#endif//__GDCC_Header__C__ACS_Hexen__defs_h__

View file

@ -1,26 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Declarations and definitions from ZDoom's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_ZDoom_h__
#define __GDCC_Header__C__ACS_ZDoom_h__
#include <ACS_Hexen.h>
#include <ACS_ZDoom/AsmFunc.h>
#include <ACS_ZDoom/Native.h>
#include <ACS_ZDoom/Special.h>
#include <ACS_ZDoom/defs.h>
#endif//__GDCC_Header__C__ACS_ZDoom_h__

View file

@ -1,188 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "AsmFunc" functions from ZDoom's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_ZDoom__AsmFunc_h__
#define __GDCC_Header__C__ACS_ZDoom__AsmFunc_h__
#include <ACS_Hexen/AsmFunc.h>
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_AsmFuncDeclFull( 85, , 0, void, BeginHudMessage, (void));
ACS_AsmFuncDeclFull( 85, , 0, void, BeginHudMessageBold, (void));
ACS_AsmFuncDeclFull( 85, , 0, void, BeginLog, (void));
ACS_AsmFuncDeclFull( 85, , 0, void, BeginStrParam, (void));
ACS_AsmFuncDeclFull(102, , 0, void, ActivatorSound, (__str, int));
ACS_AsmFuncDeclFull(103, , 0, void, LocalAmbientSound, (__str, int));
ACS_AsmFuncDeclFull(104, , 0, void, SetLineMonsterBlocking, (int, int));
ACS_AsmFuncDeclFull(118, , 0, int, IsNetworkGame, (void));
ACS_AsmFuncDeclFull(122, , 0, int, PlayerFrags, (void));
ACS_AsmFuncDeclFull(131, , 0, void, PrintName, (int));
ACS_AsmFuncDeclFull(136, , 0, int, FixedMul, (int, int));
ACS_AsmFuncDeclFull(137, , 0, int, FixedDiv, (int, int));
ACS_AsmFuncDeclFull(138, 139, 0, void, SetGravity, (_Accum));
ACS_AsmFuncDeclFull(140, 141, 0, void, SetAirControl, (_Accum));
ACS_AsmFuncDeclFull(142, , 0, void, ClearInventory, (void));
ACS_AsmFuncDeclFull(143, 144, 0, void, GiveInventory, (__str, int));
ACS_AsmFuncDeclFull(145, 146, 0, void, TakeInventory, (__str, int));
ACS_AsmFuncDeclFull(147, 148, 0, int, CheckInventory, (__str));
ACS_AsmFuncDeclFull(149, 150, 2, int, Spawn, (__str, _Accum, _Accum, _Accum, int, int));
ACS_AsmFuncDeclFull(151, 152, 2, int, SpawnSpot, (__str, int, int, int));
ACS_AsmFuncDeclFull(153, 154, 2, void, SetMusic, (__str, int, int));
ACS_AsmFuncDeclFull(155, 156, 2, void, LocalSetMusic, (__str, int, int));
ACS_AsmFuncDeclFull(157, , 0, void, PrintFixed, (_Accum));
ACS_AsmFuncDeclFull(158, , 0, void, PrintLocalized, (__str));
ACS_AsmFuncDeclFull(159, , 0, void, MoreHudMessage, (void));
ACS_AsmFuncDeclFull(160, , 0, void, OptHudMessage, (int, int, int, _Accum, _Accum, _Accum));
ACS_AsmFuncDeclFull(160, , 0, void, OptHudMessageS, (int, int, __str, _Accum, _Accum, _Accum));
ACS_AsmFuncDeclFull(161, , 0, void, EndHudMessage, (...));
ACS_AsmFuncDeclFull(161, , 0, void, EndHudMessageX, (_Accum));
ACS_AsmFuncDeclFull(161, , 0, void, EndHudMessageXX, (_Accum, _Accum));
ACS_AsmFuncDeclFull(161, , 0, void, EndHudMessageXXX, (_Accum, _Accum, _Accum));
ACS_AsmFuncDeclFull(162, , 0, void, EndHudMessageBold, (...));
ACS_AsmFuncDeclFull(162, , 0, void, EndHudMessageBoldX, (_Accum));
ACS_AsmFuncDeclFull(162, , 0, void, EndHudMessageBoldXX, (_Accum, _Accum));
ACS_AsmFuncDeclFull(162, , 0, void, EndHudMessageBoldXXX, (_Accum, _Accum, _Accum));
ACS_AsmFuncDeclFull(165, 166, 0, void, SetFont, (__str));
ACS_AsmFuncDeclFull(180, , 5, void, SetThingSpecial, (int, int, int, int, int, int, int));
ACS_AsmFuncDeclFull(190, , 0, void, FadeTo, (int, int, int, _Accum, _Accum));
ACS_AsmFuncDeclFull(191, , 0, void, FadeRange, (int, int, int, _Accum, int, int, int, _Accum, _Accum));
ACS_AsmFuncDeclFull(192, , 0, void, CancelFade, (void));
ACS_AsmFuncDeclFull(193, , 0, int, PlayMovie, (__str));
ACS_AsmFuncDeclFull(194, , 5, void, SetFloorTrigger, (int, int, int, int, int, int, int, int));
ACS_AsmFuncDeclFull(195, , 5, void, SetCeilingTrigger, (int, int, int, int, int, int, int, int));
ACS_AsmFuncDeclFull(196, , 0, _Accum, GetActorX, (int));
ACS_AsmFuncDeclFull(197, , 0, _Accum, GetActorY, (int));
ACS_AsmFuncDeclFull(198, , 0, _Accum, GetActorZ, (int));
ACS_AsmFuncDeclFull(199, , 0, void, CreateTranslationStart, (int));
ACS_AsmFuncDeclFull(200, , 0, void, CreateTranslationPalette, (int, int, int, int));
ACS_AsmFuncDeclFull(201, , 0, void, CreateTranslationRGB, (int, int, int, int, int, int, int, int));
ACS_AsmFuncDeclFull(202, , 0, void, CreateTranslationEnd, (void));
ACS_AsmFuncDeclFull(220, , 0, _Accum, Sin, (_Accum));
ACS_AsmFuncDeclFull(221, , 0, _Accum, Cos, (_Accum));
ACS_AsmFuncDeclFull(222, , 0, _Accum, VectorAngle, (_Accum, _Accum));
ACS_AsmFuncDeclFull(223, , 0, int, CheckWeapon, (__str));
ACS_AsmFuncDeclFull(224, , 0, int, SetWeapon, (__str));
ACS_AsmFuncDeclFull(244, , 0, void, SetMarineWeapon, (int, int));
ACS_AsmFuncDeclFull(245, , 0, void, SetActorProperty, (int, int, int));
ACS_AsmFuncDeclFull(245, , 0, void, SetActorPropertyFixed, (int, int, _Accum));
ACS_AsmFuncDeclFull(245, , 0, void, SetActorPropertyString, (int, int, __str));
ACS_AsmFuncDeclFull(246, , 0, int, GetActorProperty, (int, int));
ACS_AsmFuncDeclFull(246, , 0, _Accum, GetActorPropertyFixed, (int, int));
ACS_AsmFuncDeclFull(246, , 0, __str, GetActorPropertyString, (int, int));
ACS_AsmFuncDeclFull(247, , 0, int, PlayerNumber, (void));
ACS_AsmFuncDeclFull(248, , 0, int, ActivatorTID, (void));
ACS_AsmFuncDeclFull(249, , 0, void, SetMarineSprite, (int, __str));
ACS_AsmFuncDeclFull(250, , 0, int, GetScreenWidth, (void));
ACS_AsmFuncDeclFull(251, , 0, int, GetScreenHeight, (void));
ACS_AsmFuncDeclFull(252, , 3, void, Thing_Projectile2, (int, int, int, int, int, int, int));
ACS_AsmFuncDeclFull(253, , 0, int, StrLen, (__str));
ACS_AsmFuncDeclFull(254, , 1, void, SetHudSize, (int, int, int));
ACS_AsmFuncDeclFull(255, , 0, int, GetCVar, (__str));
ACS_AsmFuncDeclFull(255, , 0, _Accum, GetCVarFixed, (__str));
ACS_AsmFuncDeclFull(257, , 0, void, SetResultValue, (int));
ACS_AsmFuncDeclFull(257, , 0, void, SetResultValueFixed, (_Accum));
ACS_AsmFuncDeclFull(258, , 0, int, GetLineRowOffset, (void));
ACS_AsmFuncDeclFull(259, , 0, _Accum, GetActorFloorZ, (int));
ACS_AsmFuncDeclFull(260, , 0, _Accum, GetActorAngle, (int));
ACS_AsmFuncDeclFull(261, , 0, _Accum, GetSectorFloorZ, (int, int, int));
ACS_AsmFuncDeclFull(262, , 0, _Accum, GetSectorCeilingZ, (int, int, int));
ACS_AsmFuncDeclFull(264, , 0, int, GetSigilPieces, (void));
ACS_AsmFuncDeclFull(265, , 0, int, GetLevelInfo, (int));
ACS_AsmFuncDeclFull(266, , 0, void, ChangeSky, (__str, __str));
ACS_AsmFuncDeclFull(267, , 0, int, PlayerInGame, (int));
ACS_AsmFuncDeclFull(268, , 0, int, PlayerIsBot, (int));
ACS_AsmFuncDeclFull(269, , 0, void, SetCameraToTexture, (int, __str, int));
ACS_AsmFuncDeclFull(270, , 0, void, EndLog, (void));
ACS_AsmFuncDeclFull(271, , 0, int, GetAmmoCapacity, (__str));
ACS_AsmFuncDeclFull(272, , 0, void, SetAmmoCapacity, (__str, int));
ACS_AsmFuncDeclFull(273, , 0, void, PrintMapCharArray, (int, int));
ACS_AsmFuncDeclFull(274, , 0, void, PrintWorldCharArray, (int, int));
ACS_AsmFuncDeclFull(275, , 0, void, PrintGlobalCharArray, (int, int));
ACS_AsmFuncDeclFull(276, , 0, void, SetActorAngle, (int, _Accum));
ACS_AsmFuncDeclFull(280, , 0, void, SpawnProjectile, (int, __str, int, int, int, int, int));
ACS_AsmFuncDeclFull(281, , 0, int, GetSectorLightLevel, (int));
ACS_AsmFuncDeclFull(282, , 0, _Accum, GetActorCeilingZ, (int));
ACS_AsmFuncDeclFull(283, , 1, int, SetActorPosition, (int, _Accum, _Accum, _Accum, int));
ACS_AsmFuncDeclFull(284, , 0, void, ClearActorInventory, (int));
ACS_AsmFuncDeclFull(285, , 0, void, GiveActorInventory, (int, __str, int));
ACS_AsmFuncDeclFull(286, , 0, void, TakeActorInventory, (int, __str, int));
ACS_AsmFuncDeclFull(287, , 0, int, CheckActorInventory, (int, __str));
ACS_AsmFuncDeclFull(288, , 0, int, ThingCountName, (__str, int));
ACS_AsmFuncDeclFull(289, , 1, int, SpawnSpotFacing, (__str, int, int));
ACS_AsmFuncDeclFull(290, , 0, int, PlayerClass, (int));
ACS_AsmFuncDeclFull(326, , 0, int, GetPlayerInfo, (int, int));
ACS_AsmFuncDeclFull(327, , 0, void, ChangeLevel, (__str, int, int, int));
ACS_AsmFuncDeclFull(328, , 0, void, SectorDamage, (int, int, __str, __str, int));
ACS_AsmFuncDeclFull(329, , 1, void, ReplaceTextures, (__str, __str, int));
ACS_AsmFuncDeclFull(331, , 0, _Accum, GetActorPitch, (int));
ACS_AsmFuncDeclFull(332, , 0, void, SetActorPitch, (int, _Accum));
ACS_AsmFuncDeclFull(333, , 0, void, PrintBind, (__str));
ACS_AsmFuncDeclFull(334, , 1, int, SetActorState, (int, __str, int));
ACS_AsmFuncDeclFull(335, , 0, int, Thing_Damage2, (int, int, __str));
ACS_AsmFuncDeclFull(336, , 0, int, UseInventory, (__str));
ACS_AsmFuncDeclFull(337, , 0, int, UseActorInventory, (int, __str));
ACS_AsmFuncDeclFull(338, , 0, int, CheckActorCeilingTexture, (int, __str));
ACS_AsmFuncDeclFull(339, , 0, int, CheckActorFloorTexture, (int, __str));
ACS_AsmFuncDeclFull(340, , 0, int, GetActorLightLevel, (int));
ACS_AsmFuncDeclFull(341, , 0, void, SetMugShotState, (__str));
ACS_AsmFuncDeclFull(342, , 0, int, ThingCountSector, (int, int, int));
ACS_AsmFuncDeclFull(343, , 0, int, ThingCountNameSector, (__str, int, int));
ACS_AsmFuncDeclFull(344, , 0, int, CheckPlayerCamera, (int));
ACS_AsmFuncDeclFull(345, , 0, int, MorphActor, (int, __str, __str, int, int, __str, __str));
ACS_AsmFuncDeclFull(346, , 1, int, UnMorphActor, (int, int));
ACS_AsmFuncDeclFull(347, , 0, int, GetPlayerInput, (int, int));
ACS_AsmFuncDeclFull(347, , 0, _Accum, GetPlayerInputFixed, (int, int));
ACS_AsmFuncDeclFull(348, , 0, int, ClassifyActor, (int));
ACS_AsmFuncDeclFull(349, , 0, void, PrintBinary, (int));
ACS_AsmFuncDeclFull(350, , 0, void, PrintHex, (int));
ACS_AsmFuncDeclFull(352, , 0, __str, EndStrParam, (void));
ACS_AsmFuncDeclFull(353, , 0, void, PrintMapCharRange, (int, int, int, int));
ACS_AsmFuncDeclFull(354, , 0, void, PrintWorldCharRange, (int, int, int, int));
ACS_AsmFuncDeclFull(355, , 0, void, PrintGlobalCharRange, (int, int, int, int));
ACS_AsmFuncDeclFull(356, , 0, int, StrCpyToMapCharRange, (int, int, int, int, __str, int));
ACS_AsmFuncDeclFull(356, , 0, int, StrArsCpyToMapCharRange, (int, int, int, int, char __str_ars const *));
ACS_AsmFuncDeclFull(357, , 0, int, StrCpyToWorldCharRange, (int, int, int, int, __str, int));
ACS_AsmFuncDeclFull(357, , 0, int, StrArsCpyToWorldCharRange, (int, int, int, int, char __str_ars const *));
ACS_AsmFuncDeclFull(358, , 0, int, StrCpyToGlobalCharRange, (int, int, int, int, __str, int));
ACS_AsmFuncDeclFull(358, , 0, int, StrArsCpyToGlobalCharRange, (int, int, int, int, char __str_ars const *));
ACS_AsmFuncDeclFull(361, , 0, void, NamedScriptWait, (__str), delay);
ACS_AsmFuncDeclFull(362, , 0, void, CreateTranslationDesat, (int, int, _Accum, _Accum, _Accum, _Accum, _Accum, _Accum));
ACS_AsmFuncDeclFull(378, , 0, void, PrintLocalCharArray, (int, int));
ACS_AsmFuncDeclFull(379, , 0, void, PrintLocalCharRange, (int, int, int, int));
ACS_AsmFuncDeclFull(380, , 0, int, StrCpyToLocalCharRange, (int, int, int, int, __str, int));
#endif//__GDCC_Header__C__ACS_ZDoom__AsmFunc_h__

View file

@ -1,197 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "Native" functions from ZDoom's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_ZDoom__Native_h__
#define __GDCC_Header__C__ACS_ZDoom__Native_h__
//----------------------------------------------------------------------------|
// Macros |
//
//
// ACS_NativeDecl
//
#if __GDCC__
#define ACS_NativeDecl(addr, oarg, ...) \
[[__address(addr), __call("Native"), __optional_args(oarg)]] [[__VA_ARGS__]]
#else
#define ACS_NativeDecl(addr, oarg, ...)
#endif
//
// ACS_NativeDeclFull
//
#ifndef ACS_SHORT_NAMES
#define ACS_NativeDeclFull(addr, oarg, retn, name, args, ...) \
ACS_NativeDeclPre(addr, oarg, retn, name, args, __VA_ARGS__)
#else
#define ACS_NativeDeclFull(addr, oarg, retn, name, args, ...) \
ACS_NativeDeclPre(addr, oarg, retn, name, args, __VA_ARGS__); \
ACS_NativeDeclRaw(addr, oarg, retn, name, args, __VA_ARGS__)
#endif
//
// ACS_NativeDeclPre
//
#define ACS_NativeDeclPre(addr, oarg, retn, name, args, ...) \
ACS_NativeDecl(addr, oarg, __VA_ARGS__) extern retn (ACS_##name) args
//
// ACS_NativeDeclRaw
//
#define ACS_NativeDeclRaw(addr, oarg, retn, name, args, ...) \
ACS_NativeDecl(addr, oarg, __VA_ARGS__) extern retn (name) args
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_NativeDeclFull( 1, 0, int, GetLineUDMFInt, (int, __str));
ACS_NativeDeclFull( 2, 0, _Accum, GetLineUDMFFixed, (int, __str));
ACS_NativeDeclFull( 3, 0, int, GetThingUDMFInt, (int, __str));
ACS_NativeDeclFull( 4, 0, _Accum, GetThingUDMFFixed, (int, __str));
ACS_NativeDeclFull( 5, 0, int, GetSectorUDMFInt, (int, __str));
ACS_NativeDeclFull( 6, 0, _Accum, GetSectorUDMFFixed, (int, __str));
ACS_NativeDeclFull( 7, 0, int, GetSideUDMFInt, (int, int, __str));
ACS_NativeDeclFull( 8, 0, _Accum, GetSideUDMFFixed, (int, int, __str));
ACS_NativeDeclFull( 9, 0, _Accum, GetActorVelX, (int));
ACS_NativeDeclFull( 10, 0, _Accum, GetActorVelY, (int));
ACS_NativeDeclFull( 11, 0, _Accum, GetActorVelZ, (int));
ACS_NativeDeclFull( 12, 1, int, SetActivator, (int, int));
ACS_NativeDeclFull( 13, 0, int, SetActivatorToTarget, (int));
ACS_NativeDeclFull( 14, 0, _Accum, GetActorViewHeight, (int));
ACS_NativeDeclFull( 15, 0, int, GetChar, (__str, int));
ACS_NativeDeclFull( 16, 0, int, GetAirSupply, (int));
ACS_NativeDeclFull( 17, 0, int, SetAirSupply, (int, int));
ACS_NativeDeclFull( 18, 0, int, SetSkyScrollSpeed, (int, _Accum));
ACS_NativeDeclFull( 19, 0, int, GetArmorType, (__str, int));
ACS_NativeDeclFull( 20, 2, int, SpawnSpotForced, (__str, int, int, int));
ACS_NativeDeclFull( 21, 1, int, SpawnSpotFacingForced, (__str, int, int));
ACS_NativeDeclFull( 22, 0, int, CheckActorProperty, (int, int, int));
ACS_NativeDeclFull( 22, 0, int, CheckActorPropertyFixed, (int, int, _Accum));
ACS_NativeDeclFull( 22, 0, int, CheckActorPropertyString, (int, int, __str));
ACS_NativeDeclFull( 23, 0, int, SetActorVelocity, (int, _Accum, _Accum, _Accum, int, int));
ACS_NativeDeclFull( 24, 0, int, SetUserVariable, (int, __str, int));
ACS_NativeDeclFull( 24, 0, int, SetUserVariableFixed, (int, __str, _Accum));
ACS_NativeDeclFull( 25, 0, int, GetUserVariable, (int, __str));
ACS_NativeDeclFull( 25, 0, _Accum, GetUserVariableFixed, (int, __str));
ACS_NativeDeclFull( 25, 0, __str, GetUserVariableString, (int, __str));
ACS_NativeDeclFull( 26, 0, int, Radius_Quake2, (int, int, int, int, int, __str));
ACS_NativeDeclFull( 27, 0, int, CheckActorClass, (int, __str));
ACS_NativeDeclFull( 28, 0, int, SetUserArray, (int, __str, int, int));
ACS_NativeDeclFull( 28, 0, int, SetUserArrayFixed, (int, __str, int, _Accum));
ACS_NativeDeclFull( 29, 0, int, GetUserArray, (int, __str, int));
ACS_NativeDeclFull( 29, 0, _Accum, GetUserArrayFixed, (int, __str, int));
ACS_NativeDeclFull( 29, 0, __str, GetUserArrayString, (int, __str, int));
ACS_NativeDeclFull( 30, 0, int, SoundSequenceOnActor, (int, __str));
ACS_NativeDeclFull( 31, 0, int, SoundSequenceOnSector, (int, __str, int));
ACS_NativeDeclFull( 32, 0, int, SoundSequenceOnPolyobj, (int, __str));
ACS_NativeDeclFull( 33, 0, _Accum, GetPolyobjX, (int));
ACS_NativeDeclFull( 34, 0, _Accum, GetPolyobjY, (int));
ACS_NativeDeclFull( 35, 0, int, CheckSight, (int, int, int));
ACS_NativeDeclFull( 36, 2, int, SpawnForced, (__str, _Accum, _Accum, _Accum, int, int));
ACS_NativeDeclFull( 38, 2, int, SetPointer, (int, int, int, int));
ACS_NativeDeclRaw( 39, 3, int, ACS_NamedExecute, (__str, int, int, int, int));
ACS_NativeDeclRaw( 40, 0, int, ACS_NamedSuspend, (__str, int));
ACS_NativeDeclRaw( 41, 0, int, ACS_NamedTerminate, (__str, int));
ACS_NativeDeclRaw( 42, 0, int, ACS_NamedLockedExecute, (__str, int, int, int, int));
ACS_NativeDeclRaw( 43, 0, int, ACS_NamedLockedExecuteDoor, (__str, int, int, int, int));
ACS_NativeDeclRaw( 44, 4, int, ACS_NamedExecuteWithResult, (__str, int, int, int, int));
ACS_NativeDeclRaw( 45, 3, int, ACS_NamedExecuteAlways, (__str, int, int, int, int));
ACS_NativeDeclFull( 46, 2, int, UniqueTID, (int, int));
ACS_NativeDeclFull( 47, 0, int, IsTIDUsed, (int));
ACS_NativeDeclFull( 48, 0, int, Sqrt, (int));
ACS_NativeDeclFull( 49, 0, _Accum, FixedSqrt, (_Accum));
ACS_NativeDeclFull( 50, 0, _Accum, VectorLength, (_Accum, _Accum));
ACS_NativeDeclFull( 51, 2, int, SetHudClipRect, (int, int, int, int, int, int));
ACS_NativeDeclFull( 52, 0, int, SetHudWrapWidth, (int));
ACS_NativeDeclFull( 53, 0, int, SetCVar, (__str, int));
ACS_NativeDeclFull( 53, 0, int, SetCVarFixed, (__str, _Accum));
ACS_NativeDeclFull( 54, 0, int, GetUserCVar, (int, __str));
ACS_NativeDeclFull( 54, 0, _Accum, GetUserCVarFixed, (int, __str));
ACS_NativeDeclFull( 55, 0, int, SetUserCVar, (int, __str, int));
ACS_NativeDeclFull( 55, 0, int, SetUserCVarFixed, (int, __str, _Accum));
ACS_NativeDeclFull( 56, 0, __str, GetCVarString, (__str));
ACS_NativeDeclFull( 57, 0, int, SetCVarString, (__str, __str));
ACS_NativeDeclFull( 58, 0, __str, GetUserCVarString, (int, __str));
ACS_NativeDeclFull( 59, 0, int, SetUserCVarString, (int, __str, __str));
ACS_NativeDeclFull( 60, 5, int, LineAttack, (int, _Accum, _Accum, int, __str, __str, _Accum, int, int));
ACS_NativeDeclFull( 61, 5, int, PlaySound, (int, __str, int, _Accum, int, _Accum, int));
ACS_NativeDeclFull( 62, 1, int, StopSound, (int, int));
ACS_NativeDeclFull( 63, 1, int, StrCmp, (__str, __str, int));
ACS_NativeDeclFull( 64, 1, int, StrCaseCmp, (__str, __str, int));
ACS_NativeDeclFull( 64, 1, int, StrICmp, (__str, __str, int));
ACS_NativeDeclFull( 65, 0, __str, StrLeft, (__str, int));
ACS_NativeDeclFull( 66, 0, __str, StrRight, (__str, int));
ACS_NativeDeclFull( 67, 0, __str, StrMid, (__str, int, int));
ACS_NativeDeclFull( 68, 0, __str, GetActorClass, (int));
ACS_NativeDeclFull( 69, 0, __str, GetWeapon, (void));
ACS_NativeDeclFull( 70, 0, int, SoundVolume, (int, int, _Accum));
ACS_NativeDeclFull( 71, 4, int, PlayActorSound, (int, int, int, _Accum, int, _Accum));
ACS_NativeDeclFull( 72, 4, int, SpawnDecal, (int, __str, int, _Accum, _Accum, _Accum));
ACS_NativeDeclFull( 73, 0, int, CheckFont, (__str));
ACS_NativeDeclFull( 74, 0, int, DropItem, (int, __str, int, int));
ACS_NativeDeclFull( 75, 0, int, CheckFlag, (int, __str));
ACS_NativeDeclFull( 76, 0, int, SetLineActivation, (int, int));
ACS_NativeDeclFull( 77, 0, int, GetLineActivation, (int));
ACS_NativeDeclFull( 78, 0, int, GetActorPowerupTics, (int, __str));
ACS_NativeDeclFull( 79, 1, int, ChangeActorAngle, (int, _Accum, int));
ACS_NativeDeclFull( 80, 1, int, ChangeActorPitch, (int, _Accum, int));
ACS_NativeDeclFull( 81, 0, int, GetArmorInfo, (int));
ACS_NativeDeclFull( 81, 0, _Accum, GetArmorInfoFixed, (int));
ACS_NativeDeclFull( 81, 0, __str, GetArmorInfoString, (int));
ACS_NativeDeclFull( 82, 0, int, DropInventory, (int, __str));
ACS_NativeDeclFull( 83, 3, int, PickActor, (int, _Accum, _Accum, _Accum, int, int, int, int));
ACS_NativeDeclFull( 84, 2, int, IsPointerEqual, (int, int, int, int));
ACS_NativeDeclFull( 85, 0, int, CanRaiseActor, (int));
ACS_NativeDeclFull( 86, 0, int, SetActorTeleFog, (int, __str, __str));
ACS_NativeDeclFull( 87, 0, int, SwapActorTeleFog, (int));
ACS_NativeDeclFull( 88, 0, int, SetActorRoll, (int, _Accum));
ACS_NativeDeclFull( 89, 0, int, ChangeActorRoll, (int, _Accum, int));
ACS_NativeDeclFull( 90, 0, _Accum, GetActorRoll, (int));
ACS_NativeDeclFull( 91, 4, int, QuakeEx, (int, int, int, int, int, int, int, __str, int, _Accum, _Accum, _Accum));
ACS_NativeDeclFull( 92, 5, int, Warp, (int, _Accum, _Accum, _Accum, _Accum, int, __str, int, _Accum, _Accum, _Accum));
ACS_NativeDeclFull( 93, 0, int, GetMaxInventory, (int, __str));
ACS_NativeDeclFull( 94, 3, int, SetSectorDamage, (int, int, __str, int, int));
ACS_NativeDeclFull( 95, 0, int, SetSectorTerrain, (int, int, __str));
ACS_NativeDeclFull( 96,14, int, SpawnParticle, (int, int, int, int, _Accum, _Accum, _Accum, _Accum, _Accum, _Accum, _Accum, _Accum, _Accum, int, int));
ACS_NativeDeclFull( 97, 0, int, SetMusicVolume, (_Accum));
ACS_NativeDeclFull( 98, 3, int, CheckProximity, (int, __str, _Accum, int, int, int));
ACS_NativeDeclFull( 99, 1, int, CheckActorState, (int, __str, int));
ACS_NativeDeclFull(200, 2, int, CheckClass, (__str, int, int));
ACS_NativeDeclFull(201, 0, int, DamageActor, (int, int, int, int, int, __str));
ACS_NativeDeclFull(202, 0, int, SetActorFlag, (int, __str, int));
ACS_NativeDeclFull(203, 0, int, SetTranslation, (int, __str));
ACS_NativeDeclFull(204, 0, __str, GetActorFloorTexture, (int));
ACS_NativeDeclFull(205, 0, __str, GetActorFloorTerrain, (int));
ACS_NativeDeclFull(206, 0, int, StrArg, (__str));
ACS_NativeDeclFull(207, 0, _Accum, Floor, (_Accum));
ACS_NativeDeclFull(208, 0, _Accum, Round, (_Accum));
ACS_NativeDeclFull(209, 0, _Accum, Ceil, (_Accum));
ACS_NativeDeclFull(210, 0, int, ScriptCall, (__str, __str, ...));
ACS_NativeDeclFull(210, 0, _Accum, ScriptCallFixed, (__str, __str, ...));
ACS_NativeDeclFull(210, 0, __str, ScriptCallString, (__str, __str, ...));
ACS_NativeDeclFull(300, 0, _Accum, GetLineX, (int, _Accum, _Accum));
ACS_NativeDeclFull(301, 0, _Accum, GetLineY, (int, _Accum, _Accum));
ACS_NativeDeclFull(400, 0, int, SetSectorGlow, (int, int, int, int, int, int));
ACS_NativeDeclFull(401, 0, int, SetFogDensity, (int, int));
#endif//__GDCC_Header__C__ACS_ZDoom__Native_h__

View file

@ -1,202 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "Special" functions from ZDoom's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_ZDoom__Special_h__
#define __GDCC_Header__C__ACS_ZDoom__Special_h__
#include <ACS_Hexen/Special.h>
//----------------------------------------------------------------------------|
// Global Functions |
//
ACS_SpecialDeclFull( 14, 0, int, Door_Animated, (int, int, int));
ACS_SpecialDeclFull( 15, 0, int, Autosave, (void));
ACS_SpecialDeclFull( 17, 1, int, Thing_Raise, (int, int));
ACS_SpecialDeclFull( 18, 1, int, StartConversation, (int, int));
ACS_SpecialDeclFull( 19, 0, int, Thing_Stop, (int));
ACS_SpecialDeclFull( 33, 0, int, ForceField, (void));
ACS_SpecialDeclFull( 34, 0, int, ClearForceField, (int));
ACS_SpecialDeclFull( 37, 1, int, Floor_MoveToValue, (int, int, int, int));
ACS_SpecialDeclFull( 38, 0, int, Ceiling_Waggle, (int, int, int, int, int));
ACS_SpecialDeclFull( 39, 0, int, Teleport_ZombieChanger, (int, int));
ACS_SpecialDeclFull( 47, 1, int, Ceiling_MoveToValue, (int, int, int, int));
ACS_SpecialDeclFull( 49, 2, int, GlassBreak, (int, int));
ACS_SpecialDeclFull( 51, 0, int, Sector_SetLink, (int, int, int, int));
ACS_SpecialDeclFull( 52, 0, int, Scroll_Wall, (int, int, int, int, int));
ACS_SpecialDeclFull( 53, 0, int, Line_SetTextureOffset, (int, int, int, int, int));
ACS_SpecialDeclFull( 54, 0, int, Sector_ChangeFlags, (int, int, int));
ACS_SpecialDeclFull( 55, 0, int, Line_SetBlocking, (int, int, int));
ACS_SpecialDeclFull( 56, 0, int, Line_SetTextureScale, (int, int, int, int, int));
ACS_SpecialDeclFull( 57, 0, int, Polyobj_OR_MoveToSpot, (int, int, int));
ACS_SpecialDeclFull( 75, 0, int, Teleport_EndGame, (void));
ACS_SpecialDeclFull( 76, 0, int, TeleportOther, (int, int, int));
ACS_SpecialDeclFull( 77, 0, int, TeleportGroup, (int, int, int, int, int));
ACS_SpecialDeclFull( 78, 1, int, TeleportInSector, (int, int, int, int, int));
ACS_SpecialDeclFull( 79, 0, int, Thing_SetConversation, (int, int));
ACS_SpecialDeclRaw( 84, 4, int, ACS_ExecuteWithResult, (int, int, int, int, int));
ACS_SpecialDeclRaw( 85, 0, int, ACS_LockedExecuteDoor, (int, int, int, int, int));
ACS_SpecialDeclFull( 86, 0, int, Polyobj_MoveToSpot, (int, int, int));
ACS_SpecialDeclFull( 87, 0, int, Polyobj_Stop, (int));
ACS_SpecialDeclFull( 88, 0, int, Polyobj_MoveTo, (int, int, int, int));
ACS_SpecialDeclFull( 89, 0, int, Polyobj_OR_MoveTo, (int, int, int, int));
ACS_SpecialDeclFull( 97, 2, int, Ceiling_LowerAndCrushDist, (int, int, int, int, int));
ACS_SpecialDeclFull( 98, 1, int, Sector_SetTranslucent, (int, int, int, int));
ACS_SpecialDeclFull(104, 1, int, Ceiling_CrushAndRaiseSilentDist, (int, int, int, int, int));
ACS_SpecialDeclFull(107, 0, int, Line_SetPortalTarget, (void));
ACS_SpecialDeclFull(117, 0, int, Light_Stop, (int));
ACS_SpecialDeclFull(119, 1, int, Thing_Damage, (int, int, int));
ACS_SpecialDeclFull(125, 1, int, Thing_Move, (int, int, int));
ACS_SpecialDeclFull(127, 3, int, Thing_SetSpecial, (int, int, int, int, int));
ACS_SpecialDeclFull(128, 0, int, ThrustThingZ, (int, int, int, int));
ACS_SpecialDeclFull(139, 2, int, Thing_SpawnFacing, (int, int, int, int));
ACS_SpecialDeclFull(134, 0, int, Player_RemoveItem, (int, int));
ACS_SpecialDeclFull(135, 0, int, Player_GiveItem, (int, int));
ACS_SpecialDeclFull(154, 1, int, Teleport_NoStop, (int, int, int));
ACS_SpecialDeclFull(157, 0, int, SetGlobalFogParameter, (int, int));
ACS_SpecialDeclFull(158, 3, int, FS_Execute, (int, int, int, int));
ACS_SpecialDeclFull(159, 0, int, Sector_SetPlaneReflection, (int, int, int));
ACS_SpecialDeclFull(168, 2, int, Ceiling_CrushAndRaiseDist, (int, int, int, int, int));
ACS_SpecialDeclFull(169, 0, int, Generic_Crusher2, (int, int, int, int, int));
ACS_SpecialDeclFull(170, 0, int, Sector_SetCeilingScale2, (int, int, int));
ACS_SpecialDeclFull(171, 0, int, SectorSetFloorScale2, (int, int, int));
ACS_SpecialDeclFull(172, 0, int, Plat_UpNearestWaitDownStay, (int, int, int));
ACS_SpecialDeclFull(173, 0, int, NoiseAlert, (int, int));
ACS_SpecialDeclFull(174, 0, int, SendToCommunicator, (int, int, int, int));
ACS_SpecialDeclFull(175, 0, int, Thing_ProjectileIntercept, (int, int, int, int, int));
ACS_SpecialDeclFull(176, 0, int, Thing_ChangeTID, (int, int));
ACS_SpecialDeclFull(177, 1, int, Thing_Hate, (int, int, int));
ACS_SpecialDeclFull(178, 1, int, Thing_ProjectileAimed, (int, int, int, int, int));
ACS_SpecialDeclFull(179, 0, int, ChangeSkill, (int));
ACS_SpecialDeclFull(180, 0, int, Thing_SetTranslation, (int, int));
ACS_SpecialDeclFull(183, 0, int, Line_AlignCeiling, (int, int));
ACS_SpecialDeclFull(184, 0, int, Line_AlignFloor, (int, int));
ACS_SpecialDeclFull(185, 0, int, Sector_SetRotation, (int, int, int));
ACS_SpecialDeclFull(186, 0, int, Sector_SetCeilingPanning, (int, int, int, int, int));
ACS_SpecialDeclFull(187, 0, int, Sector_SetFloorPanning, (int, int, int, int, int));
ACS_SpecialDeclFull(188, 0, int, Sector_SetCeilingScale, (int, int, int, int, int));
ACS_SpecialDeclFull(189, 0, int, Sector_SetFloorScale, (int, int, int, int, int));
ACS_SpecialDeclFull(191, 0, int, SetPlayerProperty, (int, int, int));
ACS_SpecialDeclFull(192, 0, int, Ceiling_LowerToHighestFloor, (int, int));
ACS_SpecialDeclFull(193, 0, int, Ceiling_LowerInstant, (int, int, int));
ACS_SpecialDeclFull(194, 0, int, Ceiling_RaiseInstant, (int, int, int));
ACS_SpecialDeclFull(195, 1, int, Ceiling_CrushRaiseAndStayA, (int, int, int, int, int));
ACS_SpecialDeclFull(196, 1, int, Ceiling_CrushAndRaiseA, (int, int, int, int, int));
ACS_SpecialDeclFull(197, 1, int, Ceiling_CrushAndRaiseSilentA, (int, int, int, int, int));
ACS_SpecialDeclFull(198, 0, int, Ceiling_RaiseByValueTimes8, (int, int, int));
ACS_SpecialDeclFull(199, 0, int, Ceiling_LowerByValueTimes8, (int, int, int));
ACS_SpecialDeclFull(200, 0, int, Generic_Floor, (int, int, int, int, int));
ACS_SpecialDeclFull(201, 0, int, Generic_Ceiling, (int, int, int, int, int));
ACS_SpecialDeclFull(202, 0, int, Generic_Door, (int, int, int, int, int));
ACS_SpecialDeclFull(203, 0, int, Generic_Lift, (int, int, int, int, int));
ACS_SpecialDeclFull(204, 0, int, Generic_Stairs, (int, int, int, int, int));
ACS_SpecialDeclFull(205, 0, int, Generic_Crusher, (int, int, int, int, int));
ACS_SpecialDeclFull(206, 1, int, Plat_DownWaitUpStayLip, (int, int, int, int, int));
ACS_SpecialDeclFull(207, 0, int, Plat_PerpetualRaiseLip, (int, int, int, int));
ACS_SpecialDeclFull(208, 1, int, TranslucentLine, (int, int, int));
ACS_SpecialDeclFull(212, 1, int, Sector_SetColor, (int, int, int, int, int));
ACS_SpecialDeclFull(213, 0, int, Sector_SetFade, (int, int, int, int));
ACS_SpecialDeclFull(214, 0, int, Sector_SetDamage, (int, int, int));
ACS_SpecialDeclFull(216, 0, int, Sector_SetGravity, (int, int, int));
ACS_SpecialDeclFull(217, 0, int, Stairs_BuildUpDoom, (int, int, int, int, int));
ACS_SpecialDeclFull(218, 0, int, Sector_SetWind, (int, int, int, int));
ACS_SpecialDeclFull(219, 0, int, Sector_SetFriction, (int, int));
ACS_SpecialDeclFull(220, 0, int, Sector_SetCurrent, (int, int, int, int));
ACS_SpecialDeclFull(221, 0, int, Scroll_Texture_Both, (int, int, int, int, int));
ACS_SpecialDeclFull(223, 0, int, Scroll_Floor, (int, int, int, int));
ACS_SpecialDeclFull(224, 0, int, Scroll_Ceiling, (int, int, int, int));
ACS_SpecialDeclRaw( 226, 3, int, ACS_ExecuteAlways, (int, int, int, int, int));
ACS_SpecialDeclFull(228, 0, int, Plat_RaiseAndStarTx0, (int, int));
ACS_SpecialDeclFull(229, 1, int, Thing_SetGoal, (int, int, int, int));
ACS_SpecialDeclFull(230, 0, int, Plat_UpByValueStayTx, (int, int, int));
ACS_SpecialDeclFull(231, 0, int, Plat_ToggleCeiling, (int));
ACS_SpecialDeclFull(232, 0, int, Light_StrobeDoom, (int, int, int));
ACS_SpecialDeclFull(233, 0, int, Light_MinNeighbor, (int));
ACS_SpecialDeclFull(234, 0, int, Light_MaxNeighbor, (int));
ACS_SpecialDeclFull(235, 0, int, Floor_TransferTrigger, (int));
ACS_SpecialDeclFull(236, 0, int, Floor_TransferNumeric, (int));
ACS_SpecialDeclFull(237, 0, int, ChangeCamera, (int, int, int));
ACS_SpecialDeclFull(238, 0, int, Floor_RaiseToLowestCeiling, (int, int));
ACS_SpecialDeclFull(239, 0, int, Floor_RaiseByValueTxTy, (int, int, int));
ACS_SpecialDeclFull(240, 0, int, Floor_RaiseByTexture, (int, int));
ACS_SpecialDeclFull(241, 0, int, Floor_LowerToLowestTxTy, (int, int));
ACS_SpecialDeclFull(242, 1, int, Floor_LowerToHighest, (int, int, int, int));
ACS_SpecialDeclFull(243, 0, int, Exit_Normal, (int));
ACS_SpecialDeclFull(244, 0, int, Exit_Secret, (int));
ACS_SpecialDeclFull(245, 0, int, Elevator_RaiseToNearest, (int, int));
ACS_SpecialDeclFull(246, 0, int, Elevator_MoveToFloor, (int, int));
ACS_SpecialDeclFull(247, 0, int, Elevator_LowerToNearest, (int, int));
ACS_SpecialDeclFull(248, 1, int, HealThing, (int, int));
ACS_SpecialDeclFull(249, 1, int, Door_CloseWaitOpen, (int, int, int, int));
ACS_SpecialDeclFull(250, 0, int, Floor_Donut, (int, int, int));
ACS_SpecialDeclFull(251, 0, int, FloorAndCeiling_LowerRaise, (int, int, int));
ACS_SpecialDeclFull(252, 0, int, Ceiling_RaiseToNearest, (int, int));
ACS_SpecialDeclFull(253, 0, int, Ceiling_LowerToLowest, (int, int));
ACS_SpecialDeclFull(254, 0, int, Ceiling_LowerToFloor, (int, int));
ACS_SpecialDeclFull(255, 1, int, Ceiling_CrushRaiseAndStaySilA, (int, int, int, int, int));
ACS_SpecialDeclFull(256, 1, int, Floor_LowerToHighestEE, (int, int, int));
ACS_SpecialDeclFull(257, 1, int, Floor_RaiseToLowest, (int, int, int));
ACS_SpecialDeclFull(258, 1, int, Floor_LowerToLowestCeiling, (int, int, int));
ACS_SpecialDeclFull(259, 3, int, Floor_RaiseToCeiling, (int, int, int, int, int));
ACS_SpecialDeclFull(260, 3, int, Floor_ToCeilingInstant, (int, int, int, int));
ACS_SpecialDeclFull(261, 1, int, Floor_LowerByTexture, (int, int, int));
ACS_SpecialDeclFull(262, 1, int, Ceiling_RaiseToHighest, (int, int, int));
ACS_SpecialDeclFull(263, 2, int, Ceiling_ToHighestInstant, (int, int, int));
ACS_SpecialDeclFull(264, 2, int, Ceiling_LowerToNearest, (int, int, int, int));
ACS_SpecialDeclFull(265, 1, int, Ceiling_RaiseToLowest, (int, int, int));
ACS_SpecialDeclFull(266, 1, int, Ceiling_RaiseToHighestFloor, (int, int, int));
ACS_SpecialDeclFull(267, 3, int, Ceiling_ToFloorInstant, (int, int, int, int));
ACS_SpecialDeclFull(268, 1, int, Ceiling_RaiseByTexture, (int, int, int));
ACS_SpecialDeclFull(269, 2, int, Ceiling_LowerByTexture, (int, int, int, int));
ACS_SpecialDeclFull(270, 0, int, Stairs_BuildDownDoom, (int, int, int, int, int));
ACS_SpecialDeclFull(271, 0, int, Stairs_BuildUpDoomSync, (int, int, int, int));
ACS_SpecialDeclFull(272, 0, int, Stairs_BuildDownDoomSync, (int, int, int, int));
ACS_SpecialDeclFull(273, 0, int, Stairs_BuildUpDoomCrush, (int, int, int, int, int));
ACS_SpecialDeclFull(274, 0, int, Door_AnimatedClose, (int, int));
ACS_SpecialDeclFull(275, 0, int, Floor_Stop, (int));
ACS_SpecialDeclFull(276, 0, int, Ceiling_Stop, (int));
ACS_SpecialDeclFull(277, 0, int, Sector_SetFloorGlow, (int, int, int, int, int));
ACS_SpecialDeclFull(278, 0, int, Sector_SetCeilingGlow, (int, int, int, int, int));
#endif//__GDCC_Header__C__ACS_ZDoom__Special_h__

View file

@ -1,780 +0,0 @@
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Defines from ZDoom's ACS.
//
// This file incorporates definitions from ZDoom's acc's zdefs.acs.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_ZDoom__defs_h__
#define __GDCC_Header__C__ACS_ZDoom__defs_h__
#include <ACS_Hexen/defs.h>
//----------------------------------------------------------------------------|
// Macros |
//
#undef T_DEMON
#undef T_GREENKEY
#define TEXFLAG_TOP 0x00000001
#define TEXFLAG_MIDDLE 0x00000002
#define TEXFLAG_BOTTOM 0x00000004
#define TEXFLAG_ADDOFFSET 0x00000008
#define GAME_TITLE_MAP 3
#define BLOCK_NOTHING 0
#define BLOCK_CREATURES 1
#define BLOCK_EVERYTHING 2
#define BLOCK_RAILING 3
#define BLOCK_PLAYERS 4
#define SCROLL 0
#define CARRY 1
#define SCROLL_AND_CARRY 2
#define MOD_UNKNOWN 0
#define MOD_ROCKET 5
#define MOD_R_SPLASH 6
#define MOD_PLASMARIFLE 7
#define MOD_BFG_BOOM 8
#define MOD_BFG_SPLASH 9
#define MOD_CHAINSAW 10
#define MOD_SSHOTGUN 11
#define MOD_WATER 12
#define MOD_SLIME 13
#define MOD_LAVA 14
#define MOD_CRUSH 15
#define MOD_TELEFRAG 16
#define MOD_FALLING 17
#define MOD_SUICIDE 18
#define MOD_BARREL 19
#define MOD_EXIT 20
#define MOD_SPLASH 21
#define MOD_HIT 22
#define MOD_RAILGUN 23
#define MOD_ICE 24
#define MOD_DISINTEGRATE 25
#define MOD_POISON 26
#define MOD_ELECTRIC 27
#define MOVIE_Played 0
#define MOVIE_Played_NoVideo 1
#define MOVIE_Played_Aborted 2
#define MOVIE_Failed -1
#define PROP_FROZEN 0
#define PROP_NOTARGET 1
#define PROP_INSTANTWEAPONSWITCH 2
#define PROP_FLY 3
#define PROP_TOTALLYFROZEN 4
#define PROP_INVULNERABILITY 5
#define PROP_STRENGTH 6
#define PROP_INVISIBILITY 7
#define PROP_RADIATIONSUIT 8
#define PROP_ALLMAP 9
#define PROP_INFRARED 10
#define PROP_WEAPONLEVEL2 11
#define PROP_FLIGHT 12
#define PROP_SPEED 15
#define PROP_BUDDHA 16
#define INPUT_OLDBUTTONS 0
#define INPUT_BUTTONS 1
#define INPUT_PITCH 2
#define INPUT_YAW 3
#define INPUT_ROLL 4
#define INPUT_FORWARDMOVE 5
#define INPUT_SIDEMOVE 6
#define INPUT_UPMOVE 7
#define MODINPUT_OLDBUTTONS 8
#define MODINPUT_BUTTONS 9
#define MODINPUT_PITCH 10
#define MODINPUT_YAW 11
#define MODINPUT_ROLL 12
#define MODINPUT_FORWARDMOVE 13
#define MODINPUT_SIDEMOVE 14
#define MODINPUT_UPMOVE 15
#define BT_ATTACK 0x00000001
#define BT_USE 0x00000002
#define BT_JUMP 0x00000004
#define BT_CROUCH 0x00000008
#define BT_TURN180 0x00000010
#define BT_ALTATTACK 0x00000020
#define BT_RELOAD 0x00000040
#define BT_ZOOM 0x00000080
#define BT_SPEED 0x00000100
#define BT_STRAFE 0x00000200
#define BT_MOVERIGHT 0x00000400
#define BT_MOVELEFT 0x00000800
#define BT_BACK 0x00001000
#define BT_FORWARD 0x00002000
#define BT_RIGHT 0x00004000
#define BT_LEFT 0x00008000
#define BT_LOOKUP 0x00010000
#define BT_LOOKDOWN 0x00020000
#define BT_MOVEUP 0x00040000
#define BT_MOVEDOWN 0x00080000
#define BT_SHOWSCORES 0x00100000
#define BT_USER1 0x00200000
#define BT_USER2 0x00400000
#define BT_USER3 0x00800000
#define BT_USER4 0x01000000
#define CR_UNTRANSLATED -1
#define CR_BRICK 0
#define CR_TAN 1
#define CR_GRAY 2
#define CR_GREY 2
#define CR_GREEN 3
#define CR_BROWN 4
#define CR_GOLD 5
#define CR_RED 6
#define CR_BLUE 7
#define CR_ORANGE 8
#define CR_WHITE 9
#define CR_YELLOW 10
#define CR_BLACK 12
#define CR_LIGHTBLUE 13
#define CR_CREAM 14
#define CR_OLIVE 15
#define CR_DARKGREEN 16
#define CR_DARKRED 17
#define CR_DARKBROWN 18
#define CR_PURPLE 19
#define CR_DARKGRAY 20
#define CR_DARKGREY 20
#define CR_CYAN 21
#define HUDMSG_PLAIN 0x00000000
#define HUDMSG_FADEOUT 0x00000001
#define HUDMSG_TYPEON 0x00000002
#define HUDMSG_FADEINOUT 0x00000003
#define HUDMSG_LAYER_OVERHUD 0x00000000
#define HUDMSG_LAYER_UNDERHUD 0x00001000
#define HUDMSG_LAYER_OVERMAP 0x00002000
#define HUDMSG_NOTWITH3DVIEW 0x00010000
#define HUDMSG_NOTWITHFULLMAP 0x00020000
#define HUDMSG_NOTWITHOVERLAYMAP 0x00040000
#define HUDMSG_NOWRAP 0x08000000
#define HUDMSG_ALPHA 0x10000000
#define HUDMSG_ADDBLEND 0x20000000
#define HUDMSG_COLORSTRING 0x40000000
#define HUDMSG_LOG 0x80000000
#define MARINEWEAPON_Dummy 0
#define MARINEWEAPON_Fist 1
#define MARINEWEAPON_BerserkFist 2
#define MARINEWEAPON_Chainsaw 3
#define MARINEWEAPON_Pistol 4
#define MARINEWEAPON_Shotgun 5
#define MARINEWEAPON_SuperShotgun 6
#define MARINEWEAPON_Chaingun 7
#define MARINEWEAPON_RocketLauncher 8
#define MARINEWEAPON_PlasmaRifle 9
#define MARINEWEAPON_Railgun 10
#define MARINEWEAPON_BFG 11
#define APROP_Health 0
#define APROP_Speed 1
#define APROP_Damage 2
#define APROP_Alpha 3
#define APROP_RenderStyle 4
#define APROP_SeeSound 5
#define APROP_AttackSound 6
#define APROP_PainSound 7
#define APROP_DeathSound 8
#define APROP_ActiveSound 9
#define APROP_Ambush 10
#define APROP_Invulnerable 11
#define APROP_JumpZ 12
#define APROP_ChaseGoal 13
#define APROP_Frightened 14
#define APROP_Gravity 15
#define APROP_Friendly 16
#define APROP_SpawnHealth 17
#define APROP_Dropped 18
#define APROP_Notarget 19
#define APROP_Species 20
#define APROP_NameTag 21
#define APROP_Score 22
#define APROP_Notrigger 23
#define APROP_DamageFactor 24
#define APROP_MasterTID 25
#define APROP_TargetTID 26
#define APROP_TracerTID 27
#define APROP_Waterlevel 28
#define APROP_ScaleX 29
#define APROP_ScaleY 30
#define APROP_Dormant 31
#define APROP_Mass 32
#define APROP_Accuracy 33
#define APROP_Stamina 34
#define APROP_Height 35
#define APROP_Radius 36
#define APROP_ReactionTime 37
#define APROP_MeleeRange 38
#define APROP_ViewHeight 39
#define APROP_AttackZOffset 40
#define APROP_StencilColor 41
#define APROP_Friction 42
#define APROP_DamageMultiplier 43
#define APROP_MaxStepHeight 44
#define APROP_MaxDropOffHeight 45
#define APROP_DamageType 46
#define APROP_Counter0 100
#define APROP_Counter1 101
#define APROP_Counter2 102
#define APROP_Counter3 103
#define APROP_Counter4 104
#define APROP_Counter5 105
#define APROP_Counter6 106
#define APROP_Counter7 107
#define STYLE_None 0
#define STYLE_Normal 1
#define STYLE_Fuzzy 2
#define STYLE_SoulTrans 3
#define STYLE_OptFuzzy 4
#define STYLE_Stencil 5
#define STYLE_AddStencil 6
#define STYLE_AddShaded 7
#define STYLE_Translucent 64
#define STYLE_Add 65
#define STYLE_Shaded 66
#define STYLE_TranslucentStencil 67
#define STYLE_Shadow 68
#define STYLE_Subtract 69
#define LEVELINFO_PAR_TIME 0
#define LEVELINFO_CLUSTERNUM 1
#define LEVELINFO_LEVELNUM 2
#define LEVELINFO_TOTAL_SECRETS 3
#define LEVELINFO_FOUND_SECRETS 4
#define LEVELINFO_TOTAL_ITEMS 5
#define LEVELINFO_FOUND_ITEMS 6
#define LEVELINFO_TOTAL_MONSTERS 7
#define LEVELINFO_KILLED_MONSTERS 8
#define LEVELINFO_SUCK_TIME 9
#define PLAYERINFO_TEAM 0
#define PLAYERINFO_AIMDIST 1
#define PLAYERINFO_COLOR 2
#define PLAYERINFO_GENDER 3
#define PLAYERINFO_NEVERSWITCH 4
#define PLAYERINFO_MOVEBOB 5
#define PLAYERINFO_STILLBOB 6
#define PLAYERINFO_PLAYERCLASS 7
#define PLAYERINFO_FOV 8
#define PLAYERINFO_DESIREDFOV 9
#define NOT_BOTTOM 0x00000001
#define NOT_MIDDLE 0x00000002
#define NOT_TOP 0x00000004
#define NOT_FLOOR 0x00000008
#define NOT_CEILING 0x00000010
#define DAMAGE_PLAYERS 0x00000001
#define DAMAGE_NONPLAYERS 0x00000002
#define DAMAGE_IN_AIR 0x00000004
#define DAMAGE_SUBCLASSES_PROTECT 0x00000008
#define DAMAGE_NO_ARMOR 0x00000010
#define MRF_OLDEFFECTS 0x00000000
#define MRF_ADDSTAMINA 0x00000001
#define MRF_FULLHEALTH 0x00000002
#define MRF_UNDOBYTOMEOFPOWER 0x00000004
#define MRF_UNDOBYCHAOSDEVICE 0x00000008
#define MRF_FAILNOTELEFRAG 0x00000010
#define MRF_FAILNOLAUGH 0x00000020
#define MRF_WHENINVULNERABLE 0x00000040
#define MRF_LOSEACTUALWEAPON 0x00000080
#define MRF_NEWTIDBEHAVIOUR 0x00000100
#define MRF_UNDOBYDEATH 0x00000200
#define MRF_UNDOBYDEATHFORCED 0x00000400
#define MRF_UNDOBYDEATHSAVES 0x00000800
#define T_SHOTGUY 1
#define T_CHAINGUY 2
#define T_BARON 3
#define T_ZOMBIE 4
#define T_IMP 5
#define T_ARACHNOTRON 6
#define T_SPIDERMASTERMIND 7
#define T_DEMON 8
#define T_SPECTRE 9
#define T_IMPFIREBALL 10
#define T_CLIP 11
#define T_SHELLS 12
#define T_CACODEMON 19
#define T_REVENANT 20
#define T_BRIDGE 21
#define T_ARMORBONUS 22
#define T_STIMPACK 23
#define T_MEDKIT 24
#define T_SOULSPHERE 25
#define T_SHOTGUN 27
#define T_CHAINGUN 28
#define T_ROCKETLAUNCHER 29
#define T_PLASMAGUN 30
#define T_BFG 31
#define T_CHAINSAW 32
#define T_SUPERSHOTGUN 33
#define T_PLASMABOLT 51
#define T_TRACER 53
#define T_GREENARMOR 68
#define T_BLUEARMOR 69
#define T_CELL 75
#define T_BLUEKEYCARD 85
#define T_REDKEYCARD 86
#define T_YELLOWKEYCARD 87
#define T_YELLOWSKULLKEY 88
#define T_REDSKULLKEY 89
#define T_BLUESKULLKEY 90
#define T_TEMPLARGEFLAME 98
#define T_STEALTHBARON 100
#define T_STEALTHKNIGHT 101
#define T_STEALTHZOMBIE 102
#define T_STEALTHSHOTGUY 103
#define T_LOSTSOUL 110
#define T_VILE 111
#define T_MANCUBUS 112
#define T_HELLKNIGHT 113
#define T_CYBERDEMON 114
#define T_PAINELEMENTAL 115
#define T_WOLFSS 116
#define T_STEALTHARACHNOTRON 117
#define T_STEALTHVILE 118
#define T_STEALTHCACODEMON 119
#define T_STEALTHCHAINGUY 120
#define T_STEALTHSERGEANT 121
#define T_STEALTHIMP 122
#define T_STEALTHMANCUBUS 123
#define T_STEALTHREVENANT 124
#define T_BARREL 125
#define T_CACODEMONSHOT 126
#define T_ROCKET 127
#define T_BFGSHOT 128
#define T_ARACHNOTRONPLASMA 129
#define T_BLOOD 130
#define T_PUFF 131
#define T_MEGASPHERE 132
#define T_INVULNERABILITY 133
#define T_BERSERK 134
#define T_INVISIBILITY 135
#define T_IRONFEET 136
#define T_COMPUTERMAP 137
#define T_LIGHTAMP 138
#define T_AMMOBOX 139
#define T_ROCKETAMMO 140
#define T_ROCKETBOX 141
#define T_BATTERY 142
#define T_SHELLBOX 143
#define T_BACKPACK 144
#define T_GUTS 145
#define T_BLOODPOOL 146
#define T_BLOODPOOL1 147
#define T_BLOODPOOL2 148
#define T_FLAMINGBARREL 149
#define T_BRAINS 150
#define T_SCRIPTEDMARINE 151
#define T_HEALTHBONUS 152
#define T_MANCUBUSSHOT 153
#define T_BARONBALL 154
#define T_CLINK 1
#define T_MUMMYLEADER 2
#define T_BEAST 3
#define T_MUMMY 4
#define T_IMP 5
#define T_KNIGHT 6
#define T_IMPLEADER 7
#define T_MUMMYGHOST 8
#define T_MUMMYLEADERGHOST 9
#define T_IMPFIREBALL 10
#define T_WIMPYWANDAMMO 11
#define T_HEFTYWANDAMMO 12
#define T_ITEMEGG 14
#define T_ITEMFLIGHT 15
#define T_ITEMTELEPORT 18
#define T_WIZARD 19
#define T_IRONLICH 20
#define T_ITEMHEALTHPOTION 23
#define T_ITEMHEALTHFLASK 24
#define T_ITEMHEALTHFULL 25
#define T_CROSSBOW 27
#define T_BLASTER 28
#define T_PHOENIXROD 29
#define T_SKULLROD 30
#define T_MACE 31
#define T_GAUNTLETS 32
#define T_WIMPYCROSSBOWAMMO 33
#define T_HEFTYCROSSBOWAMMO 34
#define T_WIMPYMACEAMMO 35
#define T_HEFTYMACEAMMO 36
#define T_WIMPYBLASTERAMMO 37
#define T_HEFTYBLASTERAMMO 38
#define T_MORPHBLAST 40
#define T_SHIELD1 68
#define T_SHIELD2 69
#define T_ITEMTIMEBOMB 72
#define T_ITEMTORCH 73
#define T_BLUEKEY 85
#define T_GREENKEY 86
#define T_YELLOWKEY 87
#define T_SOUND_WIND 110
#define T_SOUND_WATERFALL 111
#define T_BEASTBALL 120
#define T_FEATHER 121
#define T_CHICKEN 122
#define T_VOLCANOBALL 123
#define T_TINYVOLCANOBALL 124
#define T_POD 125
#define T_PODGENERATOR 126
#define T_KNIGHTAXE 127
#define T_KNIGHTBLOODAXE 128
#define T_KNIGHTGHOST 129
#define T_MUMMYHEAD 131
#define T_SNAKE 132
#define T_ITEMINVULNERABILITY 133
#define T_ITEMTOME 134
#define T_ITEMINVISIBILITY 135
#define T_ITEMBAGOFHOLDING 136
#define T_ITEMALLMAP 137
#define T_SNAKEPROJECTILE 138
#define T_SNAKEPROJECTILEBIG 139
#define T_WIZARDSHOT 140
#define T_DSPARILTELEPORTDEST 141
#define T_DSPARILONSERPENT 142
#define T_DSPARILALONE 143
#define T_SERPENTFIREBALL 144
#define T_DSPARILBLUESHOT 145
#define T_DSPARILWIZARDSPAWNER 146
#define T_CROSSBOWMAINBLAST 147
#define T_CROSSBOWMINIBLAST 148
#define T_CROSSBOWPOWERBLAST 149
#define T_VOLCANO 150
#define T_POWERWANDMINIBLAST 151
#define T_POWERWANDBIGGERBLAST 152
#define T_DEATHBALL 153
#define T_NOGRAVITYMACEBALL 154
#define T_BOUNCYMACEBALL 155
#define T_HEAVYMACEBALL 156
#define T_RIPPER 157
#define T_WIMPYSKULLRODAMMO 158
#define T_HEFTYSKULLRODAMMO 159
#define T_SKULLRODBLAST 160
#define T_WIMPYPHOENIXRODAMMO 161
#define T_HEFTYPHOENIXRODAMMO 162
#define T_PHOENIXSHOT 163
#define T_IRONLICHBLUESHOT 164
#define T_WHIRLWIND 165
#define T_REDTELEGLITTER 166
#define T_BLUETELEGLITTER 167
#define T_DEMON1 3
#define T_SMALLMETALKEY 86
#define ACTOR_NONE 0x00000000
#define ACTOR_WORLD 0x00000001
#define ACTOR_PLAYER 0x00000002
#define ACTOR_BOT 0x00000004
#define ACTOR_VOODOODOLL 0x00000008
#define ACTOR_MONSTER 0x00000010
#define ACTOR_ALIVE 0x00000020
#define ACTOR_DEAD 0x00000040
#define ACTOR_MISSILE 0x00000080
#define ACTOR_GENERIC 0x00000100
#define SECSEQ_FLOOR 1
#define SECSEQ_CEILING 2
#define SECSEQ_FULLHEIGHT 3
#define SECSEQ_INTERIOR 4
#define CHAN_AUTO 0x00000000
#define CHAN_WEAPON 0x00000001
#define CHAN_VOICE 0x00000002
#define CHAN_ITEM 0x00000003
#define CHAN_BODY 0x00000004
#define CHAN_5 0x00000005
#define CHAN_6 0x00000006
#define CHAN_7 0x00000007
#define CHAN_LISTENERZ 0x00000008
#define CHAN_MAYBE_LOCAL 0x00000010
#define CHAN_UI 0x00000020
#define CHAN_NOPAUSE 0x00000040
#define ATTN_NONE 0.0k
#define ATTN_NORM 1.0k
#define ATTN_IDLE 1.001k
#define ATTN_STATIC 3.0k
#define SOUND_See 0
#define SOUND_Attack 1
#define SOUND_Pain 2
#define SOUND_Death 3
#define SOUND_Active 4
#define SOUND_Use 5
#define SOUND_Bounce 6
#define SOUND_WallBounce 7
#define SOUND_CrushPain 8
#define SOUND_Howl 9
#define SDF_ABSANGLE 1
#define SDF_PERMANENT 2
#define AAPTR_DEFAULT 0x00000000
#define AAPTR_NULL 0x00000001
#define AAPTR_TARGET 0x00000002
#define AAPTR_MASTER 0x00000004
#define AAPTR_TRACER 0x00000008
#define AAPTR_PLAYER_GETTARGET 0x00000010
#define AAPTR_PLAYER_GETCONVERSATION 0x00000020
#define AAPTR_PLAYER1 0x00000040
#define AAPTR_PLAYER2 0x00000080
#define AAPTR_PLAYER3 0x00000100
#define AAPTR_PLAYER4 0x00000200
#define AAPTR_PLAYER5 0x00000400
#define AAPTR_PLAYER6 0x00000800
#define AAPTR_PLAYER7 0x00001000
#define AAPTR_PLAYER8 0x00002000
#define AAPTR_FRIENDPLAYER 0x00004000
#define AAPTR_GET_LINETARGET 0x00008000
#define PTROP_UNSAFETARGET 0x00000001
#define PTROP_UNSAFEMASTER 0x00000002
#define PTROP_NOSAFEGUARDS (PTROP_UNSAFETARGET | PTROP_UNSAFEMASTER)
#define SPAC_None 0x00000000
#define SPAC_Cross 0x00000001
#define SPAC_Use 0x00000002
#define SPAC_MCross 0x00000004
#define SPAC_Impact 0x00000008
#define SPAC_Push 0x00000010
#define SPAC_PCross 0x00000020
#define SPAC_UseThrough 0x00000040
#define SPAC_AnyCross 0x00000080
#define SPAC_MUse 0x00000100
#define SPAC_MPush 0x00000200
#define SPAC_UseBack 0x00000400
#define ARMORINFO_CLASSNAME 0
#define ARMORINFO_SAVEAMOUNT 1
#define ARMORINFO_SAVEPERCENT 2
#define ARMORINFO_MAXABSORB 3
#define ARMORINFO_MAXFULLABSORB 4
#define ARMORINFO_ACTUALSAVEAMOUNT 5
#define EV_KeyDown 1
#define EV_KeyRepeat 2
#define EV_KeyUp 3
#define EV_Char 4
#define EV_MouseMove 5
#define EV_LButtonDown 6
#define EV_LButtonUp 7
#define EV_LButtonDblClick 8
#define EV_MButtonDown 9
#define EV_MButtonUp 10
#define EV_MButtonDblClick 11
#define EV_RButtonDown 12
#define EV_RButtonUp 13
#define EV_RButtonDblClick 14
#define EV_WheelDown 15
#define EV_WheelUp 16
#define GKM_SHIFT 0x00000100
#define GKM_CTRL 0x00000200
#define GKM_ALT 0x00000400
#define GKM_LBUTTON 0x00000800
#define GKM_MBUTTON 0x00001000
#define GKM_RBUTTON 0x00002000
#define GK_PGDN 1
#define GK_PGUP 2
#define GK_HOME 3
#define GK_END 4
#define GK_LEFT 5
#define GK_RIGHT 6
#define GK_ALERT 7
#define GK_BACKSPACE 8
#define GK_TAB 9
#define GK_LINEFEED 10
#define GK_DOWN 10
#define GK_VTAB 11
#define GK_UP 11
#define GK_FORMFEED 12
#define GK_RETURN 13
#define GK_F1 14
#define GK_F2 15
#define GK_F3 16
#define GK_F4 17
#define GK_F5 18
#define GK_F6 19
#define GK_F7 20
#define GK_F8 21
#define GK_F9 22
#define GK_F10 23
#define GK_F11 24
#define GK_F12 25
#define GK_DEL 26
#define GK_ESCAPE 27
#define GK_FREE1 28
#define GK_FREE2 29
#define GK_FREE3 30
#define GK_CESCAPE 31
#define CHANGELEVEL_KEEPFACING 0x00000001
#define CHANGELEVEL_RESETINVENTORY 0x00000002
#define CHANGELEVEL_NOMONSTERS 0x00000004
#define CHANGELEVEL_CHANGESKILL 0x00000008
#define CHANGELEVEL_NOINTERMISSION 0x00000010
#define CHANGELEVEL_RESETHEALTH 0x00000020
#define CHANGELEVEL_PRERAISEWEAPON 0x00000040
#define NO_CHANGE 32767.0k
#define SECF_SILENT 0x00000001
#define SECF_NOFALLINGDAMAGE 0x00000002
#define SECF_FLOORDROP 0x00000004
#define SECF_NORESPAWN 0x00000008
#define BLOCKF_CREATURES 0x00000001
#define BLOCKF_MONSTERS 0x00000002
#define BLOCKF_PLAYERS 0x00000004
#define BLOCKF_FLOATERS 0x00000008
#define BLOCKF_PROJECTILES 0x00000010
#define BLOCKF_EVERYTHING 0x00000020
#define BLOCKF_RAILING 0x00000040
#define BLOCKF_USE 0x00000080
#define BLOCKF_SIGHT 0x00000100
#define BLOCKF_HITSCAN 0x00000200
#define BLOCKF_SOUND 0x00000400
#define FOGP_DENSITY 0
#define FOGP_OUTSIDEDENSITY 1
#define FOGP_SKYFOG 2
#define PRINTNAME_LEVELNAME -1
#define PRINTNAME_LEVEL -2
#define PRINTNAME_SKILL -3
#define PRINTNAME_NEXTLEVEL -4
#define PRINTNAME_NEXTSECRET -5
#define CSF_NOFAKEFLOORS 1
#define CSF_NOBLOCKALL 2
#define FHF_NORANDOMPUFFZ 0x00000001
#define FHF_NOIMPACTDECAL 0x00000002
#define PICKAF_FORCETID 0x00000001
#define PICKAF_RETURNTID 0x00000002
#define TRANSLATION_ICE 0x00100007
#define MF_SPECIAL 0x00000001
#define MF_SOLID 0x00000002
#define MF_SHOOTABLE 0x00000004
#define MF_NOSECTOR 0x00000008
#define MF_NOBLOCKMAP 0x00000010
#define MF_AMBUSH 0x00000020
#define MF_JUSTHIT 0x00000040
#define MF_JUSTATTACKED 0x00000080
#define MF_SPAWNCEILING 0x00000100
#define MF_NOGRAVITY 0x00000200
#define MF_DROPOFF 0x00000400
#define MF_PICKUP 0x00000800
#define MF_NOCLIP 0x00001000
#define MF_INCHASE 0x00002000
#define MF_FLOAT 0x00004000
#define MF_TELEPORT 0x00008000
#define MF_MISSILE 0x00010000
#define MF_DROPPED 0x00020000
#define MF_SHADOW 0x00040000
#define MF_NOBLOOD 0x00080000
#define MF_CORPSE 0x00100000
#define MF_INFLOAT 0x00200000
#define MF_INBOUNCE 0x00200000
#define MF_COUNTKILL 0x00400000
#define MF_COUNTITEM 0x00800000
#define MF_SKULLFLY 0x01000000
#define MF_NOTDMATCH 0x02000000
#define MF_SPAWNSOUNDSOURCE 0x04000000
#define MF_FRIENDLY 0x08000000
#define MF_UNMORPHED 0x10000000
#define MF_NOLIFTDROP 0x20000000
#define MF_STEALTH 0x40000000
#define MF_ICECORPSE 0x80000000
#define ML_BLOCKING 0x00000001
#define ML_BLOCKMONSTERS 0x00000002
#define ML_TWOSIDED 0x00000004
#define ML_DONTPEGTOP 0x00000008
#define ML_DONTPEGBOTTOM 0x00000010
#define ML_SECRET 0x00000020
#define ML_SOUNDBLOCK 0x00000040
#define ML_DONTDRAW 0x00000080
#define ML_MAPPED 0x00000100
#define ML_REPEAT_SPECIAL 0x00000200
#define ML_ADDTRANS 0x00000400
#define ML_MONSTERSCANACTIVATE 0x00002000
#define ML_BLOCK_PLAYERS 0x00004000
#define ML_BLOCKEVERYTHING 0x00008000
#define ML_ZONEBOUNDARY 0x00010000
#define ML_RAILING 0x00020000
#define ML_BLOCK_FLOATERS 0x00040000
#define ML_CLIP_MIDTEX 0x00080000
#define ML_WRAP_MIDTEX 0x00100000
#define ML_3DMIDTEX 0x00200000
#define ML_CHECKSWITCHRANGE 0x00400000
#define ML_FIRSTSIDEONLY 0x00800000
#define ML_BLOCKPROJECTILE 0x01000000
#define ML_BLOCKUSE 0x02000000
#define ML_BLOCKSIGHT 0x04000000
#define ML_BLOCKHITSCAN 0x08000000
#define QF_RELATIVE 0x00000001
#define QF_SCALEDOWN 0x00000002
#define QF_SCALEUP 0x00000004
#define QF_MAX 0x00000008
#define QF_FULLINTENSITY 0x00000010
#define QF_WAVE 0x00000020
#define WARPF_ABSOLUTEOFFSET 0x00000001
#define WARPF_ABSOLUTEANGLE 0x00000002
#define WARPF_USECALLERANGLE 0x00000004
#define WARPF_NOCHECKPOSITION 0x00000008
#define WARPF_INTERPOLATE 0x00000010
#define WARPF_WARPINTERPOLATION 0x00000020
#define WARPF_COPYINTERPOLATION 0x00000040
#define WARPF_STOP 0x00000080
#define WARPF_TOFLOOR 0x00000100
#define WARPF_TESTONLY 0x00000200
#define WARPF_ABSOLUTEPOSITION 0x00000400
#define WARPF_BOB 0x00000800
#define WARPF_MOVEPTR 0x00001000
#define WARPF_USEPTR 0x00002000
#define WARPF_COPYVELOCITY 0x00004000
#define WARPF_COPYPITCH 0x00008000
#define CPXF_ANCESTOR 0x00000001
#define CPXF_LESSOREQUAL 0x00000002
#define CPXF_NOZ 0x00000004
#define CPXF_COUNTDEAD 0x00000008
#define CPXF_DEADONLY 0x00000010
#define CPXF_EXACT 0x00000020
#define CPXF_SETTARGET 0x00000040
#define CPXF_SETMASTER 0x00000080
#define CPXF_SETTRACER 0x00000100
#define CPXF_FARTHEST 0x00000200
#define CPXF_CLOSEST 0x00000400
#define CPXF_SETONPTR 0x00000800
#define CPXF_CHECKSIGHT 0x00001000
#endif//__GDCC_Header__C__ACS_ZDoom__defs_h__

View file

@ -1,26 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2015 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Declarations and definitions from Zandronum's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Zandronum_h__
#define __GDCC_Header__C__ACS_Zandronum_h__
#include <ACS_ZDoom.h>
#include <ACS_Zandronum/AsmFunc.h>
#include <ACS_Zandronum/Native.h>
#include <ACS_Zandronum/Special.h>
#include <ACS_Zandronum/defs.h>
#endif//__GDCC_Header__C__ACS_Zandronum_h__

View file

@ -1,43 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "AsmFunc" functions from Zandronum's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Zandronum__AsmFunc_h__
#define __GDCC_Header__C__ACS_Zandronum__AsmFunc_h__
#include <ACS_ZDoom/AsmFunc.h>
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_AsmFuncDeclFull(118, , 0, int, IsMultiplayer, (void));
ACS_AsmFuncDeclFull(119, , 0, int, PlayerTeam, (void));
ACS_AsmFuncDeclFull(120, , 0, int, PlayerHealth, (void));
ACS_AsmFuncDeclFull(121, , 0, int, PlayerArmorPoints, (void));
ACS_AsmFuncDeclFull(124, , 0, int, BlueTeamCount, (void));
ACS_AsmFuncDeclFull(125, , 0, int, RedTeamCount, (void));
ACS_AsmFuncDeclFull(126, , 0, int, BlueTeamScore, (void));
ACS_AsmFuncDeclFull(127, , 0, int, RedTeamScore, (void));
ACS_AsmFuncDeclFull(128, , 0, int, IsOneFlagCTF, (void));
ACS_AsmFuncDeclFull(129, , 0, int, GetInvasionWave, (void));
ACS_AsmFuncDeclFull(130, , 0, int, GetInvasionState, (void));
ACS_AsmFuncDeclFull(132, , 0, void, Music_Change, (__str, int));
ACS_AsmFuncDeclFull(134, 133, 2, void, ConsoleCommand, (__str, int, int));
ACS_AsmFuncDeclFull(135, , 0, int, SinglePlayer, (void));
#endif//__GDCC_Header__C__ACS_Zandronum__AsmFunc_h__

View file

@ -1,65 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "Native" functions from Zandronum's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Zandronum__Native_h__
#define __GDCC_Header__C__ACS_Zandronum__Native_h__
#include <ACS_ZDoom/Native.h>
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_NativeDeclFull( 37, 0, int, AnnouncerSound, (__str, int));
ACS_NativeDeclFull(100, 0, int, ResetMap, (void));
ACS_NativeDeclFull(101, 0, int, PlayerIsSpectator, (int));
ACS_NativeDeclFull(102, 0, int, ConsolePlayerNumber, (void));
ACS_NativeDeclFull(103, 0, int, GetTeamProperty, (int, int));
ACS_NativeDeclFull(103, 0, _Accum, GetTeamPropertyFixed, (int, int));
ACS_NativeDeclFull(103, 0, __str, GetTeamPropertyString, (int, int));
ACS_NativeDeclFull(104, 0, int, GetPlayerLivesLeft, (int));
ACS_NativeDeclFull(105, 0, int, SetPlayerLivesLeft, (int, int));
ACS_NativeDeclFull(106, 0, int, KickFromGame, (int, __str));
ACS_NativeDeclFull(107, 0, int, GetGameModeState, (void));
ACS_NativeDeclFull(108, 0, int, SetDBEntry, (__str, __str, int));
ACS_NativeDeclFull(108, 0, int, SetDBEntryFixed, (__str, __str, _Accum));
ACS_NativeDeclFull(109, 0, int, GetDBEntry, (__str, __str));
ACS_NativeDeclFull(109, 0, _Accum, GetDBEntryFixed, (__str, __str));
ACS_NativeDeclFull(110, 0, int, SetDBEntryString, (__str, __str, __str));
ACS_NativeDeclFull(111, 0, __str, GetDBEntryString, (__str, __str));
ACS_NativeDeclFull(112, 0, int, IncrementDBEntry, (__str, __str, int));
ACS_NativeDeclFull(112, 0, int, IncrementDBEntryFixed, (__str, __str, _Accum));
ACS_NativeDeclFull(113, 0, int, PlayerIsLoggedIn, (int));
ACS_NativeDeclFull(114, 0, __str, GetPlayerAccountName, (int));
ACS_NativeDeclFull(115, 0, int, SortDBEntries, (__str, int, int, int));
ACS_NativeDeclFull(116, 0, int, CountDBResults, (int));
ACS_NativeDeclFull(117, 0, int, FreeDBResults, (int));
ACS_NativeDeclFull(118, 0, __str, GetDBResultKeyString, (int, int));
ACS_NativeDeclFull(119, 0, __str, GetDBResultValueString, (int, int));
ACS_NativeDeclFull(120, 0, int, GetDBResultValue, (int, int));
ACS_NativeDeclFull(120, 0, _Accum, GetDBResultValueFixed, (int, int));
ACS_NativeDeclFull(121, 0, int, GetDBEntryRank, (__str, __str, int));
ACS_NativeDeclFull(122, 0, int, RequestScriptPuke, (int, int, int, int, int));
ACS_NativeDeclFull(123, 0, int, BeginDBTransaction, (void));
ACS_NativeDeclFull(124, 0, int, EndDBTransaction, (void));
ACS_NativeDeclFull(125, 0, int, GetDBEntries, (__str));
ACS_NativeDeclFull(126, 0, int, NamedRequestScriptPuke, (__str, int, int, int, int));
ACS_NativeDeclFull(127, 0, int, SystemTime, (void));
ACS_NativeDeclFull(128, 0, int, GetTimeProperty, (int, int, int));
ACS_NativeDeclFull(129, 0, __str, Strftime, (int, __str, int));
#endif//__GDCC_Header__C__ACS_Zandronum__Native_h__

View file

@ -1,31 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// "Special" functions from Zandronum's ACS.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Zandronum__Special_h__
#define __GDCC_Header__C__ACS_Zandronum__Special_h__
#include <ACS_ZDoom/Special.h>
//----------------------------------------------------------------------------|
// Extern Functions |
//
ACS_SpecialDeclFull(145, 0, int, Player_SetTeam, (int));
ACS_SpecialDeclFull(152, 0, int, Team_Score, (int, int));
ACS_SpecialDeclFull(153, 0, int, Team_GivePoints, (int, int, int));
#endif//__GDCC_Header__C__ACS_Zandronum__Special_h__

View file

@ -1,105 +0,0 @@
//-----------------------------------------------------------------------------
//
// Header for target library libacs.
//
// Defines from Zandronum's ACS.
//
// This file incorporates definitions from ZDoom's acc's zdefs.acs.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ACS_Zandronum__defs_h__
#define __GDCC_Header__C__ACS_Zandronum__defs_h__
#include <ACS_ZDoom/defs.h>
//----------------------------------------------------------------------------|
// Macros |
//
#define TEAM_BLUE 0
#define TEAM_RED 1
#define NO_TEAM 2
#define TPROP_Name 0
#define TPROP_Score 1
#define TPROP_IsValid 2
#define TPROP_NumPlayers 3
#define TPROP_NumLivePlayers 4
#define TPROP_TextColor 5
#define TPROP_PlayerStartNum 6
#define TPROP_Spread 7
#define TPROP_Carrier 8
#define TPROP_Assister 9
#define TPROP_FragCount 10
#define TPROP_DeathCount 11
#define TPROP_WinCount 12
#define TPROP_PointCount 13
#define TPROP_ReturnTics 14
#define TPROP_TeamItem 15
#define TPROP_WinnerTheme 16
#define TPROP_LoserTheme 17
#define IS_WAITINGFORPLAYERS 0
#define IS_FIRSTCOUNTDOWN 1
#define IS_INPROGRESS 2
#define IS_BOSSFIGHT 3
#define IS_WAVECOMPLETE 4
#define IS_COUNTDOWN 5
#define T_DARKIMP 155
#define T_BLOODDEMON 156
#define T_SSGGUY 157
#define T_HECTEBUS 158
#define T_CACOLANTERN 159
#define T_PISTOL 162
#define T_GRENADELAUNCHER 163
#define T_RAILGUN 164
#define T_BFG10000 165
#define T_MAXHEALTHBONUS 166
#define T_MASARMORBONUS 167
#define T_REDARMOR 168
#define T_TURBOSPHERE 169
#define T_ANTIGRAVBELT 170
#define T_TIMEFREEZER 171
#define T_INFRAGOGGLES 172
#define T_INFRATRACKER 173
#define T_TRANSLUCENCY 174
#define T_DOOMSPHERE 175
#define T_RANDOMPOWERUP 176
#define T_BLUEFLAG 177
#define T_REDFLAG 178
#define T_WHITEFLAG 179
#define T_STRENGTH 180
#define T_RAGE 181
#define T_DRAIN 182
#define T_SPREAD 183
#define T_RESISTANCE 184
#define T_REGENERATION 185
#define T_PROSPERITY 186
#define T_REFLECTION 187
#define T_HIGHJUMP 188
#define T_HASTE 189
#define T_MINIGUN 214
#define T_BELPHEGOR 215
#define T_GRENADE 216
#define T_BFG10KSHOT 217
#define T_DARKIMPFIREBALL 218
#define T_CACOLANTERNSHOT 219
#define T_ABADDON 220
#define T_ABADDONSHOT 221
#define DB_ORDER_ASC 0
#define DB_ORDER_DESC 1
#define TM_SECOND 0
#define TM_MINUTE 1
#define TM_HOUR 2
#define TM_DAY 3
#define TM_MONTH 4
#define TM_YEAR 5
#define TM_WEEKDAY 6
#endif//__GDCC_Header__C__ACS_Zandronum__defs_h__

View file

@ -1,840 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2016-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libdge.
//
// Doominati confirmed.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__Doominati_h__
#define __GDCC_Header__C__Doominati_h__
//----------------------------------------------------------------------------|
// Macros |
//
#define DGE_GlobalSound 1
//
// DGE_CB_*
//
#if __GDCC__
#define DGE_CB(cb) (__glyph(DGE_Unsig, "{Callback}" #cb))
#else
#define DGE_CB(cb) 0
#endif
#define DGE_CB_Draw DGE_CB(Draw)
#define DGE_CB_DrawPost DGE_CB(DrawPost)
#define DGE_CB_DrawPre DGE_CB(DrawPre)
#define DGE_CB_Resize DGE_CB(Resize)
//
// DGE_Callback
//
#if __GDCC__
#define DGE_Callback [[call("StkCall")]]
#else
#define DGE_Callback
#endif
//
// DGE_Native
//
#if __GDCC__
#define DGE_Native [[call("Native")]]
#else
#define DGE_Native
#endif
//
// DGE_OM_*
//
// Object Member macros.
//
#if __GDCC__
#define DGE_OM(mem) (__glyph(DGE_Unsig, "{ObjectMember}" #mem))
#else
#define DGE_OM(mem) 0
#endif
#define DGE_OM_ca DGE_OM(ca)
#define DGE_OM_cb DGE_OM(cb)
#define DGE_OM_cg DGE_OM(cg)
#define DGE_OM_cr DGE_OM(cr)
#define DGE_OM_bvx DGE_OM(bvx)
#define DGE_OM_bvy DGE_OM(bvy)
#define DGE_OM_bvz DGE_OM(bvz)
#define DGE_OM_collideF DGE_OM(collideF)
#define DGE_OM_collideI DGE_OM(collideI)
#define DGE_OM_damage DGE_OM(damage)
#define DGE_OM_emc DGE_OM(emc)
#define DGE_OM_entfi DGE_OM(entfi)
#define DGE_OM_entla DGE_OM(entla)
#define DGE_OM_frictair DGE_OM(frictair)
#define DGE_OM_friction DGE_OM(friction)
#define DGE_OM_grabx DGE_OM(grabx)
#define DGE_OM_graby DGE_OM(graby)
#define DGE_OM_grabz DGE_OM(grabz)
#define DGE_OM_gx DGE_OM(gx)
#define DGE_OM_gy DGE_OM(gy)
#define DGE_OM_gz DGE_OM(gz)
#define DGE_OM_health DGE_OM(health)
#define DGE_OM_ic DGE_OM(ic)
#define DGE_OM_id DGE_OM(id)
#define DGE_OM_mass DGE_OM(mass)
#define DGE_OM_next DGE_OM(next)
#define DGE_OM_owner DGE_OM(owner)
#define DGE_OM_pc DGE_OM(pc)
#define DGE_OM_pitch DGE_OM(pitch)
#define DGE_OM_prev DGE_OM(prev)
#define DGE_OM_rsx DGE_OM(rsx)
#define DGE_OM_rsy DGE_OM(rsy)
#define DGE_OM_sprite DGE_OM(sprite)
#define DGE_OM_shader DGE_OM(shader)
#define DGE_OM_sx DGE_OM(sx)
#define DGE_OM_sy DGE_OM(sy)
#define DGE_OM_sz DGE_OM(sz)
#define DGE_OM_team DGE_OM(team)
#define DGE_OM_teamfi DGE_OM(teamfi)
#define DGE_OM_teamla DGE_OM(teamla)
#define DGE_OM_teamne DGE_OM(teamne)
#define DGE_OM_teampr DGE_OM(teampr)
#define DGE_OM_texc DGE_OM(texc)
#define DGE_OM_texf DGE_OM(texf)
#define DGE_OM_think DGE_OM(think)
#define DGE_OM_vx DGE_OM(vx)
#define DGE_OM_vy DGE_OM(vy)
#define DGE_OM_vz DGE_OM(vz)
#define DGE_OM_x DGE_OM(x)
#define DGE_OM_xl DGE_OM(xl)
#define DGE_OM_xu DGE_OM(xu)
#define DGE_OM_y DGE_OM(y)
#define DGE_OM_yl DGE_OM(yl)
#define DGE_OM_yu DGE_OM(yu)
#define DGE_OM_yaw DGE_OM(yaw)
#define DGE_OM_z DGE_OM(z)
#define DGE_OM_zl DGE_OM(zl)
#define DGE_OM_zu DGE_OM(zu)
//
// DGE_OME_*
//
// Object Member Extension macros.
//
#if __GDCC__
#define DGE_OME(mem) (__glyph(DGE_Unsig, "{ObjectMemberExt}" #mem))
#else
#define DGE_OME(mem) 0
#endif
#define DGE_OME_Object DGE_OME(Object)
# define DGE_OME_Sector DGE_OME(Sector)
# define DGE_OME_Team DGE_OME(Team)
# define DGE_OME_Thinker DGE_OME(Thinker)
# define DGE_OME_ParticleSys DGE_OME(ParticleSys)
# define DGE_OME_PointThinker DGE_OME(PointThinker)
# define DGE_OME_RenderThinker DGE_OME(RenderThinker)
# define DGE_OME_PhysicsThinker DGE_OME(PhysicsThinker)
# define DGE_OME_Entity DGE_OME(Entity)
# define DGE_OME_MissileEntity DGE_OME(MissileEntity)
# define DGE_OME_ScriptedEntity DGE_OME(ScriptedEntity)
//
// DGE_OT_*
//
// Object Type macros.
//
#if __GDCC__
#define DGE_OT(type) (__glyph(DGE_Unsig, "{ObjectType}" #type))
#else
#define DGE_OT(type) 0
#endif
#define DGE_OT_Object DGE_OT(Object)
# define DGE_OT_Sector DGE_OT(Sector)
# define DGE_OT_Team DGE_OT(Team)
# define DGE_OT_Thinker DGE_OT(Thinker)
# define DGE_OT_ParticleSys DGE_OT(ParticleSys)
# define DGE_OT_PointThinker DGE_OT(PointThinker)
# define DGE_OT_RenderThinker DGE_OT(RenderThinker)
# define DGE_OT_PhysicsThinker DGE_OT(PhysicsThinker)
# define DGE_OT_Entity DGE_OT(Entity)
# define DGE_OT_MissileEntity DGE_OT(MissileEntity)
# define DGE_OT_ScriptedEntity DGE_OT(ScriptedEntity)
//
// DGE_Object_MemberGetT
//
#define DGE_Object_MemberGetT(T, id, mem) \
((T (*)(DGE_Unsig, DGE_Unsig, DGE_Unsig) DGE_Native)DGE_Object_MemberGet) \
(id, mem, sizeof(T) / 4)
//
// DGE_Object_MemberSetT
//
#define DGE_Object_MemberSetT(T, id, mem, ...) \
((void (*)(DGE_Unsig, DGE_Unsig, T) DGE_Native)DGE_Object_MemberSet) \
(id, mem, __VA_ARGS__)
//
// DGE_OptArgs
//
#if __GDCC__
#define DGE_OptArgs(n) [[optional_args(n)]]
#else
#define DGE_OptArgs(n)
#endif
//
// DGE_PropMem
//
#if __GDCC__
#define DGE_PropMem(T, name, mem) \
__prop name {__get: DGE_Object_MemberGetT(T, ->id, mem), \
__set: DGE_Object_MemberSetT(T, ->id, mem, __arg)}
#else
#define DGE_PropMem(T, name, mem) T name;
#endif
//----------------------------------------------------------------------------|
// Types |
//
//
// DGE_Angle
//
#if __GDCC__
typedef unsigned long _Fract DGE_Angle;
#else
typedef unsigned DGE_Angle;
#endif
//
// DGE_Fixed
//
#if __GDCC__
typedef short _Accum DGE_Fixed;
#else
typedef int DGE_Fixed;
#endif
//
// DGE_Fract
//
#if __GDCC__
typedef long _Fract DGE_Fract;
#else
typedef int DGE_Fract;
#endif
//
// DGE_Integ
//
typedef int DGE_Integ;
//
// DGE_String
//
#if __GDCC__
typedef __str DGE_String;
#else
typedef unsigned DGE_String;
#endif
//
// DGE_Unsig
//
typedef unsigned DGE_Unsig;
//
// DGE_UnsigL
//
typedef unsigned long DGE_UnsigL;
//
// DGE_Callback*
//
typedef void (*DGE_CallbackType)(void) DGE_Callback;
typedef DGE_Unsig (*DGE_CallbackUUU)(DGE_Unsig, DGE_Unsig) DGE_Callback;
typedef void (*DGE_CallbackVU)(DGE_Unsig) DGE_Callback;
enum // DGE_Align
{
DGE_Align_Keep,
DGE_Align_Left = 1,
DGE_Align_Right,
DGE_Align_Center,
DGE_Align_RightBox,
DGE_Align_CenterBox,
DGE_Align_Top = 1,
DGE_Align_Bottom,
//DGE_Align_Center,
};
enum // DGE_Axis
{
DGE_Axis_Up,
DGE_Axis_Down,
DGE_Axis_Left,
DGE_Axis_Right,
DGE_Axis_Forward,
DGE_Axis_Backward,
};
enum // DGE_ButtonState
{
DGE_Button_Down = 1 << 0,
DGE_Button_WasDown = 1 << 1,
DGE_Button_Hold = DGE_Button_Down | DGE_Button_WasDown,
DGE_Button_Release = DGE_Button_WasDown,
DGE_Button_Press = DGE_Button_Down,
};
enum // DGE_Key
{
DGE_Key_Backspace = '\b',
DGE_Key_Tab = '\t',
DGE_Key_Return = '\r',
DGE_Key_Escape = '\033',
DGE_Key_Delete = '\177',
DGE_Key_Special = 0x40000000,
DGE_Key_Capslock = DGE_Key_Special + 0x39,
DGE_Key_F1, DGE_Key_F2, DGE_Key_F3, DGE_Key_F4,
DGE_Key_F5, DGE_Key_F6, DGE_Key_F7, DGE_Key_F8,
DGE_Key_F9, DGE_Key_F10, DGE_Key_F11, DGE_Key_F12,
DGE_Key_SysRq,
DGE_Key_ScrollLock,
DGE_Key_Pause,
DGE_Key_Insert, DGE_Key_Home, DGE_Key_PageUp,
DGE_Key_End, DGE_Key_PageDown,
DGE_Key_Right, DGE_Key_Left, DGE_Key_Down, DGE_Key_Up,
DGE_Key_NumLock,
DGE_Key_KP_Div, DGE_Key_KP_Mul, DGE_Key_KP_Sub, DGE_Key_KP_Add,
DGE_Key_KP_Enter,
DGE_Key_KP_1, DGE_Key_KP_2, DGE_Key_KP_3,
DGE_Key_KP_4, DGE_Key_KP_5, DGE_Key_KP_6,
DGE_Key_KP_7, DGE_Key_KP_8, DGE_Key_KP_9,
DGE_Key_KP_0, DGE_Key_KP_Dot
};
enum // DGE_MouseButton
{
DGE_Mouse_Left,
DGE_Mouse_Middle,
DGE_Mouse_Right,
DGE_Mouse_Extra1,
DGE_Mouse_Extra2,
DGE_Mouse_Extra3,
DGE_Mouse_Extra4
};
enum // DGE_PadControl
{
DGE_Pad_A,
DGE_Pad_B,
DGE_Pad_X,
DGE_Pad_Y,
DGE_Pad_Back,
DGE_Pad_Menu,
DGE_Pad_Start,
DGE_Pad_StickLeft,
DGE_Pad_StickRight,
DGE_Pad_ShoulderLeft,
DGE_Pad_ShoulderRight,
DGE_Pad_DPadUp,
DGE_Pad_DPadDown,
DGE_Pad_DPadLeft,
DGE_Pad_DPadRight,
DGE_Pad_LStickUp,
DGE_Pad_LStickDown,
DGE_Pad_LStickLeft,
DGE_Pad_LStickRight,
DGE_Pad_RStickUp,
DGE_Pad_RStickDown,
DGE_Pad_RStickLeft,
DGE_Pad_RStickRight,
DGE_Pad_TriggerLeft,
DGE_Pad_TriggerRight
};
typedef struct DGE_Color
{
DGE_Angle r, g, b, a;
} DGE_Color;
typedef struct DGE_Item
{
DGE_Unsig type;
DGE_Unsig data;
DGE_Unsig size;
} DGE_Item;
typedef struct DGE_Point2X
{
DGE_Fixed x, y;
} DGE_Point2X;
typedef struct DGE_Point2I
{
DGE_Integ x, y;
} DGE_Point2I;
typedef struct DGE_Point3R
{
DGE_Fract x, y, z;
} DGE_Point3R;
typedef struct DGE_Particle
{
DGE_Integ life;
DGE_Point2X pos;
DGE_Point2X vel;
DGE_Point2X accel;
DGE_Point2X size;
DGE_Point2X sizedest;
DGE_Fixed sizespeed;
DGE_Color color;
DGE_Color colordest;
DGE_Fixed colorspeed;
DGE_Fixed rot;
DGE_Fixed rotspeed;
} DGE_Particle;
struct DGE_Object;
struct DGE_Inventory;
struct DGE_ItemData;
struct DGE_ItemType;
struct DGE_Sector;
struct DGE_Team;
struct DGE_Thinker;
struct DGE_ParticleSys;
struct DGE_PointThinker;
struct DGE_RenderThinker;
struct DGE_PhysicsThinker;
struct DGE_Entity;
struct DGE_MissileEntity;
struct DGE_ScriptedEntity;
//----------------------------------------------------------------------------|
// Extern Functions |
//
DGE_Native void DGE_Audio_SetDopplerSpeed(DGE_Fixed meterspersecond);
DGE_OptArgs(4)
DGE_Native void DGE_Audio_SetListener(DGE_Fixed x, DGE_Fixed y, DGE_Fixed z, DGE_Fixed velx, DGE_Fixed vely, DGE_Fixed velz, DGE_Fixed angle);
DGE_Native DGE_Unsig DGE_BlockMap_Find(DGE_Fixed xl, DGE_Fixed yl, DGE_Fixed xu, DGE_Fixed yu);
DGE_Native DGE_Unsig DGE_BlockMap_FindAll(void);
DGE_Native DGE_Unsig DGE_BlockMap_FindCountSector(DGE_Unsig find);
DGE_Native DGE_Unsig DGE_BlockMap_FindCountThinker(DGE_Unsig find);
DGE_Native void DGE_BlockMap_FindFree(DGE_Unsig find);
DGE_Native DGE_Unsig DGE_BlockMap_FindGetSector(DGE_Unsig find, DGE_Unsig idx);
DGE_Native DGE_Unsig DGE_BlockMap_FindGetThinker(DGE_Unsig find, DGE_Unsig idx);
DGE_Native void DGE_BlockMap_Split(DGE_Fixed minSize, DGE_Unsig maxObj);
DGE_Native void DGE_Callback_Register(DGE_Unsig cb, DGE_CallbackType fn);
DGE_Native void DGE_Callback_Unregister(DGE_Unsig cb, DGE_CallbackType fn);
DGE_Native void DGE_DebugCallStk(void);
DGE_OptArgs(1)
DGE_Native void DGE_DebugDataStk(DGE_Unsig dump);
DGE_Native void DGE_DebugLocReg(void);
DGE_Native void DGE_Dir_Close(DGE_Integ fd);
DGE_Native DGE_Integ DGE_Dir_Create(char const *name);
DGE_Native DGE_Unsig DGE_Dir_Name(DGE_Integ fd, char *buf, DGE_Unsig len);
DGE_Native DGE_Integ DGE_Dir_Open(char const *name);
DGE_Native DGE_Integ DGE_Dir_Read(DGE_Integ fd);
DGE_Native DGE_Integ DGE_Dir_ReadDir(DGE_Integ fd);
DGE_Native DGE_Integ DGE_Dir_ReadFile(DGE_Integ fd);
DGE_Native DGE_Unsig DGE_Dir_ReadName(DGE_Integ fd, char *buf, DGE_Unsig len);
DGE_Native DGE_Integ DGE_Dir_Remove(char const *name);
DGE_Native void DGE_Dir_Rewind(DGE_Integ fd);
DGE_Native void DGE_Draw_Circle(DGE_Fixed x, DGE_Fixed y, DGE_Fixed r);
DGE_Native void DGE_Draw_CircleLine(DGE_Fixed x, DGE_Fixed y, DGE_Fixed r);
DGE_Native void DGE_Draw_CirclePrecision(DGE_Integ subdivisions);
DGE_Native void DGE_Draw_Ellipse(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2);
DGE_Native void DGE_Draw_EllipseLine(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2);
DGE_OptArgs(1)
DGE_Native void DGE_Draw_Rectangle(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2, DGE_Angle rot);
DGE_OptArgs(1)
DGE_Native void DGE_Draw_RectangleLine(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2, DGE_Angle rot);
DGE_OptArgs(4)
DGE_Native void DGE_Draw_SetColor(DGE_Angle r, DGE_Angle g, DGE_Angle b, DGE_Angle a);
DGE_OptArgs(1)
DGE_Native void DGE_Draw_SetTextAlign(DGE_Integ h, DGE_Integ v);
DGE_Native void DGE_Draw_Line(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2);
DGE_Native void DGE_Draw_LineSmooth(DGE_Unsig on);
DGE_Native void DGE_Draw_LineWidth(DGE_Integ width);
DGE_OptArgs(1)
DGE_Native DGE_Point2X DGE_Draw_Text(DGE_Fixed x, DGE_Fixed y, char const *str, DGE_Fixed maxwidth);
DGE_Native void DGE_Draw_Triangle(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2, DGE_Fixed x3, DGE_Fixed y3);
DGE_Native void DGE_Draw_TriangleLine(DGE_Fixed x1, DGE_Fixed y1, DGE_Fixed x2, DGE_Fixed y2, DGE_Fixed x3, DGE_Fixed y3);
DGE_Native DGE_Unsig DGE_Entity_Create(DGE_Unsig ext);
DGE_Native void DGE_File_Close(DGE_Integ fd);
DGE_Native DGE_Integ DGE_File_Create(char const *name, char const *data, DGE_Unsig size);
DGE_Native DGE_Integ DGE_File_Get(DGE_Integ fd, DGE_UnsigL idx);
DGE_Native DGE_Unsig DGE_File_Name(DGE_Integ fd, char *buf, DGE_Unsig len);
DGE_Native DGE_Integ DGE_File_Open(char const *name);
DGE_Native DGE_Integ DGE_File_Read(DGE_Integ fd, DGE_UnsigL idx, char *buf, DGE_Unsig len);
DGE_Native DGE_Integ DGE_File_Remove(char const *name);
DGE_Native DGE_UnsigL DGE_File_Size(DGE_Integ fd);
DGE_Native void DGE_Font_Bind(DGE_Unsig fnt);
DGE_Native DGE_Unsig DGE_Font_Create(DGE_String name, char const *fname, DGE_Integ ptSize);
DGE_Native DGE_Unsig DGE_Font_Get(DGE_String name);
DGE_Native DGE_Point2X DGE_Font_GetTextSize(DGE_Unsig fnt, char const *text);
DGE_Native void *DGE_FreestoreBegin(void);
DGE_Native void *DGE_FreestoreEnd(void);
DGE_Native DGE_Point3R DGE_Input_GetAxis(DGE_Unsig player, DGE_Unsig num);
DGE_Native DGE_Unsig DGE_Input_GetButton(DGE_Unsig player, DGE_Unsig btn);
DGE_Native DGE_Point2I DGE_Input_GetCursor(DGE_Unsig player);
DGE_Native void DGE_Input_SetAxisKey(DGE_Unsig num, DGE_Unsig axis, DGE_Integ set);
DGE_Native void DGE_Input_SetAxisPad(DGE_Unsig num, DGE_Unsig axis, DGE_Unsig set);
DGE_Native void DGE_Input_SetAxisMouse(DGE_Unsig num, DGE_Unsig axis, DGE_Unsig set);
DGE_Native void DGE_Input_SetBindKey(DGE_Unsig btn, DGE_Integ ch);
DGE_Native void DGE_Input_SetBindPad(DGE_Unsig btn, DGE_Unsig num);
DGE_Native void DGE_Input_SetBindMouse(DGE_Unsig btn, DGE_Unsig num);
DGE_Native DGE_Unsig DGE_Inventory_Create(DGE_Unsig ic, DGE_Unsig ext);
DGE_Native DGE_Item DGE_Inventory_ItemGet(DGE_Unsig id, DGE_Unsig i);
DGE_Native void DGE_Inventory_ItemSet(DGE_Unsig id, DGE_Unsig i, DGE_Item val);
DGE_Native DGE_Unsig DGE_ItemData_Create(DGE_Unsig ext);
DGE_Native DGE_Unsig DGE_ItemType_Create(DGE_Unsig ext);
DGE_Native DGE_Unsig DGE_MissileEntity_Create(DGE_Unsig ext);
DGE_Native DGE_Unsig DGE_Object_Cast(DGE_Unsig id, DGE_Unsig type);
DGE_Native DGE_Unsig DGE_Object_MemberGet(DGE_Unsig id, DGE_Unsig mem, DGE_Unsig len);
DGE_Native void DGE_Object_MemberSet(DGE_Unsig id, DGE_Unsig mem, ...);
DGE_Native void DGE_Object_RefAdd(DGE_Unsig id);
DGE_Native void DGE_Object_RefSub(DGE_Unsig id);
DGE_Native void DGE_ParticleSys_Add(DGE_Unsig id, DGE_Particle prt);
DGE_Native DGE_Unsig DGE_ParticleSys_Create(DGE_Unsig ext, DGE_Unsig npr);
DGE_Native void DGE_PhysicsThinker_ApplyFriction(DGE_Unsig id, DGE_Fract f);
DGE_Native void DGE_PhysicsThinker_Block(DGE_Unsig id);
DGE_OptArgs(1)
DGE_Native DGE_Unsig DGE_PhysicsThinker_Collide(DGE_Unsig id, DGE_Fixed *oldx,
DGE_Fixed *oldy, DGE_Fixed *oldz, DGE_Fract *fric);
DGE_Native DGE_Unsig DGE_PhysicsThinker_Create(DGE_Unsig ext);
DGE_Native void DGE_PhysicsThinker_Unblock(DGE_Unsig id);
DGE_Native DGE_Unsig DGE_PointThinker_Create(DGE_Unsig ext);
DGE_Native void DGE_PrintChar(DGE_Unsig c);
DGE_Native void DGE_PrintWordD(DGE_Unsig d);
DGE_Native DGE_Point2X DGE_Renderer_GetViewpoint(void);
DGE_Native void DGE_Renderer_SetViewpoint(DGE_Unsig id);
DGE_Native void DGE_Renderer_SetVirtualRes(DGE_Unsig w, DGE_Unsig h);
DGE_Native DGE_Unsig DGE_RenderThinker_Create(DGE_Unsig ext);
DGE_Native DGE_Unsig DGE_ScriptedEntity_Create(DGE_Unsig ext);
DGE_Native void DGE_Sector_Block(DGE_Unsig id);
DGE_Native void DGE_Sector_CalcBounds(DGE_Unsig id);
DGE_Native DGE_Unsig DGE_Sector_Create(DGE_Unsig pc, DGE_Unsig ext);
DGE_Native DGE_Point2X DGE_Sector_PointGet(DGE_Unsig id, DGE_Unsig p);
DGE_Native void DGE_Sector_PointSet(DGE_Unsig id, DGE_Unsig p, DGE_Point2X val);
DGE_Native void DGE_Sector_Unblock(DGE_Unsig id);
DGE_Native void DGE_Shader_Bind(DGE_Unsig shd);
DGE_Native DGE_Unsig DGE_Shader_CreateData(DGE_String name, char const *frag, char const *vert);
DGE_Native DGE_Unsig DGE_Shader_CreateFile(DGE_String name, char const *frag, char const *vert);
DGE_Native DGE_Unsig DGE_Shader_Get(DGE_String name);
DGE_Native void DGE_Shell_GetArgBuf(DGE_Unsig sh, char *buf);
DGE_Native DGE_Unsig DGE_Shell_GetArgBufLen(DGE_Unsig sh);
DGE_Native DGE_Unsig DGE_Shell_GetArgC(DGE_Unsig sh);
DGE_Native void DGE_Shell_GetArgV(DGE_Unsig sh, char **argv, char *buf);
DGE_Native DGE_Unsig DGE_Shell_ReadStd(DGE_Unsig sh, char *buf, DGE_Unsig len);
DGE_Native DGE_Unsig DGE_Shell_WriteErr(DGE_Unsig sh, char const *buf, DGE_Unsig len);
DGE_Native DGE_Unsig DGE_Shell_WriteStd(DGE_Unsig sh, char const *buf, DGE_Unsig len);
DGE_Native DGE_Unsig DGE_Sound_Get(DGE_String name);
DGE_Native void DGE_Sound_Play(DGE_Unsig src, DGE_Unsig chan);
DGE_Native void DGE_Sound_SetLoop(DGE_Unsig src, DGE_Unsig chan, DGE_Unsig on);
DGE_OptArgs(1)
DGE_Native DGE_Fixed DGE_Sound_SetPitch(DGE_Unsig src, DGE_Unsig chan, DGE_Angle pitch);
DGE_Native void DGE_Sound_SetPos(DGE_Unsig src, DGE_Unsig chan, DGE_Fixed x, DGE_Fixed y, DGE_Fixed z);
DGE_Native void DGE_Sound_SetVolume(DGE_Unsig src, DGE_Unsig chan, DGE_Angle volume);
DGE_Native void DGE_Sound_Stop(DGE_Unsig src, DGE_Unsig chan);
DGE_OptArgs(1)
DGE_Native DGE_Unsig DGE_SoundSrc_Bind(DGE_Unsig src, DGE_Unsig snd, DGE_Unsig chan);
DGE_Native DGE_Unsig DGE_SoundSrc_Create(DGE_Fixed x, DGE_Fixed y, DGE_Fixed z);
DGE_Native void DGE_SoundSrc_Destroy(DGE_Unsig src);
DGE_OptArgs(1)
DGE_Native DGE_Unsig DGE_SoundSrc_Play(DGE_Unsig src, DGE_Unsig snd, DGE_Unsig chan);
DGE_Native void DGE_SoundSrc_SetPos(DGE_Unsig src, DGE_Fixed x, DGE_Fixed y, DGE_Fixed z);
DGE_Native void DGE_SoundSrc_SetVel(DGE_Unsig src, DGE_Fixed x, DGE_Fixed y, DGE_Fixed z);
DGE_Native DGE_String DGE_String_Create(char const *str, DGE_Unsig len);
DGE_Native DGE_Unsig DGE_Task_Create(DGE_Unsig thread, DGE_CallbackType fn, ...);
DGE_Native void DGE_Task_Sleep(DGE_Unsig id, DGE_Unsig ticks);
DGE_Native DGE_Unsig DGE_Team_Create(DGE_Unsig ext);
DGE_Native DGE_Unsig DGE_Text_Read(DGE_String name, char *buf, DGE_Unsig len);
DGE_Native void DGE_Texture_Bind(DGE_Unsig tex);
DGE_Native DGE_Unsig DGE_Texture_Create(DGE_String name, char const *fname);
DGE_Native DGE_Unsig DGE_Texture_Get(DGE_String name);
DGE_Native DGE_Point2I DGE_Texture_GetSize(DGE_Unsig tex);
DGE_Native DGE_Unsig DGE_Thinker_Head(void);
DGE_Native void DGE_Thinker_Insert(DGE_Unsig id);
DGE_Native void DGE_Thinker_Think(DGE_Unsig id);
DGE_Native void DGE_Thinker_ThinkAll(void);
DGE_Native void DGE_Thinker_Unlink(DGE_Unsig id);
DGE_Native DGE_Integ DGE_Window_GetHeight(void);
DGE_Native DGE_Integ DGE_Window_GetWidth(void);
DGE_Native void DGE_Window_SetTitle(char const *str);
//----------------------------------------------------------------------------|
// Property Types |
//
//
// DGE_Object
//
#define DGE_ObjectProps() \
DGE_PropMem(DGE_Unsig, emc, DGE_OM_emc)
typedef struct DGE_Object
{
DGE_Unsig id;
DGE_ObjectProps()
} DGE_Object;
//
// DGE_Inventory
//
#define DGE_InventoryProps() DGE_ObjectProps() \
DGE_PropMem(DGE_Unsig, ic, DGE_OM_ic)
typedef struct DGE_Inventory
{
DGE_Unsig id;
DGE_InventoryProps()
} DGE_Inventory;
//
// DGE_ItemData
//
#define DGE_ItemDataProps() DGE_ObjectProps()
typedef struct DGE_ItemData
{
DGE_Unsig id;
DGE_ItemDataProps()
} DGE_ItemData;
//
// DGE_ItemType
//
#define DGE_ItemTypeProps() DGE_ObjectProps()
typedef struct DGE_ItemType
{
DGE_Unsig id;
DGE_ItemTypeProps()
} DGE_ItemType;
//
// DGE_Sector
//
#define DGE_SectorProps() DGE_ObjectProps() \
DGE_PropMem(DGE_Fract, frictair, DGE_OM_frictair) \
DGE_PropMem(DGE_Fract, friction, DGE_OM_friction) \
DGE_PropMem(DGE_Fixed, gx, DGE_OM_gx) \
DGE_PropMem(DGE_Fixed, gy, DGE_OM_gy) \
DGE_PropMem(DGE_Fixed, gz, DGE_OM_gz) \
DGE_PropMem(DGE_Unsig, pc, DGE_OM_pc) \
DGE_PropMem(DGE_Unsig, texc, DGE_OM_texc) \
DGE_PropMem(DGE_Unsig, texf, DGE_OM_texf) \
DGE_PropMem(DGE_Fixed, xl, DGE_OM_xl) \
DGE_PropMem(DGE_Fixed, xu, DGE_OM_xu) \
DGE_PropMem(DGE_Fixed, yl, DGE_OM_yl) \
DGE_PropMem(DGE_Fixed, yu, DGE_OM_yu) \
DGE_PropMem(DGE_Fixed, zl, DGE_OM_zl) \
DGE_PropMem(DGE_Fixed, zu, DGE_OM_zu)
typedef struct DGE_Sector
{
DGE_Unsig id;
DGE_SectorProps()
} DGE_Sector;
//
// DGE_Team
//
#define DGE_TeamProps() DGE_ObjectProps() \
DGE_PropMem(DGE_Unsig, entfi, DGE_OM_entfi) \
DGE_PropMem(DGE_Unsig, entla, DGE_OM_entla) \
DGE_PropMem(DGE_Unsig, owner, DGE_OM_owner) \
DGE_PropMem(DGE_Unsig, teamfi, DGE_OM_teamfi) \
DGE_PropMem(DGE_Unsig, teamla, DGE_OM_teamla) \
DGE_PropMem(DGE_Unsig, teamne, DGE_OM_teamne) \
DGE_PropMem(DGE_Unsig, teampr, DGE_OM_teampr)
typedef struct DGE_Team
{
DGE_Unsig id;
DGE_TeamProps()
} DGE_Team;
//
// DGE_Thinker
//
#define DGE_ThinkerProps() DGE_ObjectProps() \
DGE_PropMem(DGE_Unsig, next, DGE_OM_next) \
DGE_PropMem(DGE_Unsig, prev, DGE_OM_prev)
typedef struct DGE_Thinker
{
DGE_Unsig id;
DGE_ThinkerProps()
} DGE_Thinker;
//
// DGE_ParticleSys
//
#define DGE_ParticleSysProps() DGE_ThinkerProps() \
DGE_PropMem(DGE_Unsig, sprite, DGE_OM_sprite) \
DGE_PropMem(DGE_Fixed, x, DGE_OM_x) \
DGE_PropMem(DGE_Fixed, y, DGE_OM_y)
typedef struct DGE_ParticleSys
{
DGE_Unsig id;
DGE_ParticleSysProps()
} DGE_ParticleSys;
//
// DGE_PointThinker
//
#define DGE_PointThinkerProps() DGE_ThinkerProps() \
DGE_PropMem(DGE_Angle, pitch, DGE_OM_pitch) \
DGE_PropMem(DGE_Fixed, x, DGE_OM_x) \
DGE_PropMem(DGE_Fixed, y, DGE_OM_y) \
DGE_PropMem(DGE_Angle, yaw, DGE_OM_yaw) \
DGE_PropMem(DGE_Fixed, z, DGE_OM_z)
typedef struct DGE_PointThinker
{
DGE_Unsig id;
DGE_PointThinkerProps()
} DGE_PointThinker;
//
// DGE_RenderThinker
//
#define DGE_RenderThinkerProps() DGE_PointThinkerProps() \
DGE_PropMem(DGE_Angle, ca, DGE_OM_ca) \
DGE_PropMem(DGE_Angle, cb, DGE_OM_cb) \
DGE_PropMem(DGE_Angle, cg, DGE_OM_cg) \
DGE_PropMem(DGE_Angle, cr, DGE_OM_cr) \
DGE_PropMem(DGE_Fixed, rsx, DGE_OM_rsx) \
DGE_PropMem(DGE_Fixed, rsy, DGE_OM_rsy) \
DGE_PropMem(DGE_Unsig, sprite, DGE_OM_sprite) \
DGE_PropMem(DGE_Unsig, shader, DGE_OM_shader)
typedef struct DGE_RenderThinker
{
DGE_Unsig id;
DGE_RenderThinkerProps()
} DGE_RenderThinker;
//
// DGE_PhysicsThinker
//
#define DGE_PhysicsThinkerProps() DGE_RenderThinkerProps() \
DGE_PropMem(DGE_Fixed, bvx, DGE_OM_bvx) \
DGE_PropMem(DGE_Fixed, bvy, DGE_OM_bvy) \
DGE_PropMem(DGE_Fixed, bvz, DGE_OM_bvz) \
DGE_PropMem(DGE_Fract, friction, DGE_OM_friction) \
DGE_PropMem(DGE_Fixed, grabx, DGE_OM_grabx) \
DGE_PropMem(DGE_Fixed, graby, DGE_OM_graby) \
DGE_PropMem(DGE_Fixed, grabz, DGE_OM_grabz) \
DGE_PropMem(DGE_Fixed, gx, DGE_OM_gx) \
DGE_PropMem(DGE_Fixed, gy, DGE_OM_gy) \
DGE_PropMem(DGE_Fixed, gz, DGE_OM_gz) \
DGE_PropMem(DGE_Fixed, mass, DGE_OM_mass) \
DGE_PropMem(DGE_Fixed, sx, DGE_OM_sx) \
DGE_PropMem(DGE_Fixed, sy, DGE_OM_sy) \
DGE_PropMem(DGE_Fixed, sz, DGE_OM_sz) \
DGE_PropMem(DGE_Fixed, vx, DGE_OM_vx) \
DGE_PropMem(DGE_Fixed, vy, DGE_OM_vy) \
DGE_PropMem(DGE_Fixed, vz, DGE_OM_vz)
typedef struct DGE_PhysicsThinker
{
DGE_Unsig id;
DGE_PhysicsThinkerProps()
} DGE_PhysicsThinker;
//
// DGE_Entity
//
#define DGE_EntityProps() DGE_PhysicsThinkerProps() \
DGE_PropMem(DGE_Integ, health, DGE_OM_health) \
DGE_PropMem(DGE_Unsig, team, DGE_OM_team) \
DGE_PropMem(DGE_Unsig, teamne, DGE_OM_teamne) \
DGE_PropMem(DGE_Unsig, teampr, DGE_OM_teampr)
typedef struct DGE_Entity
{
DGE_Unsig id;
DGE_EntityProps()
} DGE_Entity;
//
// DGE_MissileEntity
//
#define DGE_MissileEntityProps() DGE_EntityProps() \
DGE_PropMem(DGE_Unsig, damage, DGE_OM_damage) \
DGE_PropMem(DGE_Unsig, owner, DGE_OM_owner)
typedef struct DGE_MissileEntity
{
DGE_Unsig id;
DGE_MissileEntityProps()
} DGE_MissileEntity;
//
// DGE_ScriptedEntity
//
#define DGE_ScriptedEntityProps() DGE_EntityProps() \
DGE_PropMem(DGE_CallbackUUU, collideF, DGE_OM_collideF) \
DGE_PropMem(DGE_CallbackUUU, collideI, DGE_OM_collideI) \
DGE_PropMem(DGE_CallbackVU, think, DGE_OM_think)
#endif//__GDCC_Header__C__Doominati_h__

View file

@ -1,52 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2015 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libGDCC.
//
// This header declares functions, objects, and types which are specific and
// possibly internal to GDCC. Neither the contents or existence of this file
// should be relied upon by external projects.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__GDCC_h__
#define __GDCC_Header__C__GDCC_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// __GDCC__Sta
//
#define __GDCC__Sta __glyph(int, "___GDCC__Sta")
//----------------------------------------------------------------------------|
// Extern Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
[[call("StkCall")]]
extern void __sta *__GDCC__alloc(void __sta *_ptr, __size_t _size);
[[call("StkCall")]]
extern void __GDCC__alloc_dump(void);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__GDCC_h__

View file

@ -1,52 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2017 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Function chooser macros.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__GDCC__FuncChooser_h__
#define __GDCC_Header__C__GDCC__FuncChooser_h__
//----------------------------------------------------------------------------|
// Macros |
//
#define GDCC_ListChooser0(a0, ...) a0
#define GDCC_ListChooser1(a0, a1, ...) a1
#define GDCC_ListChooser2(a0, a1, a2, ...) a2
#define GDCC_ListChooser3(a0, a1, a2, a3, ...) a3
#define GDCC_ListChooser4(a0, a1, a2, a3, a4, ...) a4
#define GDCC_ListChooser5(a0, a1, a2, a3, a4, a5, ...) a5
#define GDCC_ListChooser6(a0, a1, a2, a3, a4, a5, a6, ...) a6
#define GDCC_ListChooser7(a0, a1, a2, a3, a4, a5, a6, a7, ...) a7
#define GDCC_ListChooser8(a0, a1, a2, a3, a4, a5, a6, a7, a8, ...) a8
#define GDCC_ListChooser9(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, ...) a9
#define GDCC_ListChooser(n, ...) GDCC_ListChooser##n(__VA_ARGS__)
#define GDCC_FuncChooserArgs0(f) f##0
#define GDCC_FuncChooserArgs1(f) f##1, GDCC_FuncChooserArgs0(f)
#define GDCC_FuncChooserArgs2(f) f##2, GDCC_FuncChooserArgs1(f)
#define GDCC_FuncChooserArgs3(f) f##3, GDCC_FuncChooserArgs2(f)
#define GDCC_FuncChooserArgs4(f) f##4, GDCC_FuncChooserArgs3(f)
#define GDCC_FuncChooserArgs5(f) f##5, GDCC_FuncChooserArgs4(f)
#define GDCC_FuncChooserArgs6(f) f##6, GDCC_FuncChooserArgs5(f)
#define GDCC_FuncChooserArgs7(f) f##7, GDCC_FuncChooserArgs6(f)
#define GDCC_FuncChooserArgs8(f) f##8, GDCC_FuncChooserArgs7(f)
#define GDCC_FuncChooserArgs9(f) f##9, GDCC_FuncChooserArgs8(f)
#define GDCC_FuncChooser(f, n, ...) \
GDCC_ListChooser(n, GDCC_FuncChooserArgs##n __VA_ARGS__ (f), GDCC_FuncChooserArgs##n(f))
#define GDCC_FuncChooserCall(f, n, ...) GDCC_FuncChooser(f, n, __VA_ARGS__)(__VA_ARGS__)
#endif//__GDCC_Header__C__GDCC__FuncChooser_h__

View file

@ -1,241 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2017 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Generic HashMap generator.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__GDCC__HashMap_h__
#define __GDCC_Header__C__GDCC__HashMap_h__
//----------------------------------------------------------------------------|
// Macros |
//
//
// GDCC_HashMap_Decl
//
// Required functions:
// Key name##_GetKey (T *obj);
// T **name##_GetNext(T *obj);
// T ***name##_GetPrev(T *obj);
// size_t name##_HashKey(Key key);
// size_t name##_HashObj(T *obj);
// int name##_KeyCmp (Key l, Key r);
//
// These may be implemented as macros, but must evaluate their arguments
// exactly once.
//
#define GDCC_HashMap_Decl(name, Key, T) \
typedef struct name name; \
\
void name##_ctor(name *map, size_t chainC, size_t growC); \
void name##_dtor(name *map); \
\
void name##_Clear (name *map); \
T *name##_Find (name *map, Key key); \
void name##_Insert(name *map, T *obj); \
void name##_Resize(name *map, size_t count); \
void name##_Unlink(name *map, T *obj); \
\
GDCC_HashMap_DeclStruct(name, Key, T)
//
// GDCC_HashMap_DeclStruct
//
#if __GDCC__ // GDCC properties version.
# define GDCC_HashMap_DeclStruct(name, Key, T) \
struct name \
{ \
__prop clear {call: name##_Clear(this)} \
__prop find {call: name##_Find(this)} \
__prop insert {call: name##_Insert(this)} \
__prop resize {call: name##_Resize(this)} \
__prop unlink {call: name##_Unlink(this)} \
\
T **chainV; \
size_t chainC; \
\
size_t objC; \
size_t growC; \
};
#else // Generic C version.
# define GDCC_HashMap_DeclStruct(name, Key, T) \
struct name \
{ \
T **chainV; \
size_t chainC; \
\
size_t objC; \
size_t growC; \
};
#endif
//
// GDCC_HashMap_Defn
//
#define GDCC_HashMap_Defn(name, Key, T) \
GDCC_HashMap_Defn_ctor(name, Key, T) \
GDCC_HashMap_Defn_dtor(name, Key, T) \
\
GDCC_HashMap_Defn_Clear( name, Key, T) \
GDCC_HashMap_Defn_Find( name, Key, T) \
GDCC_HashMap_Defn_Insert(name, Key, T) \
GDCC_HashMap_Defn_Resize(name, Key, T) \
GDCC_HashMap_Defn_Unlink(name, Key, T) \
//
// GDCC_HashMap_Defn_ctor
//
#define GDCC_HashMap_Defn_ctor(name, Key, T) \
void name##_ctor(name *map, size_t chainC, size_t growC) \
{ \
map->chainV = malloc(sizeof(T *) * chainC); \
map->chainC = chainC; \
map->objC = 0; \
map->growC = growC; \
\
for(T **chain = map->chainV, **chainE = chain + chainC; chain != chainE; ++chain) \
*chain = NULL; \
}
//
// GDCC_HashMap_Defn_dtor
//
#define GDCC_HashMap_Defn_dtor(name, Key, T) \
void name##_dtor(name *map) \
{ \
free(map->chainV); \
}
//
// GDCC_HashMap_Defn_Clear
//
#define GDCC_HashMap_Defn_Clear(name, Key, T) \
void name##_Clear(name *map) \
{ \
for(T **chain = map->chainV, **chainE = chain + map->chainC; \
chain != chainE; ++chain) \
{ \
while(*chain) \
{ \
T **next = name##_GetNext(*chain); \
T ***prev = name##_GetPrev(*chain); \
\
if((**prev = *next)) \
*name##_GetPrev(*next) = *prev; \
\
*next = NULL; \
*prev = NULL; \
} \
} \
\
map->objC = 0; \
}
//
// GDCC_HashMap_Defn_Find
//
#define GDCC_HashMap_Defn_Find(name, Key, T) \
T *name##_Find(name *map, Key key) \
{ \
for(T *obj = map->chainV[name##_HashKey(key) % map->chainC]; obj; \
obj = *name##_GetNext(obj)) \
{ \
if(!name##_KeyCmp(key, name##_GetKey(obj))) \
return obj; \
} \
\
return NULL; \
}
//
// GDCC_HashMap_Defn_Insert
//
#define GDCC_HashMap_Defn_Insert(name, Key, T) \
void name##_Insert(name *map, T *obj) \
{ \
if(map->objC >= map->chainC) \
name##_Resize(map, map->chainC + map->chainC / 2 + map->growC); \
\
++map->objC; \
\
T **head = &map->chainV[name##_HashObj(obj) % map->chainC]; \
T **next = name##_GetNext(obj); \
\
if((*next = *head)) \
*name##_GetPrev(*head) = next; \
*name##_GetPrev(obj) = head; \
*head = obj; \
}
//
// GDCC_HashMap_Defn_Resize
//
#define GDCC_HashMap_Defn_Resize(name, Key, T) \
void name##_Resize(name *map, size_t count) \
{ \
\
T **oldChainV = map->chainV; \
size_t oldChainC = map->chainC; \
\
map->chainV = malloc(sizeof(T *) * count); \
map->chainC = count; \
\
for(T **chain = map->chainV, **chainE = chain + count; chain != chainE; ++chain) \
*chain = NULL; \
\
/* Relink elements. */ \
for(T **chain = oldChainV, **chainE = chain + oldChainC; chain != chainE; ++chain) \
{ \
while(*chain) \
{ \
T *obj = *chain; \
T **next = name##_GetNext(obj); \
T ***prev = name##_GetPrev(obj); \
\
/* Unlink from old chain. */ \
if((**prev = *next)) \
*name##_GetPrev(*next) = *prev; \
\
/* Insert into new chain. */ \
T **head = &map->chainV[name##_HashObj(obj) % map->chainC]; \
\
if((*next = *head)) \
*name##_GetPrev(*head) = next; \
*name##_GetPrev(obj) = head; \
*head = obj; \
} \
} \
\
free(oldChainV); \
}
//
// GDCC_HashMap_Defn_Unlink
//
#define GDCC_HashMap_Defn_Unlink(name, Key, T) \
void name##_Unlink(name *map, T *obj) \
{ \
--map->objC; \
\
T **next = name##_GetNext(obj); \
T ***prev = name##_GetPrev(obj); \
\
if((**prev = *next)) \
*name##_GetPrev(*next) = *prev; \
\
*next = NULL; \
*prev = NULL; \
}
#endif//__GDCC_Header__C__GDCC__HashMap_h__

View file

@ -1,262 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// This header declares functions, objects, and types which are specific and
// possibly internal to GDCC. Neither the contents or existence of this file
// should be relied upon by external projects.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__GDCC_libc_h__
#define __GDCC_Header__C__GDCC_libc_h__
#include <GDCC.h>
#ifdef __cplusplus
extern "C" {
#endif
//----------------------------------------------------------------------------|
// Macros |
//
//
// __GDCC__FormatBufLen
//
#define __GDCC__FormatBufLen 8192
//
// __GDCC__ForamtBufMid
//
#define __GDCC__FormatBufMid (__GDCC__FormatBuf + __GDCC__FormatBufLen / 2)
//
// __GDCC__FormatDecl
//
#define __GDCC__FormatDecl(group, fmt, T) \
[[call("StkCall")]] \
extern __GDCC__FormatRet (__GDCC__Format##group##_##fmt)( \
T _data, __GDCC__FormatArg _format)
//
// __GDCC__FormatDefn
//
#define __GDCC__FormatDefn(group, fmt, T) \
[[call("StkCall")]] \
__GDCC__FormatRet (__GDCC__Format##group##_##fmt)( \
T data, __GDCC__FormatArg format)
//
// __GDCC__FormatFlag_*
//
#define __GDCC__FormatFlag_Left 0x0001
#define __GDCC__FormatFlag_Sign 0x0002
#define __GDCC__FormatFlag_PadS 0x0004
#define __GDCC__FormatFlag_AltF 0x0008
#define __GDCC__FormatFlag_Pad0 0x0010
//
// __GDCC__FormatGenAccum
//
#define __GDCC__FormatGenAccum(data, format, group, fmt) \
(_Generic(data, \
_Accum: __GDCC__Format##group##_##fmt, \
unsigned _Accum: __GDCC__Format##group##_##fmt, \
short _Accum: __GDCC__Format##group##_##fmt##h, \
short unsigned _Accum: __GDCC__Format##group##_##fmt##h, \
long _Accum: __GDCC__Format##group##_##fmt##l, \
long unsigned _Accum: __GDCC__Format##group##_##fmt##l) \
((data), (format)))
//
// __GDCC__FormatGenFloat
//
#define __GDCC__FormatGenFloat(data, format, group, fmt) \
(_Generic(data, \
float: __GDCC__Format##group##_##fmt, \
double: __GDCC__Format##group##_##fmt##l, \
long double: __GDCC__Format##group##_##fmt##ll) \
((data), (format)))
//
// __GDCC__FormatGenInteg
//
#define __GDCC__FormatGenInteg(data, format, group, fmt) \
(_Generic(data, \
int: __GDCC__Format##group##_##fmt, \
unsigned: __GDCC__Format##group##_##fmt, \
long int: __GDCC__Format##group##_##fmt##l, \
long unsigned: __GDCC__Format##group##_##fmt##l, \
long long int: __GDCC__Format##group##_##fmt##ll, \
long long unsigned: __GDCC__Format##group##_##fmt##ll) \
((data), (format)))
//
// __GDCC__FormatF_*_g
//
#define __GDCC__FormatF_E_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, E)
#define __GDCC__FormatF_F_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, F)
#define __GDCC__FormatF_G_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, G)
#define __GDCC__FormatF_X_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, X)
#define __GDCC__FormatF_e_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, e)
#define __GDCC__FormatF_f_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, f)
#define __GDCC__FormatF_g_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, g)
#define __GDCC__FormatF_x_g(data, format) \
__GDCC__FormatGenFloat((data), (format), F, x)
//
// __GDCC__FormatI_*_g
//
#define __GDCC__FormatI_d_g(data, format) \
__GDCC__FormatGenInteg((data), (format), I, d)
//
// __GDCC__FormatK_*_g
//
#define __GDCC__FormatK_d_g(data, format) \
__GDCC__FormatGenAccum((data), (format), K, d)
//
// __GDCC__FormatU_*_g
//
#define __GDCC__FormatU_X_g(data, format) \
__GDCC__FormatGenInteg((data), (format), U, X)
#define __GDCC__FormatU_b_g(data, format) \
__GDCC__FormatGenInteg((data), (format), U, b)
#define __GDCC__FormatU_d_g(data, format) \
__GDCC__FormatGenInteg((data), (format), U, d)
#define __GDCC__FormatU_o_g(data, format) \
__GDCC__FormatGenInteg((data), (format), U, o)
#define __GDCC__FormatU_x_g(data, format) \
__GDCC__FormatGenInteg((data), (format), U, x)
//
// __GDCC__FormatX_*_g
//
#define __GDCC__FormatX_d_g(data, format) \
__GDCC__FormatGenAccum((data), (format), X, d)
//----------------------------------------------------------------------------|
// Types |
//
//
// __GDCC__FormatArg
//
typedef struct __GDCC__FormatArg
{
unsigned int _flags;
unsigned int _prec;
unsigned int _width;
} __GDCC__FormatArg;
//
// __GDCC__FormatRet
//
typedef struct __GDCC__FormatRet
{
char __sta *_begin;
char __sta *_end;
unsigned int _len;
} __GDCC__FormatRet;
//----------------------------------------------------------------------------|
// Extern Objects |
//
extern char __GDCC__FormatBuf[__GDCC__FormatBufLen];
//----------------------------------------------------------------------------|
// Extern Functions |
//
__GDCC__FormatDecl(F, E, float);
__GDCC__FormatDecl(F, El, double);
__GDCC__FormatDecl(F, Ell, long double);
__GDCC__FormatDecl(F, F, float);
__GDCC__FormatDecl(F, Fl, double);
__GDCC__FormatDecl(F, Fll, long double);
__GDCC__FormatDecl(F, G, float);
__GDCC__FormatDecl(F, Gl, double);
__GDCC__FormatDecl(F, Gll, long double);
__GDCC__FormatDecl(F, X, float);
__GDCC__FormatDecl(F, Xl, double);
__GDCC__FormatDecl(F, Xll, long double);
__GDCC__FormatDecl(F, e, float);
__GDCC__FormatDecl(F, el, double);
__GDCC__FormatDecl(F, ell, long double);
__GDCC__FormatDecl(F, f, float);
__GDCC__FormatDecl(F, fl, double);
__GDCC__FormatDecl(F, fll, long double);
__GDCC__FormatDecl(F, g, float);
__GDCC__FormatDecl(F, gl, double);
__GDCC__FormatDecl(F, gll, long double);
__GDCC__FormatDecl(F, x, float);
__GDCC__FormatDecl(F, xl, double);
__GDCC__FormatDecl(F, xll, long double);
__GDCC__FormatDecl(I, d, int);
__GDCC__FormatDecl(I, dl, long int);
__GDCC__FormatDecl(I, dll, long long int);
__GDCC__FormatDecl(K, d, unsigned _Accum);
__GDCC__FormatDecl(K, dh, short unsigned _Accum);
__GDCC__FormatDecl(K, dl, long unsigned _Accum);
__GDCC__FormatDecl(U, X, unsigned);
__GDCC__FormatDecl(U, Xl, long unsigned);
__GDCC__FormatDecl(U, Xll, long long unsigned);
__GDCC__FormatDecl(U, b, unsigned);
__GDCC__FormatDecl(U, bl, long unsigned);
__GDCC__FormatDecl(U, bll, long long unsigned);
__GDCC__FormatDecl(U, d, unsigned);
__GDCC__FormatDecl(U, dl, long unsigned);
__GDCC__FormatDecl(U, dll, long long unsigned);
__GDCC__FormatDecl(U, o, unsigned);
__GDCC__FormatDecl(U, ol, long unsigned);
__GDCC__FormatDecl(U, oll, long long unsigned);
__GDCC__FormatDecl(U, x, unsigned);
__GDCC__FormatDecl(U, xl, long unsigned);
__GDCC__FormatDecl(U, xll, long long unsigned);
__GDCC__FormatDecl(X, d, _Accum);
__GDCC__FormatDecl(X, dh, short _Accum);
__GDCC__FormatDecl(X, dl, long _Accum);
char __sta *__GDCC__GetFormatBuf(void);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__GDCC_libc_h__

View file

@ -1,61 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2015 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Diagnostics.
//
//-----------------------------------------------------------------------------
//----------------------------------------------------------------------------|
// Macros |
//
//
// assert
//
#ifdef assert
#undef assert
#endif
#ifdef NDEBUG
# define assert(ignore) ((void)0)
#else
# define assert(expression) \
if(!(expression)) \
{ \
extern struct __FILE __stderr; \
extern void abort(void); \
extern int fprintf(struct __FILE *restrict stream, \
char const *restrict format, ...); \
\
fprintf(&__stderr, \
"Assertion failed: %s, function %s, file %s, line %i.", \
#expression, __func__, __FILE__, __LINE__); \
abort(); \
} \
else ((void)0)
#endif
//
// static_assert
//
#if !defined(static_assert) && !defined(__cplusplus)
#define static_assert _Static_assert
#endif
//----------------------------------------------------------------------------|
// Types |
//
struct __FILE;
// EOF

View file

@ -1,36 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// This is an internal header and should not be included directly.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__bits__features_h__
#define __GDCC_Header__C__bits__features_h__
//----------------------------------------------------------------------------|
// Macros |
//
// If _GNU_SOURCE defined, enable everything.
#if defined(_GNU_SOURCE)
# undef __STRICT_ANSI__
# undef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200809L
#endif
// If no feature test macros are defined, set defaults.
#if !defined(__STRICT_ANSI__) && !defined(_POSIX_C_SOURCE) && !defined(_GNU_SOURCE)
# define _POSIX_C_SOURCE 200809L
#endif
#endif//__GDCC_Header__C__bits__features_h__

View file

@ -1,54 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// This is an internal header and should not be included directly.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__bits__types_h__
#define __GDCC_Header__C__bits__types_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Types |
//
typedef unsigned int __clock_t;
typedef long long __intmax_t;
typedef signed int __intptr_t;
typedef int __max_align_t;
typedef long int __off_t;
typedef int __ptrdiff_t;
typedef int __sig_atomic_t;
typedef unsigned int __size_t;
typedef int __ssize_t;
typedef long int __time_t;
typedef unsigned long long __uintmax_t;
typedef unsigned int __uintptr_t;
typedef unsigned int __uptrdiff_t;
typedef unsigned int __wchar_t;
typedef int __wint_t;
typedef __ssize_t __cookie_read_function_t(void *, char *, __size_t);
typedef __ssize_t __cookie_write_function_t(void *, char const *, __size_t);
typedef int __cookie_seek_function_t(void *, __off_t *, int);
typedef int __cookie_close_function_t(void *);
struct __FILE;
struct __cookie_io_functions_t;
struct __fenv_t;
struct __fexcept_t;
struct __mbstate_t;
#endif//__GDCC_Header__C__bits__types_h__

View file

@ -1,58 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Character handling.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__ctype_h__
#define __GDCC_Header__C__ctype_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Global Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// Character classification functions.
//
int isalnum(int _c);
int isalpha(int _c);
int isblank(int _c);
int iscntrl(int _c);
int isdigit(int _c);
int isgraph(int _c);
int islower(int _c);
int isprint(int _c);
int ispunct(int _c);
int isspace(int _c);
int isupper(int _c);
int isxdigit(int _c);
//
// Character case mapping functions.
//
int tolower(int _c);
int toupper(int _c);
#ifdef __cplusplus
};
#endif
#endif//__GDCC_Header__C__ctype_h__

View file

@ -1,69 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Errors.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__errno_h__
#define __GDCC_Header__C__errno_h__
#include <bits/features.h>
#ifdef __cplusplus
extern "C" {
#endif
//----------------------------------------------------------------------------|
// Macros |
//
//
// errno
//
#ifdef __GDCC__DirectObject
#define errno __errno
#else
#define errno (*__get_errno())
#endif
//
// E*
//
#define EBADF 1
#define EDOM 2
#define EILSEQ 3
#define EINVAL 4
#define ERANGE 5
//----------------------------------------------------------------------------|
// Extern Objects |
//
//
// __errno
//
extern int __errno;
//----------------------------------------------------------------------------|
// Extern Functions |
//
int *__get_errno(void);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__errno_h__

View file

@ -1,99 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2018 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Floating-point environment.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__fenv_h__
#define __GDCC_Header__C__fenv_h__
#include <bits/types.h>
#ifdef __cplusplus
extern "C" {
#endif
//----------------------------------------------------------------------------|
// Macros |
//
//
// FE_* exceptions
//
//
// FE_ALL_EXCEPT
//
#define FE_ALL_EXCEPT 0
//
// FE_* rounding
//
//
// FL_DFL_ENV
//
#define FL_DFL_ENV ((fenv_t const *)0)
//----------------------------------------------------------------------------|
// Types |
//
//
// fenv_t
//
typedef struct __fenv_t fenv_t;
//
// fexcept_t
//
typedef struct __fexcept_t fexcept_t;
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// Floating-point exceptions.
//
int feclearexcept(int _excepts);
int fegetexceptflag(fexcept_t *_flagp, int _excepts);
int feraiseexcept(int _excepts);
int fesetexceptflag(fexcept_t const *_flagp, int _excepts);
int fetestexcept(int _excepts);
//
// Rounding.
//
int fegetround(void);
int fesetround(int _round);
//
// Environment.
//
int fegetenv(fenv_t *_envp);
int feholdexcept(fenv_t *_envp);
int fesetenv(const fenv_t *_envp);
int feupdateenv(const fenv_t *_envp);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__fenv_h__

View file

@ -1,149 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Characteristics of floating types.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__float_h__
#define __GDCC_Header__C__float_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// FLT_ROUNDS
//
// -1 - indeterminate
// 0 - toward zero
// 1 - to nearest
// 2 - toward positive infinity
// 3 - toward negative infinity
//
// fesetround is unsupported, so this macro expands to a constant.
//
#define FLT_ROUNDS 0
//
// FLT_EVAL_METHOD
//
// -1 - indeterminate
// 0 - all operations as type
// 1 - float as double, others as type
// 2 - all operations as long double
//
// This would be 0, except that constants evaluate with unknown precision.
//
#define FLT_EVAL_METHOD -1
//
// FLT_HAS_SUBNORM
//
// -1 - indeterminate
// 0 - absent
// 1 - present
//
#define FLT_HAS_SUBNORM -1
#define DBL_HAS_SUBNORM -1
#define LDBL_HAS_SUBNORM -1
//
// FLT_RADIX
//
#define FLT_RADIX 2
//
// FLT_MANT_DIG
//
#define FLT_MANT_DIG 24
#define DBL_MANT_DIG 53
#define LDBL_MANT_DIG 53
//
// FLT_DECIMAL_DIG
//
#define FLT_DECIMAL_DIG 9
#define DBL_DECIMAL_DIG 17
#define LDBL_DECIMAL_DIG 17
//
// DECIMAL_DIG
//
#define DECIMAL_DIG LDBL_DECIMAL_DIG
//
// FLT_DIG
//
#define FLT_DIG 6
#define DBL_DIG 15
#define LDBL_DIG 15
//
// FLT_MIN_EXP
//
#define FLT_MIN_EXP ( -125)
#define DBL_MIN_EXP (-1021)
#define LDBL_MIN_EXP (-1021)
//
// FLT_MIN_10_EXP
//
#define FLT_MIN_10_EXP ( -37)
#define DBL_MIN_10_EXP (-307)
#define LDBL_MIN_10_EXP (-307)
//
// FLT_MAX_EXP
//
#define FLT_MAX_EXP 128
#define DBL_MAX_EXP 1024
#define LDBL_MAX_EXP 1024
//
// FLT_MAX_10_EXP
//
#define FLT_MAX_10_EXP 38
#define DBL_MAX_10_EXP 308
#define LDBL_MAX_10_EXP 308
//
// FLT_MAX
//
#define FLT_MAX 0x1.FFFFFEp+127F
#define DBL_MAX 0x1.FFFFFFFFFFFFFp+1023
#define LDBL_MAX 0x1.FFFFFFFFFFFFFp+1023L
//
// FLT_EPSILON
//
#define FLT_EPSILON 0x1.0p-23F
#define DBL_EPSILON 0x1.0p-52
#define LDBL_EPSILON 0x1.0p-52L
//
// FLT_MIN
//
#define FLT_MIN 0x1.0p-126F
#define DBL_MIN 0x1.0p-1022
#define LDBL_MIN 0x1.0p-1022L
//
// FLT_TRUE_MIN
//
#define FLT_TRUE_MIN 0x1.0p-126F
#define DBL_TRUE_MIN 0x1.0p-1022
#define LDBL_TRUE_MIN 0x1.0p-1022L
#endif//__GDCC_Header__C__float_h__

View file

@ -1,353 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2017 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Format conversion of integer types.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__inttypes_h__
#define __GDCC_Header__C__inttypes_h__
#include <stdint.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// PRId*
//
#if !__GDCC_Family__ZDACS__
#define PRId8 "hhd"
#define PRId16 "hd"
#endif
#define PRId32 "d"
#define PRId64 "ld"
#define PRId96 "lld"
#define PRIdLEAST8 "d"
#define PRIdLEAST16 "d"
#define PRIdLEAST32 "d"
#define PRIdLEAST64 "ld"
#define PRIdLEAST96 "lld"
#define PRIdFAST8 "d"
#define PRIdFAST16 "d"
#define PRIdFAST32 "d"
#define PRIdFAST64 "ld"
#define PRIdFAST96 "lld"
#define PRIdMAX "lld"
#define PRIdPTR "d"
//
// PRIi*
//
#if !__GDCC_Family__ZDACS__
#define PRIi8 "hhi"
#define PRIi16 "hi"
#endif
#define PRIi32 "i"
#define PRIi64 "li"
#define PRIi96 "lli"
#define PRIiLEAST8 "i"
#define PRIiLEAST16 "i"
#define PRIiLEAST32 "i"
#define PRIiLEAST64 "li"
#define PRIiLEAST96 "lli"
#define PRIiFAST8 "i"
#define PRIiFAST16 "i"
#define PRIiFAST32 "i"
#define PRIiFAST64 "li"
#define PRIiFAST96 "lli"
#define PRIiMAX "lli"
#define PRIiPTR "i"
//
// PRIo*
//
#if !__GDCC_Family__ZDACS__
#define PRIo8 "hho"
#define PRIo16 "ho"
#endif
#define PRIo32 "o"
#define PRIo64 "lo"
#define PRIo96 "llo"
#define PRIoLEAST8 "o"
#define PRIoLEAST16 "o"
#define PRIoLEAST32 "o"
#define PRIoLEAST64 "lo"
#define PRIoLEAST96 "llo"
#define PRIoFAST8 "o"
#define PRIoFAST16 "o"
#define PRIoFAST32 "o"
#define PRIoFAST64 "lo"
#define PRIoFAST96 "llo"
#define PRIoMAX "llo"
#define PRIoPTR "o"
//
// PRIu*
//
#if !__GDCC_Family__ZDACS__
#define PRIu8 "hhu"
#define PRIu16 "hu"
#endif
#define PRIu32 "u"
#define PRIu64 "lu"
#define PRIu96 "llu"
#define PRIuLEAST8 "u"
#define PRIuLEAST16 "u"
#define PRIuLEAST32 "u"
#define PRIuLEAST64 "lu"
#define PRIuLEAST96 "llu"
#define PRIuFAST8 "u"
#define PRIuFAST16 "u"
#define PRIuFAST32 "u"
#define PRIuFAST64 "lu"
#define PRIuFAST96 "llu"
#define PRIuMAX "llu"
#define PRIuPTR "u"
//
// PRIx*
//
#if !__GDCC_Family__ZDACS__
#define PRIx8 "hhx"
#define PRIx16 "hx"
#endif
#define PRIx32 "x"
#define PRIx64 "lx"
#define PRIx96 "llx"
#define PRIxLEAST8 "x"
#define PRIxLEAST16 "x"
#define PRIxLEAST32 "x"
#define PRIxLEAST64 "lx"
#define PRIxLEAST96 "llx"
#define PRIxFAST8 "x"
#define PRIxFAST16 "x"
#define PRIxFAST32 "x"
#define PRIxFAST64 "lx"
#define PRIxFAST96 "llx"
#define PRIxMAX "llx"
#define PRIxPTR "x"
//
// PRIX*
//
#if !__GDCC_Family__ZDACS__
#define PRIX8 "hhX"
#define PRIX16 "hX"
#endif
#define PRIX32 "X"
#define PRIX64 "lX"
#define PRIX96 "llX"
#define PRIXLEAST8 "X"
#define PRIXLEAST16 "X"
#define PRIXLEAST32 "X"
#define PRIXLEAST64 "lX"
#define PRIXLEAST96 "llX"
#define PRIXFAST8 "X"
#define PRIXFAST16 "X"
#define PRIXFAST32 "X"
#define PRIXFAST64 "lX"
#define PRIXFAST96 "llX"
#define PRIXMAX "llX"
#define PRIXPTR "X"
//
// SCNd*
//
#if !__GDCC_Family__ZDACS__
#define SCNd8 "hhd"
#define SCNd16 "hd"
#endif
#define SCNd32 "d"
#define SCNd64 "ld"
#define SCNd96 "lld"
#define SCNdLEAST8 "hhd"
#define SCNdLEAST16 "hd"
#define SCNdLEAST32 "d"
#define SCNdLEAST64 "ld"
#define SCNdLEAST96 "lld"
#define SCNdFAST8 "d"
#define SCNdFAST16 "d"
#define SCNdFAST32 "d"
#define SCNdFAST64 "ld"
#define SCNdFAST96 "lld"
#define SCNdMAX "lld"
#define SCNdPTR "d"
//
// SCNi*
//
#if !__GDCC_Family__ZDACS__
#define SCNi8 "hhi"
#define SCNi16 "hi"
#endif
#define SCNi32 "i"
#define SCNi64 "li"
#define SCNi96 "lli"
#define SCNiLEAST8 "hhi"
#define SCNiLEAST16 "hi"
#define SCNiLEAST32 "i"
#define SCNiLEAST64 "li"
#define SCNiLEAST96 "lli"
#define SCNiFAST8 "i"
#define SCNiFAST16 "i"
#define SCNiFAST32 "i"
#define SCNiFAST64 "li"
#define SCNiFAST96 "lli"
#define SCNiMAX "lli"
#define SCNiPTR "i"
//
// SCNo*
//
#if !__GDCC_Family__ZDACS__
#define SCNo8 "hho"
#define SCNo16 "ho"
#endif
#define SCNo32 "o"
#define SCNo64 "lo"
#define SCNo96 "llo"
#define SCNoLEAST8 "hho"
#define SCNoLEAST16 "ho"
#define SCNoLEAST32 "o"
#define SCNoLEAST64 "lo"
#define SCNoLEAST96 "llo"
#define SCNoFAST8 "o"
#define SCNoFAST16 "o"
#define SCNoFAST32 "o"
#define SCNoFAST64 "lo"
#define SCNoFAST96 "llo"
#define SCNoMAX "llo"
#define SCNoPTR "o"
//
// SCNu*
//
#if !__GDCC_Family__ZDACS__
#define SCNu8 "hhu"
#define SCNu16 "hu"
#endif
#define SCNu32 "u"
#define SCNu64 "lu"
#define SCNu96 "llu"
#define SCNuLEAST8 "hhu"
#define SCNuLEAST16 "hu"
#define SCNuLEAST32 "u"
#define SCNuLEAST64 "lu"
#define SCNuLEAST96 "llu"
#define SCNuFAST8 "u"
#define SCNuFAST16 "u"
#define SCNuFAST32 "u"
#define SCNuFAST64 "lu"
#define SCNuFAST96 "llu"
#define SCNuMAX "llu"
#define SCNuPTR "u"
//
// SCNx*
//
#if !__GDCC_Family__ZDACS__
#define SCNx8 "hhx"
#define SCNx16 "hx"
#endif
#define SCNx32 "x"
#define SCNx64 "lx"
#define SCNx96 "llx"
#define SCNxLEAST8 "hhx"
#define SCNxLEAST16 "hx"
#define SCNxLEAST32 "x"
#define SCNxLEAST64 "lx"
#define SCNxLEAST96 "llx"
#define SCNxFAST8 "x"
#define SCNxFAST16 "x"
#define SCNxFAST32 "x"
#define SCNxFAST64 "lx"
#define SCNxFAST96 "llx"
#define SCNxMAX "llx"
#define SCNxPTR "x"
//----------------------------------------------------------------------------|
// Types |
//
//
// imaxdiv_t
//
typedef long long __div_t imaxdiv_t;
//----------------------------------------------------------------------------|
// Global Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// Functions for greatest-width integer types.
//
intmax_t imaxabs(intmax_t _j);
imaxdiv_t imaxdiv(intmax_t _numer, intmax_t _denom);
intmax_t strtoimax(char const *restrict _nptr, char **restrict _endptr, int _base);
uintmax_t strtoumax(char const *restrict _nptr, char **restrict _endptr, int _base);
intmax_t wcstoimax(__wchar_t const *restrict _nptr, __wchar_t **restrict _endptr, int _base);
uintmax_t wcstoumax(__wchar_t const *restrict _nptr, __wchar_t **restrict _endptr, int _base);
//
// Implementation extensions.
//
intmax_t strtoimax_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
uintmax_t strtoumax_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
#ifdef __cplusplus
};
#endif
#endif//__GDCC_Header__C__inttypes_h__

View file

@ -1,40 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Alternative spellings.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__iso646_h__
#define __GDCC_Header__C__iso646_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
#ifndef __cplusplus
#define and &&
#define and_eq &=
#define bitand &
#define bitor |
#define compl ~
#define not !
#define not_eq !=
#define or ||
#define or_eq |=
#define xor ^
#define xor_eq ^=
#endif
#endif//__GDCC_Header__C__iso646_h__

View file

@ -1,95 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2017 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Sizes of integer types.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__limits_h__
#define __GDCC_Header__C__limits_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// CHAR_BIT
//
#if __GDCC_Family__ZDACS__
#define CHAR_BIT 32
#else
#define CHAR_BIT 8
#endif
//
// CHAR_*
//
#if __GDCC_Family__ZDACS__
# define SCHAR_MIN (-0x7FFFFFFF-1)
# define SCHAR_MAX ( 0x7FFFFFFF )
# define UCHAR_MAX ( 0xFFFFFFFFU )
#else
# define SCHAR_MIN (-0x7F-1)
# define SCHAR_MAX ( 0x7F )
# define UCHAR_MAX ( 0xFFU )
#endif
#if __GDCC_Family__ZDACS__
# define CHAR_MIN SCHAR_MIN
# define CHAR_MAX SCHAR_MAX
#else
# define CHAR_MIN UCHAR_MIN
# define CHAR_MAX UCHAR_MAX
#endif
//
// MB_LEN_MAX
//
#define MB_LEN_MAX 6
//
// SHRT_*
//
#if __GDCC_Family__ZDACS__
# define SHRT_MIN (-0x7FFFFFFF-1)
# define SHRT_MAX ( 0x7FFFFFFF )
# define USHRT_MAX ( 0xFFFFFFFFU )
#else
# define SHRT_MIN (-0x7FFF-1)
# define SHRT_MAX ( 0x7FFF )
# define USHRT_MAX ( 0xFFFFU )
#endif
//
// INT_*
//
#define INT_MIN (-0x7FFFFFFF-1)
#define INT_MAX ( 0x7FFFFFFF )
#define UINT_MAX ( 0xFFFFFFFFU )
//
// LONG_*
//
#define LONG_MIN (-0x7FFFFFFFFFFFFFFFL-1)
#define LONG_MAX ( 0x7FFFFFFFFFFFFFFFL )
#define ULONG_MAX ( 0xFFFFFFFFFFFFFFFFUL )
//
// LLONG_*
//
#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFFFFFFFFFLL-1)
#define LLONG_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFFLL )
#define ULLONG_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFULL )
#endif//__GDCC_Header__C__limits_h__

View file

@ -1,96 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Localization.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__locale_h__
#define __GDCC_Header__C__locale_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//
// LC_*
//
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MONETARY 3
#define LC_NUMERIC 4
#define LC_TIME 5
//----------------------------------------------------------------------------|
// Types |
//
//
// lconv
//
struct lconv
{
char *decimal_point;
char *thousands_sep;
char *grouping;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
char *negative_sign;
char *currency_symbol;
char frac_digits;
char p_cs_precedes;
char n_cs_precedes;
char p_sep_by_space;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
char *int_curr_symbol;
char int_frac_digits;
char int_p_cs_precedes;
char int_n_cs_precedes;
char int_p_sep_by_space;
char int_n_sep_by_space;
char int_p_sign_posn;
char int_n_sign_posn;
};
//----------------------------------------------------------------------------|
// Global Functions |
//
//
// Locale control.
//
char *setlocale(int _category, const char *_locale);
//
// Numeric formatting convention inquiry.
//
struct lconv *localeconv(void);
#endif//__GDCC_Header__C__locale_h__

View file

@ -1,539 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Mathematics.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__math_h__
#define __GDCC_Header__C__math_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// HUGE_VAL
//
#define HUGE_VAL (__inf())
#define HUGE_VALF (__inff())
#define HUGE_VALL (__infl())
//
// INFINITY
//
#define INFINITY (__inf())
//
// NAN
//
#define NAN (__nanf())
//
// FP_*
//
#define FP_INFINITE 2
#define FP_NAN 1
#define FP_NORMAL 3
#define FP_SUBNORMAL 4
#define FP_ZERO 5
//
// FP_FAST_FMA
//
// These are conditionally defined.
//
//#define FP_FAST_FMA 1
//#define FP_FAST_FMAF 1
//#define FP_FAST_FMAL 1
//
// FP_ILOGB*
//
#define FP_ILOGB0 INT_MIN
#define FP_ILOGBNAN INT_MAX
//
// MATH_ERR*
//
#define MATH_ERRNO 1
#define MATH_ERREXCEPT 2
//
// math_errhandling
//
#define math_errhandling 0
//
// Classification macros.
//
//
// fpclassify
//
#define fpclassify(x) (__GDCC__TGMathR((x), __fpclassify)((x)))
//
// infinite
//
#define isfinite(x) (__GDCC__TGMathR((x), __isfinite)((x)))
//
// isinf
//
#define isinf(x) (__GDCC__TGMathR((x), __isinf)((x)))
//
// isnan
//
#define isnan(x) (__GDCC__TGMathR((x), __isnan)((x)))
//
// isnormal
//
#define isnormal(x) (__GDCC__TGMathR((x), __isnormal)((x)))
//
// signbit
//
#define signbit(x) (__GDCC__TGMathR((x), __signbit)((x)))
//
// Comparison macros.
//
//
// isgreater
//
#define isgreater(x, y) (__GDCC__TGMathR((x) + (y), __isgreater)((x), (y)))
//
// isgreaterequal
//
#define isgreaterequal(x, y) (__GDCC__TGMathR((x) + (y), __isgreaterequal)((x), (y)))
//
// isless
//
#define isless(x, y) (__GDCC__TGMathR((x) + (y), __isless)((x), (y)))
//
// islessequal
//
#define islessequal(x, y) (__GDCC__TGMathR((x) + (y), __islessequal)((x), (y)))
//
// islessgreater
//
#define islessgreater(x, y) (__GDCC__TGMathR((x) + (y), __islessgreater)((x), (y)))
//
// isunordered
//
#define isunordered(x, y) (__GDCC__TGMathR((x) + (y), __isunordered)((x), (y)))
//
// __GDCC__TGMathR
//
#define __GDCC__TGMathR(x, func) \
(_Generic((x), \
float: func##f, \
double: func, \
long double: func##l, \
default: func))
//----------------------------------------------------------------------------|
// Types |
//
//
// float_t
//
typedef float float_t;
//
// double_t
//
typedef double double_t;
//----------------------------------------------------------------------------|
// Global Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// Trigonometric functions.
//
double acos(double _x);
float acosf(float _x);
long double acosl(long double _x);
double asin(double _x);
float asinf(float _x);
long double asinl(long double _x);
double atan(double _x);
float atanf(float _x);
long double atanl(long double _x);
double atan2(double _y, double _x);
float atan2f(float _y, float _x);
long double atan2l(long double _y, long double _x);
double cos(double _x);
float cosf(float _x);
long double cosl(long double _x);
double sin(double _x);
float sinf(float _x);
long double sinl(long double _x);
double tan(double _x);
float tanf(float _x);
long double tanl(long double _x);
//
// Hyperbolic functions.
//
double acosh(double _x);
float acoshf(float _x);
long double acoshl(long double _x);
double asinh(double _x);
float asinhf(float _x);
long double asinhl(long double _x);
double atanh(double _x);
float atanhf(float _x);
long double atanhl(long double _x);
double cosh(double _x);
float coshf(float _x);
long double coshl(long double _x);
double sinh(double _x);
float sinhf(float _x);
long double sinhl(long double _x);
double tanh(double _x);
float tanhf(float _x);
long double tanhl(long double _x);
//
// Exponential and logarithmic functions.
//
double exp(double _x);
float expf(float _x);
long double expl(long double _x);
double exp2(double _x);
float exp2f(float _x);
long double exp2l(long double _x);
double expm1(double _x);
float expm1f(float _x);
long double expm1l(long double _x);
double frexp(double _value, int *_exp);
float frexpf(float _value, int *_exp);
long double frexpl(long double _value, int *_exp);
int ilogb(double _x);
int ilogbf(float _x);
int ilogbl(long double _x);
double ldexp(double _x, int _exp);
float ldexpf(float _x, int _exp);
long double ldexpl(long double _x, int _exp);
double log(double _x);
float logf(float _x);
long double logl(long double _x);
double log10(double _x);
float log10f(float _x);
long double log10l(long double _x);
double log1p(double _x);
float log1pf(float _x);
long double log1pl(long double _x);
double log2(double _x);
float log2f(float _x);
long double log2l(long double _x);
double logb(double _x);
float logbf(float _x);
long double logbl(long double _x);
double modf(double _value, double *_iptr);
float modff(float _value, float *_iptr);
long double modfl(long double _value, long double *_iptr);
double scalbn(double _x, int _n);
float scalbnf(float _x, int _n);
long double scalbnl(long double _x, int _n);
double scalbln(double _x, long int _n);
float scalblnf(float _x, long int _n);
long double scalblnl(long double _x, long int _n);
//
// Power and absolute-value functions.
//
double cbrt(double _x);
float cbrtf(float _x);
long double cbrtl(long double _x);
double fabs(double _x);
float fabsf(float _x);
long double fabsl(long double _x);
double hypot(double _x, double _y);
float hypotf(float _x, float _y);
long double hypotl(long double _x, long double _y);
double pow(double _x, double _y);
float powf(float _x, float _y);
long double powl(long double _x, long double _y);
double sqrt(double _x);
float sqrtf(float _x);
long double sqrtl(long double _x);
//
// Error and gamma functions.
//
double erf(double _x);
float erff(float _x);
long double erfl(long double _x);
double erfc(double _x);
float erfcf(float _x);
long double erfcl(long double _x);
double lgamma(double _x);
float lgammaf(float _x);
long double lgammal(long double _x);
double tgamma(double _x);
float tgammaf(float _x);
long double tgammal(long double _x);
//
// Nearest integer functions.
//
double ceil(double _x);
float ceilf(float _x);
long double ceill(long double _x);
double floor(double _x);
float floorf(float _x);
long double floorl(long double _x);
double nearbyint(double _x);
float nearbyintf(float _x);
long double nearbyintl(long double _x);
double rint(double _x);
float rintf(float _x);
long double rintl(long double _x);
long int lrint(double _x);
long int lrintf(float _x);
long int lrintl(long double _x);
long long int llrint(double _x);
long long int llrintf(float _x);
long long int llrintl(long double _x);
double round(double _x);
float roundf(float _x);
long double roundl(long double _x);
long int lround(double _x);
long int lroundf(float _x);
long int lroundl(long double _x);
long long int llround(double _x);
long long int llroundf(float _x);
long long int llroundl(long double _x);
double trunc(double _x);
float truncf(float _x);
long double truncl(long double _x);
//
// Remainder functions.
//
double fmod(double _x, double _y);
float fmodf(float _x, float _y);
long double fmodl(long double _x, long double _y);
double remainder(double _x, double _y);
float remainderf(float _x, float _y);
long double remainderl(long double _x, long double _y);
double remquo(double _x, double _y, int *_quo);
float remquof(float _x, float _y, int *_quo);
long double remquol(long double _x, long double _y, int *_quo);
//
// Manipulation functions.
//
double copysign(double _x, double _y);
float copysignf(float _x, float _y);
long double copysignl(long double _x, long double _y);
double nan(char const *_tagp);
float nanf(char const *_tagp);
long double nanl(char const *_tagp);
double nextafter(double _x, double _y);
float nextafterf(float _x, float _y);
long double nextafterl(long double _x, long double _y);
double nexttoward(double _x, long double _y);
float nexttowardf(float _x, long double _y);
long double nexttowardl(long double _x, long double _y);
//
// Maximum, minimum, and positive difference functions.
//
double fdim(double _x, double _y);
float fdimf(float _x, float _y);
long double fdiml(long double _x, long double _y);
double fmax(double _x, double _y);
float fmaxf(float _x, float _y);
long double fmaxl(long double _x, long double _y);
double fmin(double _x, double _y);
float fminf(float _x, float _y);
long double fminl(long double _x, long double _y);
//
// Floating multiply-add.
//
double fma(double _x, double _y, double _z);
float fmaf(float _x, float _y, float _z);
long double fmal(long double _x, long double _y, long double _z);
//
// GNU extensions.
//
#if defined(_GNU_SOURCE)
void sincos(double _x, double *_sin, double *_cos);
void sincosf(float _x, float *_sin, float *_cos);
void sincosl(long double _x, long double *_sin, long double *_cos);
#endif
//
// Implementation extensions.
//
double __rinf(double _x);
float __rinff(float _x);
long double __rinfl(long double _x);
int __irmod(double _x);
int __irmodf(float _x);
int __irmodl(long double _x);
[[call("StkCall")]] double __approx_cbrt(double _x);
[[call("StkCall")]] float __approx_cbrtf(float _x);
[[call("StkCall")]] long double __approx_cbrtl(long double _x);
[[call("StkCall")]] int __approx_log2(double _x);
[[call("StkCall")]] int __approx_log2f(float _x);
[[call("StkCall")]] int __approx_log2l(long double _x);
[[call("StkCall")]] double __approx_sqrt(double _x);
[[call("StkCall")]] float __approx_sqrtf(float _x);
[[call("StkCall")]] long double __approx_sqrtl(long double _x);
[[call("StkCall")]] double __inf(void);
[[call("StkCall")]] float __inff(void);
[[call("StkCall")]] long double __infl(void);
[[call("StkCall")]] double __nan(void);
[[call("StkCall")]] float __nanf(void);
[[call("StkCall")]] long double __nanl(void);
[[call("StkCall")]] int __fpclassify(double _x);
[[call("StkCall")]] int __fpclassifyf(float _x);
[[call("StkCall")]] int __fpclassifyl(long double _x);
[[call("StkCall")]] int __isfinite(double _x);
[[call("StkCall")]] int __isfinitef(float _x);
[[call("StkCall")]] int __isfinitel(long double _x);
[[call("StkCall")]] int __isinf(double _x);
[[call("StkCall")]] int __isinff(float _x);
[[call("StkCall")]] int __isinfl(long double _x);
[[call("StkCall")]] int __isnan(double _x);
[[call("StkCall")]] int __isnanf(float _x);
[[call("StkCall")]] int __isnanl(long double _x);
[[call("StkCall")]] int __isnormal(double _x);
[[call("StkCall")]] int __isnormalf(float _x);
[[call("StkCall")]] int __isnormall(long double _x);
[[call("StkCall")]] int __signbit(double _x);
[[call("StkCall")]] int __signbitf(float _x);
[[call("StkCall")]] int __signbitl(long double _x);
[[call("StkCall")]] int __isgreater(double _x, double _y);
[[call("StkCall")]] int __isgreaterf(float _x, float _y);
[[call("StkCall")]] int __isgreaterl(long double _x, long double _y);
[[call("StkCall")]] int __isgreaterequal(double _x, double _y);
[[call("StkCall")]] int __isgreaterequalf(float _x, float _y);
[[call("StkCall")]] int __isgreaterequall(long double _x, long double _y);
[[call("StkCall")]] int __isless(double _x, double _y);
[[call("StkCall")]] int __islessf(float _x, float _y);
[[call("StkCall")]] int __islessl(long double _x, long double _y);
[[call("StkCall")]] int __islessequal(double _x, double _y);
[[call("StkCall")]] int __islessequalf(float _x, float _y);
[[call("StkCall")]] int __islessequall(long double _x, long double _y);
[[call("StkCall")]] int __islessgreater(double _x, double _y);
[[call("StkCall")]] int __islessgreaterf(float _x, float _y);
[[call("StkCall")]] int __islessgreaterl(long double _x, long double _y);
[[call("StkCall")]] int __isunordered(double _x, double _y);
[[call("StkCall")]] int __isunorderedf(float _x, float _y);
[[call("StkCall")]] int __isunorderedl(long double _x, long double _y);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__math_h__

View file

@ -1,56 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2017 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Non-local jumps.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__setjmp_h__
#define __GDCC_Header__C__setjmp_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// setjmp
//
#define setjmp(_env) (__setjmp(_env))
//----------------------------------------------------------------------------|
// Types |
//
//
// jmpbuf
//
#if !__GDCC_Family__ZDACS__
typedef int jmp_buf[4];
#else
typedef int jmp_buf[3];
#endif
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// Restore calling environment.
//
_Noreturn void (longjmp)(jmp_buf _env, int _val);
#endif//__GDCC_Header__C__setjmp_h__

View file

@ -1,81 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2018 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Signal handling.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__signal_h__
#define __GDCC_Header__C__signal_h__
#include <bits/types.h>
#ifdef __cplusplus
extern "C" {
#endif
//----------------------------------------------------------------------------|
// Macros |
//
//
// SIG_*
//
#define SIG_DFL ((void (*)(int))-2)
#define SIG_ERR ((void (*)(int))-3)
#define SIG_IGN ((void (*)(int))-4)
//
// SIG*
//
#define SIGABRT 1
#define SIGFPE 2
#define SIGILL 3
#define SIGINT 4
#define SIGSEGV 5
#define SIGTERM 6
//----------------------------------------------------------------------------|
// Types |
//
//
// sig_atomic_t
//
#ifndef __GDCC_Have__sig_atomic_t__
#define __GDCC_Have__sig_atomic_t__
typedef __sig_atomic_t sig_atomic_t;
#endif
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// Specify signal handling.
//
void (*signal(int _sig, void (*_func)(int)))(int);
//
// Send signal.
//
int raise(int _sig);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__signal_h__

View file

@ -1,50 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Alignment.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdalign_h__
#define __GDCC_Header__C__stdalign_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// alignas
//
#ifndef __cplusplus
#define alignas _Alignas
#endif
//
// alignof
//
#ifndef __cplusplus
#define alignof _Alignof
#endif
//
// __alignas_is_defined
//
#define __alignas_is_defined 1
//
// __alignof_is_defined
//
#define __alignof_is_defined 1
#endif//__GDCC_Header__C__stdalign_h__

View file

@ -1,56 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Variable arguments.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdarg_h__
#define __GDCC_Header__C__stdarg_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// va_arg
//
#define va_arg(ap, type) (__va_arg((ap), type))
//
// va_copy
//
#define va_copy(dest, src) ((void)((dest) = (src)))
//
// va_end
//
#define va_end(ap) ((void)(ap))
//
// va_start
//
#define va_start(ap, parmN) ((void)((ap) = __va_start))
//----------------------------------------------------------------------------|
// Types |
//
//
// va_list
//
typedef __va_list va_list;
#endif//__GDCC_Header__C__stdarg_h__

View file

@ -1,52 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Boolean type and values.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdbool_h__
#define __GDCC_Header__C__stdbool_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// bool
//
#ifndef __cplusplus
#define bool _Bool
#endif
//
// true
//
#ifndef __cplusplus
#define true 1
#endif
//
// false
//
#ifndef __cplusplus
#define false 0
#endif
//
// __bool_true_false_are_defined
//
#define __bool_true_false_are_defined 1
#endif//__GDCC_Header__C__stdbool_h__

View file

@ -1,78 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Common definitions.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stddef_h__
#define __GDCC_Header__C__stddef_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//
// offsetof
//
#ifndef offsetof
#define offsetof(T, M) ((size_t)__offsetof(T, M))
#endif
//----------------------------------------------------------------------------|
// Types |
//
//
// ptrdiff_t
//
#ifndef __GDCC_Have__ptrdiff_t__
#define __GDCC_Have__ptrdiff_t__
typedef __ptrdiff_t ptrdiff_t;
#endif
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//
// max_align_t
//
#ifndef __GDCC_Have__max_align_t__
#define __GDCC_Have__max_align_t__
typedef __max_align_t max_align_t;
#endif
//
// wchar_t
//
#ifndef __GDCC_Have__wchar_t__
#define __GDCC_Have__wchar_t__
typedef __wchar_t wchar_t;
#endif
#endif//__GDCC_Header__C__stddef_h__

View file

@ -1,458 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Fixed-point arithmetic.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdfix_h__
#define __GDCC_Header__C__stdfix_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// fract
//
#ifndef fract
#define fract _Fract
#endif
//
// accum
//
#ifndef accum
#define accum _Accum
#endif
//
// sat
//
#ifndef sat
#define sat _Sat
#endif
//
// SFRACT_*
//
#if __GDCC_Family__ZDACS__
#define SFRACT_FBIT 31
#define SFRACT_MIN (-0.5HR-0.5HR)
#define SFRACT_MAX 0x.FFFFFFFEp-0HR
#define SFRACT_EPSILON 0x1p-31HR
#else
#define SFRACT_FBIT 7
#define SFRACT_MIN (-0.5HR-0.5HR)
#define SFRACT_MAX 0x.FEp-0HR
#define SFRACT_EPSILON 0x1p-7HR
#endif
//
// USFRACT_*
//
#if __GDCC_Family__ZDACS__
#define USFRACT_FBIT 32
#define USFRACT_MAX 0x.FFFFFFFFp-0UHR
#define USFRACT_EPSILON 0x1p-32UHR
#else
#define USFRACT_FBIT 8
#define USFRACT_MAX 0x.FFp-0UHR
#define USFRACT_EPSILON 0x1p-8UHR
#endif
//
// FRACT_*
//
#if __GDCC_Family__ZDACS__
#define FRACT_FBIT 31
#define FRACT_MIN (-0.5R-0.5R)
#define FRACT_MAX 0x.FFFFFFFEp-0R
#define FRACT_EPSILON 0x1p-31R
#else
#define FRACT_FBIT 15
#define FRACT_MIN (-0.5R-0.5R)
#define FRACT_MAX 0x.FFFEp-0R
#define FRACT_EPSILON 0x1p-15R
#endif
//
// UFRACT_*
//
#if __GDCC_Family__ZDACS__
#define UFRACT_FBIT 32
#define UFRACT_MAX 0x.FFFFFFFFp-0UR
#define UFRACT_EPSILON 0x1p-32UR
#else
#define UFRACT_FBIT 16
#define UFRACT_MAX 0x.FFFFp-0UR
#define UFRACT_EPSILON 0x1p-16UR
#endif
//
// LFRACT_*
//
#define LFRACT_FBIT 31
#define LFRACT_MIN (-0.5LR-0.5LR)
#define LFRACT_MAX 0x.FFFFFFFEp-0LR
#define LFRACT_EPSILON 0x1p-31LR
//
// ULFRACT_*
//
#define ULFRACT_FBIT 32
#define ULFRACT_MAX 0x.FFFFFFFFp-0ULR
#define ULFRACT_EPSILON 0x1p-32ULR
//
// SACCUM_*
//
#if __GDCC_Engine__Doominati__
# define SACCUM_FBIT 7
# define SACCUM_IBIT 24
# define SACCUM_MIN (-0x800000p-0HK-0x800000p-0HK)
# define SACCUM_MAX 0xFFFFFF.FEp-0HK
# define SACCUM_EPSILON 0x1p-7HK
#else
# define SACCUM_FBIT 16
# define SACCUM_IBIT 15
# define SACCUM_MIN (-0x4000p-0HK-0x4000p-0HK)
# define SACCUM_MAX 0x7FFF.FFFFp-0HK
# define SACCUM_EPSILON 0x1p-16HK
#endif
//
// USACCUM_*
//
#if __GDCC_Engine__Doominati__
# define USACCUM_FBIT 7
# define USACCUM_IBIT 25
# define USACCUM_MAX 0x1FFFFFF.FEp-0UHK
# define USACCUM_EPSILON 0x1p-7UHK
#else
# define USACCUM_FBIT 16
# define USACCUM_IBIT 16
# define USACCUM_MAX 0xFFFF.FFFFp-0UHK
# define USACCUM_EPSILON 0x1p-16UHK
#endif
//
// ACCUM_*
//
#if __GDCC_Engine__Doominati__
# define ACCUM_FBIT 15
# define ACCUM_IBIT 48
# define ACCUM_MIN (-0x800000000000p-0K-0x800000000000p-0K)
# define ACCUM_MAX 0xFFFFFFFFFFFF.FFFEp-0K
# define ACCUM_EPSILON 0x1p-15K
#else
# define ACCUM_FBIT 16
# define ACCUM_IBIT 15
# define ACCUM_MIN (-0x4000p-0K-0x4000p-0K)
# define ACCUM_MAX 0x7FFF.FFFFp-0K
# define ACCUM_EPSILON 0x1p-16K
#endif
//
// UACCUM_*
//
#if __GDCC_Engine__Doominati__
# define UACCUM_FBIT 15
# define UACCUM_IBIT 49
# define UACCUM_MAX 0x1FFFFFFFFFFFF.FFFEp-0K
# define UACCUM_EPSILON 0x1p-15UK
#else
# define UACCUM_FBIT 16
# define UACCUM_IBIT 16
# define UACCUM_MAX 0xFFFF.FFFFp-0UK
# define UACCUM_EPSILON 0x1p-16UK
#endif
//
// LACCUM_*
//
#if __GDCC_Engine__Doominati__
# define LACCUM_FBIT 32
# define LACCUM_IBIT 63
# define LACCUM_MIN (-0x4000000000000000p-0LK-0x4000000000000000p-0LK)
# define LACCUM_MAX 0x7FFFFFFFFFFFFFFF.FFFFFFFFp-0LK
# define LACCUM_EPSILON 0x1p-32LK
#else
# define LACCUM_FBIT 32
# define LACCUM_IBIT 31
# define LACCUM_MIN (-0x40000000p-0LK-0x40000000p-0LK)
# define LACCUM_MAX 0x7FFFFFFF.FFFFFFFFp-0LK
# define LACCUM_EPSILON 0x1p-32LK
#endif
//
// ULACCUM_*
//
#if __GDCC_Engine__Doominati__
# define ULACCUM_FBIT 32
# define ULACCUM_IBIT 64
# define ULACCUM_MAX 0xFFFFFFFFFFFFFFFF.FFFFFFFFp-0ULK
# define ULACCUM_EPSILON 0x1p-32ULK
#else
# define ULACCUM_FBIT 32
# define ULACCUM_IBIT 32
# define ULACCUM_MAX 0xFFFFFFFF.FFFFFFFFp-0ULK
# define ULACCUM_EPSILON 0x1p-32ULK
#endif
//
// absfx
//
#define absfx(f) (__GDCC__TGMathFX((f), abs,)((f)))
//
// roundfx
//
#define roundfx(f, n) (__GDCC__TGMathFX((f), round, u)((f), (n)))
//
// countlsfx
//
#define countlsfx(f) (__GDCC__TGMathFX((f), countls, u)((f)))
//
// fixed
//
// Not standard, but there is sufficient community momentum to justify it.
//
#if !defined(fixed) && !defined(__STRICT_ANSI__)
#define fixed __fixed
#endif
//
// __GDCC__TGMathFX
//
#define __GDCC__TGMathFX(f, func, u) \
(_Generic((f), \
short fract: func##hr, \
fract: func##r, \
long fract: func##lr, \
short accum: func##hk, \
accum: func##k, \
long accum: func##lk, \
unsigned short fract: func##u##hr, \
unsigned fract: func##u##r, \
unsigned long fract: func##u##lr, \
unsigned short accum: func##u##hk, \
unsigned accum: func##u##k, \
unsigned long accum: func##u##lk))
//----------------------------------------------------------------------------|
// Types |
//
//
// int_*_t
//
typedef int int_hr_t;
typedef int int_r_t;
typedef int int_lr_t;
typedef int int_hk_t;
typedef int int_k_t;
typedef long int_lk_t;
//
// uint_*_t
//
typedef unsigned int uint_uhr_t;
typedef unsigned int uint_ur_t;
typedef unsigned int uint_ulr_t;
typedef unsigned int uint_uhk_t;
typedef unsigned int uint_uk_t;
typedef unsigned long uint_ulk_t;
//----------------------------------------------------------------------------|
// Global Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// The fixed-point arithmetic operation support functions.
//
int mulir(int, fract);
long int mulilr(long int, long fract);
int mulik(int, accum);
long int mulilk(long int, long accum);
int divir(int, fract);
long int divilr(long int, long fract);
int divik(int, accum);
long int divilk(long int, long accum);
fract rdivi(int, int);
long fract lrdivi(long int, long int);
accum kdivi(int, int);
long accum lkdivi(long int, long int);
int idivr(fract, fract);
long int idivlr(long fract, long fract);
int idivk(accum, accum);
long int idivlk(long accum, long accum);
unsigned int muliur(unsigned int, unsigned fract);
unsigned long int muliulr(unsigned long int, unsigned long fract);
unsigned int muliuk(unsigned int, unsigned accum);
unsigned long int muliulk(unsigned long int, unsigned long accum);
unsigned int diviur(unsigned int, unsigned fract);
unsigned long int diviulr(unsigned long int, unsigned long fract);
unsigned int diviuk(unsigned int, unsigned accum);
unsigned long int diviulk(unsigned long int, unsigned long accum);
unsigned fract urdivi(unsigned int, unsigned int);
unsigned long fract ulrdivi(unsigned long int, unsigned long int);
unsigned accum ukdivi(unsigned int, unsigned int);
unsigned long accum ulkdivi(unsigned long int, unsigned long int);
unsigned int idivur(unsigned fract, unsigned fract);
unsigned long int idivulr(unsigned long fract, unsigned long fract);
unsigned int idivuk(unsigned accum, unsigned accum);
unsigned long int idivulk(unsigned long accum, unsigned long accum);
//
// The fixed-point absolute value functions.
//
short fract abshr(short fract _f);
fract absr(fract _f);
long fract abslr(long fract _f);
short accum abshk(short accum _f);
accum absk(accum _f);
long accum abslk(long accum _f);
//
// The fixed-point rounding functions.
//
short fract roundhr(short fract _f, int _n);
fract roundr(fract _f, int _n);
long fract roundlr(long fract _f, int _n);
short accum roundhk(short accum _f, int _n);
accum roundk(accum _f, int _n);
long accum roundlk(long accum _f, int _n);
unsigned short fract rounduhr(unsigned short fract _f, int _n);
unsigned fract roundur(unsigned fract _f, int _n);
unsigned long fract roundulr(unsigned long fract _f, int _n);
unsigned short accum rounduhk(unsigned short accum _f, int _n);
unsigned accum rounduk(unsigned accum _f, int _n);
unsigned long accum roundulk(unsigned long accum _f, int _n);
//
// The fixed-point countls functions.
//
int countlshr(short fract _f);
int countlsr(fract _f);
int countlslr(long fract _f);
int countlshk(short accum _f);
int countlsk(accum _f);
int countlslk(long accum _f);
int countlsuhr(unsigned short fract _f);
int countlsur(unsigned fract _f);
int countlsulr(unsigned long fract _f);
int countlsuhk(unsigned short accum _f);
int countlsuk(unsigned accum _f);
int countlsulk(unsigned long accum _f);
//
// The bitwise fixed-point to integer conversion functions.
//
int_hr_t bitshr(short fract _f);
int_r_t bitsr(fract _f);
int_lr_t bitslr(long fract _f);
int_hk_t bitshk(short accum _f);
int_k_t bitsk(accum _f);
int_lk_t bitslk(long accum _f);
uint_uhr_t bitsuhr(unsigned short fract _f);
uint_ur_t bitsur(unsigned fract _f);
uint_ulr_t bitsulr(unsigned long fract _f);
uint_uhk_t bitsuhk(unsigned short accum _f);
uint_uk_t bitsuk(unsigned accum _f);
uint_ulk_t bitsulk(unsigned long accum _f);
//
// The bitwise integer to fixed-point conversion functions.
//
short fract hrbits(int_hr_t _n);
fract rbits(int_r_t _n);
long fract lrbits(int_lr_t _n);
short accum hkbits(int_hk_t _n);
accum kbits(int_k_t _n);
long accum lkbits(int_lk_t _n);
unsigned short fract uhrbits(uint_uhr_t _n);
unsigned fract urbits(uint_ur_t _n);
unsigned long fract ulrbits(uint_ulr_t _n);
unsigned short accum uhkbits(uint_uhk_t _n);
unsigned accum ukbits(uint_uk_t _n);
unsigned long accum ulkbits(uint_ulk_t _n);
//
// Numeric conversion functions.
//
short fract strtofxhr(char const *restrict _nptr, char **restrict _endptr);
fract strtofxr(char const *restrict _nptr, char **restrict _endptr);
long fract strtofxlr(char const *restrict _nptr, char **restrict _endptr);
short accum strtofxhk(char const *restrict _nptr, char **restrict _endptr);
accum strtofxk(char const *restrict _nptr, char **restrict _endptr);
long accum strtofxlk(char const *restrict _nptr, char **restrict _endptr);
unsigned short fract strtofxuhr(char const *restrict _nptr, char **restrict _endptr);
unsigned fract strtofxur(char const *restrict _nptr, char **restrict _endptr);
unsigned long fract strtofxulr(char const *restrict _nptr, char **restrict _endptr);
unsigned short accum strtofxuhk(char const *restrict _nptr, char **restrict _endptr);
unsigned accum strtofxuk(char const *restrict _nptr, char **restrict _endptr);
unsigned long accum strtofxulk(char const *restrict _nptr, char **restrict _endptr);
//
// Implementation extensions.
//
short fract strtofxhr_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
fract strtofxr_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
long fract strtofxlr_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
short accum strtofxhk_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
accum strtofxk_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
long accum strtofxlk_str(char const __str_ars *restrict _nptr, char __str_ars **restrict _endptr);
unsigned short fract strtofxuhr_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
unsigned fract strtofxur_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
unsigned long fract strtofxulr_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
unsigned short accum strtofxuhk_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
unsigned accum strtofxuk_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
unsigned long accum strtofxulk_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__stdfix_h__

View file

@ -1,244 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2017 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Integer types.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdint_h__
#define __GDCC_Header__C__stdint_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
#if !__GDCC_Family__ZDACS__
#define INT8_MIN (-0x7F-1)
#define INT8_MAX ( 0x7F )
#define UINT8_MAX ( 0xFFU )
#endif
#if !__GDCC_Family__ZDACS__
#define INT16_MIN (-0x7FFF-1)
#define INT16_MAX ( 0x7FFF )
#define UINT16_MAX ( 0xFFFFU )
#endif
#define INT32_MIN (-0x7FFFFFFF-1)
#define INT32_MAX ( 0x7FFFFFFF )
#define UINT32_MAX ( 0xFFFFFFFFU )
#define INT64_MIN (-0x7FFFFFFFFFFFFFFF-1)
#define INT64_MAX ( 0x7FFFFFFFFFFFFFFF )
#define UINT64_MAX ( 0xFFFFFFFFFFFFFFFFU )
#define INT96_MIN (-0x7FFFFFFFFFFFFFFFFFFFFFFF-1)
#define INT96_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFF )
#define UINT96_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFU )
#if __GDCC_Family__ZDACS__
#define INT_LEAST8_MIN (-0x7FFFFFFF-1)
#define INT_LEAST8_MAX ( 0x7FFFFFFF )
#define UINT_LEAST8_MAX ( 0xFFFFFFFFU )
#else
#define INT_LEAST8_MIN (-0x7F-1)
#define INT_LEAST8_MAX ( 0x7F )
#define UINT_LEAST8_MAX ( 0xFFU )
#endif
#if __GDCC_Family__ZDACS__
#define INT_LEAST16_MIN (-0x7FFFFFFF-1)
#define INT_LEAST16_MAX ( 0x7FFFFFFF )
#define UINT_LEAST16_MAX ( 0xFFFFFFFFU )
#else
#define INT_LEAST16_MIN (-0x7FFF-1)
#define INT_LEAST16_MAX ( 0x7FFF )
#define UINT_LEAST16_MAX ( 0xFFFFU )
#endif
#define INT_LEAST32_MIN (-0x7FFFFFFF-1)
#define INT_LEAST32_MAX ( 0x7FFFFFFF )
#define UINT_LEAST32_MAX ( 0xFFFFFFFFU )
#define INT_LEAST64_MIN (-0x7FFFFFFFFFFFFFFF-1)
#define INT_LEAST64_MAX ( 0x7FFFFFFFFFFFFFFF )
#define UINT_LEAST64_MAX ( 0xFFFFFFFFFFFFFFFFU )
#define INT_LEAST96_MIN (-0x7FFFFFFFFFFFFFFFFFFFFFFF-1)
#define INT_LEAST96_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFF )
#define UINT_LEAST96_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFU )
#define INT_FAST8_MIN (-0x7FFFFFFF-1)
#define INT_FAST8_MAX ( 0x7FFFFFFF )
#define UINT_FAST8_MAX ( 0xFFFFFFFFU )
#define INT_FAST16_MIN (-0x7FFFFFFF-1)
#define INT_FAST16_MAX ( 0x7FFFFFFF )
#define UINT_FAST16_MAX ( 0xFFFFFFFFU )
#define INT_FAST32_MIN (-0x7FFFFFFF-1)
#define INT_FAST32_MAX ( 0x7FFFFFFF )
#define UINT_FAST32_MAX ( 0xFFFFFFFFU )
#define INT_FAST64_MIN (-0x7FFFFFFFFFFFFFFF-1)
#define INT_FAST64_MAX ( 0x7FFFFFFFFFFFFFFF )
#define UINT_FAST64_MAX ( 0xFFFFFFFFFFFFFFFFU )
#define INT_FAST96_MIN (-0x7FFFFFFFFFFFFFFFFFFFFFFF-1)
#define INT_FAST96_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFF )
#define UINT_FAST96_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFU )
#define INTPTR_MIN (-0x7FFFFFFF-1)
#define INTPTR_MAX ( 0x7FFFFFFF )
#define UINTPTR_MAX ( 0xFFFFFFFFU )
#define INTMAX_MIN (-0x7FFFFFFFFFFFFFFFFFFFFFFF-1)
#define INTMAX_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFF )
#define UINTMAX_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFU )
#ifndef PTRDIFF_MIN
#define PTRDIFF_MIN (-0x7FFFFFFF-1)
#define PTRDIFF_MAX ( 0x7FFFFFFF )
#endif
#ifndef SIG_ATOMIC_MIN
#define SIG_ATOMIC_MIN (-0x7FFFFFFF-1)
#define SIG_ATOMIC_MAX ( 0x7FFFFFFF )
#endif
#ifndef SIZE_MAX
#define SIZE_MAX (0xFFFFFFFFU)
#endif
#ifndef WCHAR_MIN
#define WCHAR_MIN 0
#define WCHAR_MAX 0xFFFFFFFF
#endif
#ifndef WINT_MIN
#define WINT_MIN (-0x7FFFFFFF-1)
#define WINT_MAX ( 0x7FFFFFFF )
#endif
#define INT8_C (VALUE) (VALUE )
#define INT16_C(VALUE) (VALUE )
#define INT32_C(VALUE) (VALUE )
#define INT64_C(VALUE) (VALUE ## L )
#define INT96_C(VALUE) (VALUE ## LL)
#define UINT8_C (VALUE) (VALUE ## U )
#define UINT16_C(VALUE) (VALUE ## U )
#define UINT32_C(VALUE) (VALUE ## U )
#define UINT64_C(VALUE) (VALUE ## UL )
#define UINT96_C(VALUE) (VALUE ## ULL)
#define INTMAX_C(VALUE) (VALUE ## LL)
#define UINTMAX_C(VALUE) (VALUE ## ULL)
//----------------------------------------------------------------------------|
// Types |
//
//
// intN_t
//
#if !__GDCC_Family__ZDACS__
typedef signed char int8_t;
typedef signed short int int16_t;
#endif
typedef signed int int32_t;
typedef signed long int int64_t;
typedef signed long long int int96_t;
//
// uintN_t
//
#if !__GDCC_Family__ZDACS__
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
#endif
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
typedef unsigned long long int uint96_t;
//
// int_leastN_t
//
typedef signed char int_least8_t;
typedef signed short int int_least16_t;
typedef signed int int_least32_t;
typedef signed long int int_least64_t;
typedef signed long long int int_least96_t;
//
// uint_leastN_t
//
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
typedef unsigned long int uint_least64_t;
typedef unsigned long long int uint_least96_t;
//
// int_fastN_t
//
typedef signed int int_fast8_t;
typedef signed int int_fast16_t;
typedef signed int int_fast32_t;
typedef signed long int int_fast64_t;
typedef signed long long int int_fast96_t;
//
// uint_fastN_t
//
typedef unsigned int uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
typedef unsigned long long int uint_fast96_t;
//
// intptr_t
//
#ifndef __GDCC_Have__intptr_t__
#define __GDCC_Have__intptr_t__
typedef __intptr_t intptr_t;
#endif
//
// uintptr_t
//
#ifndef __GDCC_Have__uintptr_t__
#define __GDCC_Have__uintptr_t__
typedef __uintptr_t uintptr_t;
#endif
//
// intmax_t
//
#ifndef __GDCC_Have__intmax_t__
#define __GDCC_Have__intmax_t__
typedef __intmax_t intmax_t;
#endif
//
// uintmax_t
//
#ifndef __GDCC_Have__uintmax_t__
#define __GDCC_Have__uintmax_t__
typedef __uintmax_t uintmax_t;
#endif
#endif//__GDCC_Header__C__stdint_h__

View file

@ -1,378 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Input/output.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdio_h__
#define __GDCC_Header__C__stdio_h__
#include <bits/types.h>
#ifdef __cplusplus
extern "C" {
#endif
//----------------------------------------------------------------------------|
// Macros |
//
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//
// _IO*
//
#define _IOFBF 1
#define _IOLBF 2
#define _IONBF 3
//
// BUFSIZ
//
#define BUFSIZ 256
//
// EOF
//
#define EOF (-1)
//
// FOPEN_MAX
//
#define FOPEN_MAX 8
//
// FILENAME_MAX
//
#define FILENAME_MAX 13
//
// L_tmpnam
//
#define L_tmpnam 13
//
// SEEK_*
//
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 3
//
// TMP_MAX
//
#define TMP_MAX 25
//
// stderr, stdin, stdout
//
#ifdef __GDCC__DirectObject
#define stderr (&__stderr)
#define stdin (&__stdin)
#define stdout (&__stdout)
#else
#define stderr (__get_stderr())
#define stdin (__get_stdin())
#define stdout (__get_stdout())
#endif
//
// _FILEFLAG_*
//
#define _FILEFLAG_EOF 0x00000001
#define _FILEFLAG_ERR 0x00000002
#define _FILEFLAG_FRB 0x00000004
#define _FILEFLAG_FRC 0x00000008
#define _FILEFLAG_FRF 0x00000010
#define _FILEFLAG_LBF 0x00000020
//----------------------------------------------------------------------------|
// Types |
//
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//
// FILE
//
#ifndef __GDCC_Have__FILE__
#define __GDCC_Have__FILE__
typedef struct __FILE FILE;
#endif
//
// fpos_t
//
typedef __off_t fpos_t;
//
// POSIX extensions.
//
#if _POSIX_C_SOURCE >= 200809L
//
// off_t
//
#ifndef __GDCC_Have__off_t__
#define __GDCC_Have__off_t__
typedef __off_t off_t;
#endif
//
// ssize_t
//
#ifndef __GDCC_Have__ssize_t__
#define __GDCC_Have__ssize_t__
typedef __ssize_t ssize_t;
#endif
#endif
//
// GNU extensions.
//
#if defined(_GNU_SOURCE)
typedef __cookie_read_function_t cookie_read_function_t;
typedef __cookie_write_function_t cookie_write_function_t;
typedef __cookie_seek_function_t cookie_seek_function_t;
typedef __cookie_close_function_t cookie_close_function_t;
typedef struct __cookie_io_functions_t cookie_io_functions_t;
#endif
//
// Implementation extensions.
//
//
// __cookie_io_functions_t
//
struct __cookie_io_functions_t
{
__cookie_read_function_t *read;
__cookie_write_function_t *write;
__cookie_seek_function_t *seek;
__cookie_close_function_t *close;
};
//
// __FILE_buf
//
typedef struct __FILE_buf
{
char *_buf;
char *_ptr;
char *_end;
size_t _len;
} __FILE_buf;
//
// __FILE
//
typedef struct __FILE
{
struct __cookie_io_functions_t _fn;
__FILE_buf _get;
__FILE_buf _put;
void *_cookie;
unsigned _flag;
} __FILE;
//----------------------------------------------------------------------------|
// Extern Objects |
//
//
// __stderr, __stdin, __stdout
//
extern FILE __stderr, __stdin, __stdout;
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// Operations on files.
//
int remove(char const *_filename);
int rename(char const *_oldname, char const *_newname);
FILE *tmpfile(void);
char *tmpnam(char *_s);
//
// File access functions.
//
int fclose(FILE *_stream);
int fflush(FILE *_stream);
FILE *fopen(char const *restrict _filename, char const *restrict _mode);
FILE *freopen(char const *restrict _filename, char const *restrict _mode,
FILE *restrict _stream);
void setbuf(FILE *restrict _stream, char *restrict _buf);
int setvbuf(FILE *restrict _stream, char *restrict _buf, int _mode, size_t _size);
//
// Formatted input/output functions.
//
int fprintf(FILE *restrict _stream, char const *restrict _format, ...);
int fscanf(FILE *restrict _stream, char const *restrict _format, ...);
int printf(char const *restrict _format, ...);
int scanf(char const *restrict _format, ...);
int snprintf(char *restrict _s, size_t _n, char const *restrict _format, ...);
int sprintf(char *restrict _s, char const *restrict _format, ...);
int sscanf(char const *restrict _s, char const *restrict _format, ...);
int vfprintf(FILE *restrict _stream, char const *restrict _format, __va_list _arg);
int vfscanf(FILE *restrict _stream, char const *restrict _format, __va_list _arg);
int vprintf(char const *restrict _format, __va_list _arg);
int vscanf(char const *restrict _format, __va_list _arg);
int vsnprintf(char *restrict _s, size_t _n, char const *restrict _format, __va_list _arg);
int vsprintf(char *restrict _s, char const *restrict _format, __va_list _arg);
int vsscanf(char const *restrict _s, char const *restrict _format, __va_list _arg);
//
// Character input/output functions.
//
int fgetc(FILE *_stream);
char *fgets(char *restrict _s, int _n, FILE *restrict _stream);
int fputc(int _c, FILE *_stream);
int fputs(char const *restrict _s, FILE *restrict _stream);
int getc(FILE *_stream);
int getchar(void);
int putc(int _c, FILE *_stream);
int putchar(int _c);
int puts(char const *_s);
int ungetc(int _c, FILE *_stream);
//
// Direct input/output functions.
//
size_t fread(void *restrict _ptr, size_t _size, size_t _nmemb,
FILE *restrict _stream);
size_t fwrite(void const *restrict _ptr, size_t _size, size_t _nmemb,
FILE *restrict _stream);
//
// File positioning functions.
//
int fgetpos(FILE *restrict _stream, fpos_t *restrict _pos);
int fseek(FILE *_stream, long int _offset, int _whence);
int fsetpos(FILE *_stream, fpos_t const *_pos);
long int ftell(FILE *_stream);
void rewind(FILE *_stream);
//
// Error-handling functions.
//
void clearerr(FILE *_stream);
int feof(FILE *_stream);
int ferror(FILE *_stream);
void perror(char const *_s);
//
// POSIX extensions.
//
#if _POSIX_C_SOURCE >= 200809L
FILE *fmemopen(void *_buf, size_t _size, char const *_mode);
FILE *open_memstream(char **_ptr, size_t *_sizeloc);
#endif
//
// GNU extensions.
//
#if defined(_GNU_SOURCE)
FILE *fopencookie(void *_cookie, char const *_mode, cookie_io_functions_t _io_funcs);
#endif
//
// Implementation extensions.
//
FILE *__fopencookie_ctor(FILE *_stream, void *_cookie, char const *_mode,
struct __cookie_io_functions_t _io_funcs);
FILE *__fmemopen_str(char __str_ars const *_buf, size_t _size, char const *_mode);
FILE *__fmemopen_sta_r(char const *_buf, size_t _size);
FILE *__fmemopen_sta_r_str(char __str_ars const *_buf, size_t _size);
FILE *__fmemopen_sta_w(char *_buf, size_t _size);
int __fscanf_str(FILE *restrict _stream, char __str_ars const *restrict _format, ...);
int __scanf_str(char __str_ars const *restrict _format, ...);
int __sscanf_str(char const *restrict _s, char __str_ars const *restrict _format, ...);
int __strscanf(char __str_ars const *restrict _s, char const *restrict _format, ...);
int __strscanf_str(char __str_ars const *restrict _s, char __str_ars const *restrict _format, ...);
int __vfscanf_str(FILE *restrict _stream, char __str_ars const *restrict _format,
__va_list _arg);
int __vscanf_str(char __str_ars const *restrict _format, __va_list _arg);
int __vsscanf_str(char const *restrict _s,
char __str_ars const *restrict _format, __va_list _arg);
int __vstrscanf(char __str_ars const *restrict _s, char const *restrict _format,
__va_list _arg);
int __vstrscanf_str(char __str_ars const *restrict _s,
char __str_ars const *restrict _format, __va_list _arg);
int __fprintf_str(FILE *restrict _stream,
char __str_ars const *restrict _format, ...);
int __nprintf(char const *restrict _format, ...);
int __nprintf_str(char __str_ars const *restrict _format, ...);
int __printf_str(char __str_ars const *restrict _format, ...);
int __snprintf_str(char *restrict _s, size_t _n, char __str_ars const *restrict _format, ...);
int __sprintf_str(char *restrict _s, char __str_ars const *restrict _format, ...);
int __vfprintf_str(FILE *restrict _stream,
char __str_ars const *restrict _format, __va_list _arg);
int __vnprintf(char const *restrict _format, __va_list _arg);
int __vnprintf_str(char __str_ars const *restrict _format, __va_list _arg);
int __vprintf_str(char __str_ars const *restrict _format, __va_list _arg);
int __vsnprintf_str(char *restrict _s, size_t _n,
char __str_ars const *restrict _format, __va_list _arg);
int __vsprintf_str(char *restrict _s, char __str_ars const *restrict _format, __va_list _arg);
size_t __fwrite_str(void __str_ars const *restrict _ptr, size_t _size,
size_t _nmemb, FILE *restrict _stream);
FILE *__get_stderr(void);
FILE *__get_stdin(void);
FILE *__get_stdout(void);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__stdio_h__

View file

@ -1,202 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// General utilities.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdlib_h__
#define __GDCC_Header__C__stdlib_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// EXIT_FAILURE
//
#define EXIT_FAILURE 1
//
// EXIT_SUCCESS
//
#define EXIT_SUCCESS 0
//
// MB_CUR_MAX
//
#define MB_CUR_MAX ((size_t)6)
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//
// RAND_MAX
//
#define RAND_MAX 0x7FFFFFFF
//----------------------------------------------------------------------------|
// Types |
//
//
// div_t
//
typedef __div_t div_t;
//
// ldiv_t
//
typedef long __div_t ldiv_t;
//
// lldiv_t
//
typedef long long __div_t lldiv_t;
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//
// wchar_t
//
#ifndef __GDCC_Have__wchar_t__
#define __GDCC_Have__wchar_t__
typedef __wchar_t wchar_t;
#endif
//----------------------------------------------------------------------------|
// Extern Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// Numeric conversion functions.
//
double atof(char const *_nptr);
int atoi(char const *_nptr);
long atol(char const *_nptr);
long long atoll(char const *_nptr);
double strtod(char const *restrict _nptr, char **restrict _endptr);
float strtof(char const *restrict _nptr, char **restrict _endptr);
long double strtold(char const *restrict _nptr, char **restrict _endptr);
long strtol(char const *restrict _nptr, char **restrict _endptr, int _base);
long long strtoll(char const *restrict _nptr, char **restrict _endptr, int _base);
unsigned long strtoul(char const *restrict _nptr, char **restrict _endptr, int _base);
unsigned long long strtoull(char const *restrict _nptr, char **restrict _endptr, int _base);
//
// Pseudo-random sequence generation functions.
//
int rand(void);
void srand(unsigned int _seed);
//
// Memory management functions.
//
void *calloc(size_t _nmemb, size_t _size);
void free(void *_ptr);
void *malloc(size_t _size);
void *realloc(void *_ptr, size_t _size);
//
// Communication with the environment.
//
void abort(void);
int atexit(void (*_func)(void));
void exit(int _status);
void _Exit(int _status);
char *getenv(char const *_name);
int system(char const *_string);
//
// Searching and sorting utilities.
//
void *bsearch(void const *_key, void const *_base, size_t _nmemb, size_t _size,
int (*_compar)(void const *, void const *));
void qsort(void *_base, size_t _nmemb, size_t _size,
int (*_compar)(void const *, void const *));
//
// Integer arithmetic functions.
//
int abs(int _j);
long int labs(long int _j);
long long int llabs(long long int _j);
div_t div(int _numer, int _denom);
ldiv_t ldiv(long int _numer, long int _denom);
lldiv_t lldiv(long long int _numer, long long int _denom);
//
// Multibyte/wide character conversion functions.
//
int mblen(char const *_s, size_t _n);
int mbtowc(wchar_t *restrict _pwc, char const *restrict _s, size_t _n);
int wctomb(char *_s, wchar_t _wc);
//
// Multibyte/wide string conversion functions.
//
size_t mbstowcs(wchar_t *restrict _pwcs, char const *restrict _s, size_t _n);
size_t wcstombs(char *restrict _s, wchar_t const *restrict _pwcs, size_t _n);
//
// Implementation extensions.
//
double strtod_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
float strtof_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
long double strtold_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
int strtoi(char const *restrict _nptr, char **restrict _endptr, int _base);
int strtoi_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
long strtol_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
long long strtoll_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
unsigned int strtoui(char const *restrict _nptr, char **restrict _endptr, int _base);
unsigned int strtoui_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
unsigned long strtoul_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
unsigned long long strtoull_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
#ifdef __cplusplus
};
#endif
#endif//__GDCC_Header__C__stdlib_h__

View file

@ -1,33 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// _Noreturn.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__stdnoreturn_h__
#define __GDCC_Header__C__stdnoreturn_h__
#include <bits/features.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// noreturn
//
#ifndef __cplusplus
#define noreturn _Noreturn
#endif
#endif//__GDCC_Header__C__stdnoreturn_h__

View file

@ -1,125 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// String handling.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__string_h__
#define __GDCC_Header__C__string_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//----------------------------------------------------------------------------|
// Types |
//
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//----------------------------------------------------------------------------|
// Global Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// Copying functions.
//
void *memcpy(void *restrict _s1, void const *restrict _s2, size_t _n);
void *memmove(void *_s1, void const *_s2, size_t _n);
char *strcpy(char *restrict _s1, char const *restrict _s2);
char *strncpy(char *restrict _s1, char const *restrict _s2, size_t _n);
//
// Concatenation functions.
//
char *strcat(char *restrict _s1, char const *restrict _s2);
char *strncat(char *restrict _s1, char const *restrict _s2, size_t _n);
//
// Comparison functions.
//
int memcmp(void const *_s1, void const *_s2, size_t n_);
int strcmp(char const *_s1, char const *_s2);
int strcoll(char const *_s1, char const *_s2);
int strncmp(char const *_s1, char const *_s2, size_t _n);
size_t strxfrm(char *restrict _s1, char const *restrict _s2, size_t _n);
//
// Search functions
//
void *memchr(void const *_s, int _c, size_t _n);
char *strchr(char const *_s, int _c);
size_t strcspn(char const *_s1, char const *_s2);
char *strpbrk(char const *_s1, char const *_s2);
char *strrchr(char const *_s, int _c);
size_t strspn(char const *_s1, char const *_s2);
char *strstr(char const *_s1, char const *_s2);
char *strtok(char *restrict _s1, char const *restrict _s2);
//
// Miscellaneous functions.
//
void *memset(void *_s, int _c, size_t _n);
char *strerror(int _errnum);
size_t strlen(char const *_s);
//
// GNU extensions.
//
#if defined(_GNU_SOURCE)
char *strcasestr(char const *_s1, char const *_s2);
#endif
//
// Implementation extensions.
//
char *strcasechr(char const *_s, int _c);
char __str_ars *strcasechr_str(char __str_ars const *_s, int _c);
char __str_ars *strcasestr_str(char __str_ars const *_s1, char __str_ars const *_s2);
char __str_ars *strchr_str(char __str_ars const *_s, int _c);
size_t strlen_str(char __str_ars const *_s);
char __str_ars *strstr_str(char __str_ars const *_s1, char __str_ars const *_s2);
#ifdef __cplusplus
};
#endif
#endif//__GDCC_Header__C__string_h__

View file

@ -1,64 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__sys__types_h__
#define __GDCC_Header__C__sys__types_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Types |
//
//
// clock_t
//
#ifndef __GDCC_Have__clock_t__
#define __GDCC_Have__clock_t__
typedef __clock_t clock_t;
#endif
//
// off_t
//
#ifndef __GDCC_Have__off_t__
#define __GDCC_Have__off_t__
typedef __off_t off_t;
#endif
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//
// ssize_t
//
#ifndef __GDCC_Have__ssize_t__
#define __GDCC_Have__ssize_t__
typedef __ssize_t ssize_t;
#endif
//
// time_t
//
#ifndef __GDCC_Have__time_t__
#define __GDCC_Have__time_t__
typedef __time_t time_t;
#endif
#endif//__GDCC_Header__C__sys__types_h__

View file

@ -1,134 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Date and time.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__time_h__
#define __GDCC_Header__C__time_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//
// CLOCKS_PER_SEC
//
#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC 35
#endif
//
// TIME_UTC
//
#ifndef TIME_UTC
#define TIME_UTC 1
#endif
//----------------------------------------------------------------------------|
// Types |
//
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//
// clock_t
//
#ifndef __GDCC_Have__clock_t__
#define __GDCC_Have__clock_t__
typedef __clock_t clock_t;
#endif
//
// time_t
//
#ifndef __GDCC_Have__time_t__
#define __GDCC_Have__time_t__
typedef __time_t time_t;
#endif
//
// struct tm
//
struct tm
{
int tm_sec; // seconds after the minute - [0, 60]
int tm_min; // minutes after the hour - [0, 59]
int tm_hour; // hours since midnight - [0, 23]
int tm_mday; // day of the month - [1, 31]
int tm_mon; // months since January - [0, 11]
int tm_year; // years since 1900
int tm_wday; // days since Sunday - [0, 6]
int tm_yday; // days since January 1 - [0, 365]
int tm_isdst; // Daylight Saving Time flag
};
//----------------------------------------------------------------------------|
// Extern Functions |
//
#ifdef __cplusplus
extern "C" {
#endif
//
// Time manipulation functions.
//
clock_t clock();
double difftime(time_t _time1, time_t _time0);
time_t mktime(struct tm *_timeptr);
time_t time(time_t *_timer);
int timespec_get(struct timespec *_ts, int _base);
//
// Time conversion functions.
//
char *asctime(struct tm const *_timeptr);
char *ctime(time_t const *_timer);
struct tm *gmtime(time_t const *_timer);
struct tm *localtime(time_t const *_timer);
size_t strftime(char *restrict _s, size_t _maxsize, char const *restrict _format,
struct tm const *restrict _timeptr);
#ifdef __cplusplus
}
#endif
#endif//__GDCC_Header__C__time_h__

View file

@ -1,240 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Header for target library libc.
//
// Extended multibyte and wide character utilities.
//
//-----------------------------------------------------------------------------
#ifndef __GDCC_Header__C__wchar_h__
#define __GDCC_Header__C__wchar_h__
#include <bits/types.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// NULL
//
#ifndef NULL
#define NULL 0
#endif
//
// WCHAR_MIN
//
#ifndef WCHAR_MIN
#define WCHAR_MIN 0
#endif
//
// WCHAR_MAX
//
#ifndef WCHAR_MAX
#define WCHAR_MAX 0xFFFFFFFF
#endif
//
// WEOF
//
#ifndef WEOF
#define WEOF (-1)
#endif
//----------------------------------------------------------------------------|
// Types |
//
struct tm;
//
// wchar_t
//
#ifndef __GDCC_Have__wchar_t__
#define __GDCC_Have__wchar_t__
typedef __wchar_t wchar_t;
#endif
//
// size_t
//
#ifndef __GDCC_Have__size_t__
#define __GDCC_Have__size_t__
typedef __size_t size_t;
#endif
//
// mbstate_t
//
#ifndef __GDCC_Have__mbstate_t__
#define __GDCC_Have__mbstate_t__
typedef struct __mbstate_t {int;} mbstate_t;
#endif
//
// wint_t
//
#ifndef __GDCC_Have__wint_t__
#define __GDCC_Have__wint_t__
typedef __wint_t wint_t;
#endif
struct tm;
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// Formatted wide character input/output functions.
//
int fwprintf(struct __FILE *restrict _stream, wchar_t const *restrict _format, ...);
int fwscanf(struct __FILE *restrict _stream, wchar_t const *restrict _format, ...);
int swprintf(wchar_t *restrict _s, size_t _n, wchar_t const *restrict _format, ...);
int swscanf(wchar_t const *restrict _s, wchar_t const *restrict _format, ...);
int vfwprintf(struct __FILE *restrict _stream, wchar_t const *restrict _format, __va_list _arg);
int vfwscanf(struct __FILE *restrict _stream, wchar_t const *restrict _format, __va_list _arg);
int vswprintf(wchar_t *restrict _s, size_t _n, wchar_t const *restrict _format, __va_list _arg);
int vswscanf(wchar_t const *restrict _s, wchar_t const *restrict _format, __va_list _arg);
int vwprintf(wchar_t const *restrict _format, __va_list _arg);
int vwscanf(wchar_t const *restrict _format, __va_list _arg);
int wprintf(wchar_t const *restrict _format, ...);
int wscanf(wchar_t const *restrict _format, ...);
//
// Wide character input/output functions.
//
wint_t fgetwc(struct __FILE *_stream);
wchar_t *fgetws(wchar_t *restrict _s, int _n, struct __FILE *restrict _stream);
wint_t fputwc(wchar_t _c, struct __FILE *_stream);
int fputws(wchar_t const *restrict _s, struct __FILE *restrict _stream);
int fwide(struct __FILE *_stream, int _mode);
wint_t getwc(struct __FILE *_stream);
wint_t getwchar(void);
wint_t putwc(wchar_t _c, struct __FILE *_stream);
wint_t putwchar(wchar_t _c);
wint_t ungetwc(wint_t _c, struct __FILE *_stream);
//
// General wide string utilities.
//
//
// Wide string numeric conversion functions.
//
double wcstod(wchar_t const *restrict _nptr, wchar_t **restrict _endptr);
float wcstof(wchar_t const *restrict _nptr, wchar_t **restrict _endptr);
long double wcstold(wchar_t const *restrict _nptr, wchar_t **restrict _endptr);
int wcstoi(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
long wcstol(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
long long wcstoll(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
unsigned int wcstoui(wchar_t const * restrict _nptr, wchar_t **restrict _endptr, int _base);
unsigned long wcstoul(wchar_t const * restrict _nptr, wchar_t **restrict _endptr, int _base);
unsigned long long wcstoull(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
//
// Wide string copying functions.
//
wchar_t *wcscpy(wchar_t *restrict _s1, wchar_t const *restrict _s2);
wchar_t *wcsncpy(wchar_t *restrict _s1, wchar_t const *restrict _s2, size_t _n);
wchar_t *wmemcpy(wchar_t *restrict _s1, wchar_t const *restrict _s2, size_t _n);
wchar_t *wmemmove(wchar_t *_s1, wchar_t const *_s2, size_t _n);
//
// Wide string concatenation functions.
//
wchar_t *wcscat(wchar_t *restrict _s1, wchar_t const *restrict _s2);
wchar_t *wcsncat(wchar_t *restrict _s1, wchar_t const *restrict _s2, size_t _n);
//
// Wide string comparison functions.
//
int wcscmp(wchar_t const *_s1, wchar_t const *_s2);
int wcscoll(wchar_t const *_s1, wchar_t const *_s2);
int wcsncmp(wchar_t const *_s1, wchar_t const *_s2, size_t _n);
int wcsncmp(wchar_t const *_s1, wchar_t const *_s2, size_t _n);
int wmemcmp(wchar_t const *_s1, wchar_t const *_s2, size_t _n);
//
// Wide string search functions.
//
wchar_t *wcschr(wchar_t const *_s, wchar_t _c);
size_t wcscspn(wchar_t const *_s1, wchar_t const *_s2);
wchar_t *wcspbrk(wchar_t const *_s1, wchar_t const *_s2);
wchar_t *wcsrchr(wchar_t const *_s, wchar_t _c);
size_t wcsspn(wchar_t const *_s1, wchar_t const *_s2);
wchar_t *wcsstr(wchar_t const *_s1, wchar_t const *_s2);
wchar_t *wcstok(wchar_t *restrict _s1, wchar_t const *restrict _s2, wchar_t **restrict _ptr);
wchar_t *wmemchr(wchar_t const *_s, wchar_t _c, size_t _n);
//
// Miscellaneous functions.
//
size_t wcslen(wchar_t const *_s);
wchar_t *wmemset(wchar_t *_s, wchar_t _c, size_t _n);
//
// Wide character time conversion functions.
//
size_t wcsftime(wchar_t *restrict _s, size_t _maxsize,
wchar_t const *restrict _format, struct tm const *restrict _timeptr);
//
// Extended multibyte/wide character conversion utilities.
//
//
// Single-byte/wide character conversion functions.
//
wint_t btowc(int _c);
int wctob(wint_t _c);
//
// Conversion state functions.
//
int mbsinit(const mbstate_t *_ps);
//
// Restartable multibyte/wide character conversion functions.
//
size_t mbrlen(char const *restrict _s, size_t _n, mbstate_t *restrict _ps);
size_t mbrtowc(wchar_t *restrict _pwc, char const *restrict _s, size_t _n,
mbstate_t *restrict _ps);
size_t wcrtomb(char *restrict _s, wchar_t _wc, mbstate_t *restrict _ps);
//
// Restartable multibyte/wide string conversion functions.
//
size_t mbsrtowcs(wchar_t *restrict _dst, char const **restrict _src, size_t _len,
mbstate_t *restrict _ps);
size_t wcsrtombs(char *restrict _dst, wchar_t const **restrict _src, size_t _len,
mbstate_t *restrict _ps);
#endif//__GDCC_Header__C__wchar_h__

View file

@ -1,459 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Memory allocation routines.
//
//-----------------------------------------------------------------------------
#include <GDCC.h>
#if __GDCC_Family__ZDACS__
#include <ACS_ZDoom.h>
#endif
#if __GDCC_Engine__Doominati__
#include <Doominati.h>
#endif
//----------------------------------------------------------------------------|
// Macros |
//
//
// __GDCC__AllocAlign
//
// Controls the minimum alignment requirement of allocations.
//
#ifndef __GDCC__AllocAlign
#define __GDCC__AllocAlign (_Alignof(MemBlock))
#endif
//
// __GDCC__AllocSize
//
// Controls the total size of the allocation heap, in bytes.
//
#ifndef __GDCC__AllocSize
#define __GDCC__AllocSize (256*1024*1024)
#endif
//
// __GDCC__MinSplit
//
// Blocks will not be split if the remainder would be smaller than this.
//
#ifndef __GDCC__MinSplit
#define __GDCC__MinSplit (sizeof(MemBlock) * 2 + sizeof(int) * 4)
#endif
//
// MemBlockFlag_*
//
#define MemBlockFlag_Auto 0x00000001
#define MemBlockFlag_Used 0x00000002
//
// MemBlock_IsUsed
//
#define MemBlock_IsUsed(block) ((block)->flag & MemBlockFlag_Used)
//
// PtrToBlock
//
#define PtrToBlock(ptr) ((MemBlockPtr)((CharPtr)(ptr) - sizeof(MemBlock)))
//----------------------------------------------------------------------------|
// Types |
//
struct MemBlock;
typedef struct MemBlock MemBlock;
typedef MemBlock __sta *MemBlockPtr;
typedef char __sta *CharPtr;
typedef void __sta *VoidPtr;
//
// MemBlock
//
struct MemBlock
{
MemBlockPtr next, prev;
__size_t size;
__size_t flag;
char data[];
};
//----------------------------------------------------------------------------|
// Static Variables |
//
#if __GDCC_Family__ZDACS__
//_Alignas(MemBlock)
[[no_init]]
static char AllocHeapRaw[__GDCC__AllocSize];
#endif
static MemBlockPtr AllocBase, AllocIter;
#if __GDCC_Family__ZDACS__
static int AllocTime;
#endif
//----------------------------------------------------------------------------|
// Static Functions |
//
//
// AllocDel
//
[[call("StkCall")]]
static void AllocDel(register MemBlockPtr block)
{
register MemBlockPtr next = block->next;
register MemBlockPtr prev = block->prev;
// Determine which neighbors are free and can be merged.
register int nextFree = next != AllocBase && !MemBlock_IsUsed(next);
register int prevFree = block != AllocBase && !MemBlock_IsUsed(prev);
if(prevFree)
{
// Both neighbors free.
if(nextFree)
{
if(AllocIter == block || AllocIter == next)
AllocIter = prev;
(prev->next = next->next)->prev = prev;
prev->size += block->size + next->size + sizeof(MemBlock) * 2;
}
// Only prev free.
else
{
if(AllocIter == block)
AllocIter = prev;
prev->next = next;
next->prev = prev;
prev->size += block->size + sizeof(MemBlock);
}
}
else
{
// Only next free.
if(nextFree)
{
if(AllocIter == next)
AllocIter = prev;
(block->next = next->next)->prev = block;
block->size += next->size + sizeof(MemBlock);
block->flag = 0;
}
// No neighbor free.
else
{
block->flag = 0;
}
}
}
//
// AllocDelAuto
//
[[call("StkCall")]]
static void AllocDelAuto(void)
{
MemBlockPtr iter = AllocBase, next;
do
{
next = iter->next;
if(iter->flag & MemBlockFlag_Auto)
AllocDel(iter);
}
while((iter = next) != AllocBase);
}
//
// AllocInit
//
[[call("StkCall")]]
static void AllocInit(void)
{
__size_t allocSize;
#if __GDCC_Family__ZDACS__
allocSize = __GDCC__AllocSize;
AllocBase = AllocIter = (MemBlockPtr)AllocHeapRaw;
#elif __GDCC_Engine__Doominati__
allocSize = (char *)DGE_FreestoreEnd() - (char *)DGE_FreestoreBegin();
AllocBase = AllocIter = (MemBlockPtr)DGE_FreestoreBegin();
#endif
AllocBase->next = AllocBase->prev = AllocBase;
AllocBase->size = allocSize - sizeof(MemBlock);
AllocBase->flag = 0;
}
//
// AllocMerge
//
[[call("StkCall")]]
static _Bool AllocMerge(register MemBlockPtr block, register __size_t size)
{
// Check if next block is free and contains enough space.
register MemBlockPtr blockNext = block->next;
if(blockNext == AllocBase || MemBlock_IsUsed(blockNext))
return 0;
// Would the combined block have enough space?
register __size_t sizeFull = block->size + blockNext->size + sizeof(MemBlock);
if(sizeFull < size)
return 0;
register MemBlockPtr blockNextNext = blockNext->next;
register __size_t sizeDiff = sizeFull - size;
if(AllocIter == blockNext)
AllocIter = block;
// Big enough to split.
if(sizeDiff > __GDCC__MinSplit)
{
// Place new block at end of current block.
blockNext = (MemBlockPtr)(block->data + size);
// Initialize new block.
blockNext->prev = block;
blockNext->next = blockNextNext;
blockNext->size = sizeDiff - sizeof(MemBlock);
blockNext->flag = 0;
// Update neighboring blocks.
block->size = size;
block->next = blockNext;
blockNextNext->prev = blockNext;
}
// No, just merge.
else
{
block->size = sizeFull;
block->next = blockNextNext;
blockNextNext->prev = block;
}
return 1;
}
//
// AllocNew
//
[[call("StkCall")]]
static VoidPtr AllocNew(register __size_t size)
{
// Round size up to alignment of MemBlock.
size = (size + (__GDCC__AllocAlign - 1)) & ~(__GDCC__AllocAlign - 1);
register MemBlockPtr iter = AllocIter;
do
{
// Skip used blocks.
if(MemBlock_IsUsed(iter)) continue;
// Exact size match!
if(iter->size == size)
{
iter->flag = MemBlockFlag_Used;
AllocIter = iter->next;
return iter->data;
}
// Bigger, possibly split?
if(iter->size > size)
{
register __size_t sizeDiff = iter->size - size;
// Big enough to split.
if(sizeDiff > __GDCC__MinSplit)
{
// Place new block at end of current block.
MemBlockPtr newBlock = PtrToBlock(iter->data + sizeDiff);
// Initialize new block.
newBlock->prev = iter;
newBlock->next = iter->next;
newBlock->size = size;
newBlock->flag = MemBlockFlag_Used;
// Update neighboring blocks.
iter->size = sizeDiff - sizeof(MemBlock);
iter->next->prev = newBlock;
iter->next = newBlock;
// Return allocation.
AllocIter = iter;
return newBlock->data;
}
// No, just use it as-is.
else
{
iter->flag = MemBlockFlag_Used;
AllocIter = iter->next;
return iter->data;
}
}
// Not big enough, move along.
}
while((iter = iter->next) != AllocIter);
// No space found, give up.
return 0;
}
//
// AllocTimeSet
//
#if __GDCC_Family__ZDACS__
[[call("ScriptS"), script("open")]]
static void AllocTimeSet(void)
{
if(!ACS_Timer())
ACS_Delay(1);
if(ACS_Timer() == 1)
AllocTime = 1;
}
#endif
//----------------------------------------------------------------------------|
// Global Functions |
//
//
// __GDCC__alloc
//
[[call("StkCall")]]
VoidPtr __GDCC__alloc(register VoidPtr ptrOld, register __size_t size)
{
if(!AllocIter) AllocInit();
// No existing allocation.
if(!ptrOld)
return size ? AllocNew(size) : 0;
register MemBlockPtr block = PtrToBlock(ptrOld);
// Size 0 means free.
if(!size)
return AllocDel(block), 0;
// If block already has enough space, then no need to realloc.
if(block->size >= size)
return ptrOld;
// Try a merging block expansion.
if(AllocMerge(block, size))
return ptrOld;
// Fallback to simply allocate new block and memcpy.
register CharPtr ptrNew = AllocNew(size);
if(!ptrNew) return 0;
for(register CharPtr itrNew = ptrNew, itrOld = ptrOld,
end = itrOld + block->size; itrOld != end;)
*itrNew++ = *itrOld++;
AllocDel(block);
return ptrNew;
}
//
// __GDCC__alloc_dump
//
[[call("StkCall")]]
void __GDCC__alloc_dump(void)
{
if(!AllocIter) AllocInit();
#if __GDCC_Family__ZDACS__
MemBlockPtr iter = AllocBase;
do
{
ACS_BeginPrint();
ACS_PrintHex((unsigned)iter);
ACS_PrintChar(' ');
ACS_PrintHex((unsigned)iter->next);
ACS_PrintChar(' ');
ACS_PrintHex((unsigned)iter->prev);
ACS_PrintChar(' ');
ACS_PrintHex(iter->size);
ACS_PrintChar(' ');
ACS_PrintHex(iter->flag);
ACS_EndLog();
}
while((iter = iter->next) != AllocBase);
#endif
}
//
// __GDCC__Plsa
//
[[call("StkCall")]]
VoidPtr __GDCC__Plsa(unsigned int size)
{
#if __GDCC_Family__ZDACS__
// Check if a new hub was entered. If so, free automatic storage.
if(AllocTime > ACS_Timer())
AllocDelAuto();
AllocTime = ACS_Timer();
#endif
MemBlockPtr block = PtrToBlock(__GDCC__alloc(0, size));
block->flag |= MemBlockFlag_Auto;
return block->data;
}
//
// __GDCC__Plsf
//
[[call("StkCall")]]
void __GDCC__Plsf(VoidPtr ptr)
{
AllocDel(PtrToBlock(ptr));
}
// EOF

View file

@ -1,568 +0,0 @@
;;-----------------------------------------------------------------------------
;;
;; Copyright(C) 2015-2019 David Hill
;;
;; See COPYLIB for license information.
;;
;;-----------------------------------------------------------------------------
;;
;; Mathematics.
;;
;; Algorithm approximations.
;;
;;-----------------------------------------------------------------------------
;;----------------------------------------------------------------------------|
;; Functions |
;;
;;
;; ___approx_cbrt
;;
Function "___approx_cbrt"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 2
retrn = 2
block
(
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x800FFFFF))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(Stk() Stk() Lit(1023))
Div:I W 1(Stk() Stk() Lit(3))
Add:I W 1(Stk() Stk() Lit(1023))
ShL:U W 1(Stk() Stk() Lit(20))
BOrI W 1(Stk() Stk() Stk())
Retn W 2(Stk())
)
)
;;
;; ___approx_cbrtf
;;
Function "___approx_cbrtf"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 1
param = 1
retrn = 1
block
(
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x807FFFFF))
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x7F800000))
ShR:I W 1(Stk() Stk() Lit(23))
Sub:I W 1(Stk() Stk() Lit(127))
Div:I W 1(Stk() Stk() Lit(3))
Add:I W 1(Stk() Stk() Lit(127))
ShL:U W 1(Stk() Stk() Lit(23))
BOrI W 1(Stk() Stk() Stk())
Retn W 1(Stk())
)
)
;;
;; ___approx_cbrtl
;;
Function "___approx_cbrtl"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 2
retrn = 2
block
(
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x800FFFFF))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(Stk() Stk() Lit(1023))
Div:I W 1(Stk() Stk() Lit(3))
Add:I W 1(Stk() Stk() Lit(1023))
ShL:U W 1(Stk() Stk() Lit(20))
BOrI W 1(Stk() Stk() Stk())
Retn W 2(Stk())
)
)
;;
;; ___approx_frexp
;;
Function "___approx_frexp"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 3
param = 2
retrn = 3
block
(
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(LocReg(Lit(Mul(W 2))) Stk() Lit(1022))
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x800FFFFF))
BOrI W 1(Stk() Stk() Lit(0x3FE00000))
Move W 1(Stk() LocReg(Lit(Mul(W 2))))
Retn W 3(Stk())
)
)
;;
;; ___approx_frexpf
;;
Function "___approx_frexpf"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 1
retrn = 2
block
(
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x7F800000))
ShR:I W 1(Stk() Stk() Lit(23))
Sub:I W 1(LocReg(Lit(W)) Stk() Lit(126))
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x807FFFFF))
BOrI W 1(Stk() Stk() Lit(0x3F000000))
Move W 1(Stk() LocReg(Lit(W)))
Retn W 2(Stk())
)
)
;;
;; ___approx_frexpl
;;
Function "___approx_frexpl"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 3
param = 2
retrn = 3
block
(
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(LocReg(Lit(Mul(W 2))) Stk() Lit(1022))
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x800FFFFF))
BOrI W 1(Stk() Stk() Lit(0x3FE00000))
Move W 1(Stk() LocReg(Lit(Mul(W 2))))
Retn W 3(Stk())
)
)
;;
;; ___approx_log2
;;
Function "___approx_log2"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 2
retrn = 1
block
(
ShR:I W 1(Stk() LocReg(Lit(W)) Lit(20))
Sub:I W 1(Stk() Stk() Lit(1023))
Retn W 1(Stk())
)
)
;;
;; ___approx_log2f
;;
Function "___approx_log2f"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 1
param = 1
retrn = 1
block
(
ShR:I W 1(Stk() LocReg(Lit(0)) Lit(23))
Sub:I W 1(Stk() Stk() Lit(127))
Retn W 1(Stk())
)
)
;;
;; ___approx_log2l
;;
Function "___approx_log2l"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 2
retrn = 1
block
(
ShR:I W 1(Stk() LocReg(Lit(W)) Lit(20))
Sub:I W 1(Stk() Stk() Lit(1023))
Retn W 1(Stk())
)
)
;;
;; ___approx_modf
;;
Function "___approx_modf"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 6
param = 2
retrn = 4
block
(
; Extract exponent as signed int.
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(LocReg(Lit(Mul(W 2))) Stk() Lit(1023))
; Check for having only integral or fractional component.
CmpGT:I W 1(Stk() LocReg(Lit(Mul(W 2))) Lit(52))
Jcnd_Tru W 1(Stk() Lit(:"$onlyi"))
CmpLT:I W 1(Stk() LocReg(Lit(Mul(W 2))) Lit(0))
Jcnd_Tru W 1(Stk() Lit(:"$onlyf"))
; Extract low bits.
ShR:I W 2(Stk() Lit(0x000FFFFFFFFFFFFF_64.0) LocReg 1(Lit(Mul(W 2))))
BAnd W 2(LocReg(Lit(Mul(W 3))) Stk() LocReg(Lit(0)))
Move W 1(LocReg(Lit(Mul(W 5))) Lit(0))
ShL:U W 2(LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 3))) LocReg 1(Lit(Mul(W 2))))
BOrI W 1(Stk() LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 4))))
Jcnd_Tru W 1(Stk() Lit(:"$fracl"))
Move W 1(Stk() Lit(0))
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
Jump W 1(Lit(:"$integ"))
:"$fracl"
ShL:U W 2(LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 3))) Lit 1(1))
Sub:I W 1(LocReg(Lit(Mul(W 5))) LocReg(Lit(Mul(W 5))) Lit(1))
BAnd W 1(Stk() LocReg(Lit(Mul(W 4))) Lit(0x00100000))
Jcnd_Nil W 1(Stk() Lit(:"$fracl"))
Move W 2(Stk() LocReg(Lit(Mul(W 3))))
BAnd W 1(Stk() Stk() Lit(0x000FFFFF))
Add:I W 1(Stk() LocReg(Lit(Mul(W 5))) Lit(1023))
ShL:U W 1(Stk() Stk() Lit(20))
BOrI W 1(Stk() Stk() Stk())
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
BOrI W 1(Stk() Stk() Stk())
; Mask out the low bits for integral result.
:"$integ"
ShR:I W 2(Stk() Lit(0x000FFFFFFFFFFFFF_64.0) LocReg 1(Lit(Mul(W 2))))
BNot W 2(Stk() Stk())
BAnd W 2(Stk() Stk() LocReg(Lit(0)))
Retn W 4(Stk())
:"$onlyi"
Move W 1(Stk() Lit(0))
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
Move W 2(Stk() LocReg(Lit(0)))
Retn W 4(Stk())
:"$onlyf"
Move W 2(Stk() LocReg(Lit(0)))
Move W 1(Stk() Lit(0))
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
Retn W 4(Stk())
)
)
;;
;; ___approx_modff
;;
Function "___approx_modff"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 4
param = 1
retrn = 2
block
(
; Extract exponent as signed int.
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x7F800000))
ShR:I W 1(Stk() Stk() Lit(23))
Sub:I W 1(LocReg(Lit(Mul(W 1))) Stk() Lit(127))
; Check for having only integral or fractional component.
CmpGT:I W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(23))
Jcnd_Tru W 1(Stk() Lit(:"$onlyi"))
CmpLT:I W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0))
Jcnd_Tru W 1(Stk() Lit(:"$onlyf"))
; Extract low bits.
ShR:I W 1(Stk() Lit(0x007FFFFF_32.0) LocReg(Lit(Mul(W 1))))
BAnd W 1(LocReg(Lit(Mul(W 2))) Stk() LocReg(Lit(0)))
Move W 1(LocReg(Lit(Mul(W 3))) Lit(0))
ShL:U W 1(LocReg(Lit(Mul(W 2))) LocReg(Lit(Mul(W 2))) LocReg(Lit(Mul(W 1))))
Jcnd_Tru W 1(LocReg(Lit(Mul(W 2))) Lit(:"$fracl"))
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x80000000))
Jump W 1(Lit(:"$integ"))
:"$fracl"
ShL:U W 1(LocReg(Lit(Mul(W 2))) LocReg(Lit(Mul(W 2))) Lit(1))
Sub:I W 1(LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 3))) Lit(1))
BAnd W 1(Stk() LocReg(Lit(Mul(W 2))) Lit(0x00800000))
Jcnd_Nil W 1(Stk() Lit(:"$fracl"))
Move W 1(Stk() LocReg(Lit(Mul(W 2))))
BAnd W 1(Stk() Stk() Lit(0x007FFFFF))
Add:I W 1(Stk() LocReg(Lit(Mul(W 3))) Lit(127))
ShL:U W 1(Stk() Stk() Lit(23))
BOrI W 1(Stk() Stk() Stk())
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x80000000))
BOrI W 1(Stk() Stk() Stk())
; Mask out the low bits for integral result.
:"$integ"
ShR:I W 1(Stk() Lit(0x007FFFFF_32.0) LocReg(Lit(Mul(W 1))))
BNot W 1(Stk() Stk())
BAnd W 1(Stk() Stk() LocReg(Lit(0)))
Retn W 2(Stk())
:"$onlyi"
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x80000000))
Move W 1(Stk() LocReg(Lit(0)))
Retn W 2(Stk())
:"$onlyf"
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x80000000))
Retn W 2(Stk())
)
)
;;
;; ___approx_modfl
;;
Function "___approx_modfl"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 6
param = 2
retrn = 4
block
(
; Extract exponent as signed int.
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(LocReg(Lit(Mul(W 2))) Stk() Lit(1023))
; Check for having only integral or fractional component.
CmpGT:I W 1(Stk() LocReg(Lit(Mul(W 2))) Lit(52))
Jcnd_Tru W 1(Stk() Lit(:"$onlyi"))
CmpLT:I W 1(Stk() LocReg(Lit(Mul(W 2))) Lit(0))
Jcnd_Tru W 1(Stk() Lit(:"$onlyf"))
; Extract low bits.
ShR:I W 2(Stk() Lit(0x000FFFFFFFFFFFFF_64.0) LocReg 1(Lit(Mul(W 2))))
BAnd W 2(LocReg(Lit(Mul(W 3))) Stk() LocReg(Lit(0)))
Move W 1(LocReg(Lit(Mul(W 5))) Lit(0))
ShL:U W 2(LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 3))) LocReg 1(Lit(Mul(W 2))))
BOrI W 1(Stk() LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 4))))
Jcnd_Tru W 1(Stk() Lit(:"$fracl"))
Move W 1(Stk() Lit(0))
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
Jump W 1(Lit(:"$integ"))
:"$fracl"
ShL:U W 2(LocReg(Lit(Mul(W 3))) LocReg(Lit(Mul(W 3))) Lit 1(1))
Sub:I W 1(LocReg(Lit(Mul(W 5))) LocReg(Lit(Mul(W 5))) Lit(1))
BAnd W 1(Stk() LocReg(Lit(Mul(W 4))) Lit(0x00100000))
Jcnd_Nil W 1(Stk() Lit(:"$fracl"))
Move W 2(Stk() LocReg(Lit(Mul(W 3))))
BAnd W 1(Stk() Stk() Lit(0x000FFFFF))
Add:I W 1(Stk() LocReg(Lit(Mul(W 5))) Lit(1023))
ShL:U W 1(Stk() Stk() Lit(20))
BOrI W 1(Stk() Stk() Stk())
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
BOrI W 1(Stk() Stk() Stk())
; Mask out the low bits for integral result.
:"$integ"
ShR:I W 2(Stk() Lit(0x000FFFFFFFFFFFFF_64.0) LocReg 1(Lit(Mul(W 2))))
BNot W 2(Stk() Stk())
BAnd W 2(Stk() Stk() LocReg(Lit(0)))
Retn W 4(Stk())
:"$onlyi"
Move W 1(Stk() Lit(0))
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
Move W 2(Stk() LocReg(Lit(0)))
Retn W 4(Stk())
:"$onlyf"
Move W 2(Stk() LocReg(Lit(0)))
Move W 1(Stk() Lit(0))
BAnd W 1(Stk() LocReg(Lit(Mul(W 1))) Lit(0x80000000))
Retn W 4(Stk())
)
)
;;
;; ___approx_sqrt
;;
Function "___approx_sqrt"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 2
retrn = 2
block
(
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x800FFFFF))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(Stk() Stk() Lit(1023))
ShR:I W 1(Stk() Stk() Lit(1))
Add:I W 1(Stk() Stk() Lit(1023))
ShL:U W 1(Stk() Stk() Lit(20))
BOrI W 1(Stk() Stk() Stk())
Retn W 2(Stk())
)
)
;;
;; ___approx_sqrtf
;;
Function "___approx_sqrtf"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 1
param = 1
retrn = 1
block
(
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x807FFFFF))
BAnd W 1(Stk() LocReg(Lit(0)) Lit(0x7F800000))
ShR:I W 1(Stk() Stk() Lit(23))
Sub:I W 1(Stk() Stk() Lit(127))
ShR:I W 1(Stk() Stk() Lit(1))
Add:I W 1(Stk() Stk() Lit(127))
ShL:U W 1(Stk() Stk() Lit(23))
BOrI W 1(Stk() Stk() Stk())
Retn W 1(Stk())
)
)
;;
;; ___approx_sqrtl
;;
Function "___approx_sqrtl"
(
alloc = 1
ctype = StkCall
defin = 1
label = :"$label"
linka = ExtC
localReg = 2
param = 2
retrn = 2
block
(
Move W 1(Stk() LocReg(Lit(0)))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x800FFFFF))
BAnd W 1(Stk() LocReg(Lit(W)) Lit(0x7FF00000))
ShR:I W 1(Stk() Stk() Lit(20))
Sub:I W 1(Stk() Stk() Lit(1023))
ShR:I W 1(Stk() Stk() Lit(1))
Add:I W 1(Stk() Stk() Lit(1023))
ShL:U W 1(Stk() Stk() Lit(20))
BOrI W 1(Stk() Stk() Stk())
Retn W 2(Stk())
)
)
;; EOF

View file

@ -1,328 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Character handling.
//
//-----------------------------------------------------------------------------
#include <ctype.h>
//----------------------------------------------------------------------------|
// Macros |
//
#define CharMax 0x7F
#define CT_alpha 0x00000001
#define CT_blank 0x00000002
#define CT_cntrl 0x00000004
#define CT_digit 0x00000008
#define CT_graph 0x00000010
#define CT_lower 0x00000020
#define CT_print 0x00000040
#define CT_punct 0x00000080
#define CT_space 0x00000100
#define CT_upper 0x00000200
#define CT_xdigi 0x00000400
//----------------------------------------------------------------------------|
// Static Variables |
//
//
// CharTab
//
static unsigned int const CharTab[] =
{
/* 00 - NUL */ CT_cntrl,
/* 01 - SOH */ CT_cntrl,
/* 02 - STX */ CT_cntrl,
/* 03 - ETX */ CT_cntrl,
/* 04 - EOT */ CT_cntrl,
/* 05 - ENQ */ CT_cntrl,
/* 06 - ACK */ CT_cntrl,
/* 07 - BEL */ CT_cntrl,
/* 08 - BS */ CT_cntrl,
/* 09 - HT */ CT_blank | CT_cntrl | CT_space,
/* 0A - LF */ CT_cntrl | CT_space,
/* 0B - VT */ CT_cntrl | CT_space,
/* 0C - FF */ CT_cntrl | CT_space,
/* 0D - CR */ CT_cntrl | CT_space,
/* 0E - SO */ CT_cntrl,
/* 0F - SI */ CT_cntrl,
/* 10 - DLE */ CT_cntrl,
/* 11 - DC1 */ CT_cntrl,
/* 12 - DC2 */ CT_cntrl,
/* 13 - DC3 */ CT_cntrl,
/* 14 - DC4 */ CT_cntrl,
/* 15 - NAK */ CT_cntrl,
/* 16 - SYN */ CT_cntrl,
/* 17 - ETB */ CT_cntrl,
/* 18 - CAN */ CT_cntrl,
/* 19 - EM */ CT_cntrl,
/* 1A - SUB */ CT_cntrl,
/* 1B - ESC */ CT_cntrl,
/* 1C - FS */ CT_cntrl,
/* 1D - GS */ CT_cntrl,
/* 1E - RS */ CT_cntrl,
/* 1F - US */ CT_cntrl,
/* 20 - ' ' */ CT_blank | CT_print | CT_space,
/* 21 - '!' */ CT_graph | CT_print | CT_punct,
/* 22 - '"' */ CT_graph | CT_print | CT_punct,
/* 23 - '#' */ CT_graph | CT_print | CT_punct,
/* 24 - '$' */ CT_graph | CT_print | CT_punct,
/* 25 - '%' */ CT_graph | CT_print | CT_punct,
/* 26 - '&' */ CT_graph | CT_print | CT_punct,
/* 27 - ''' */ CT_graph | CT_print | CT_punct,
/* 28 - '(' */ CT_graph | CT_print | CT_punct,
/* 29 - ')' */ CT_graph | CT_print | CT_punct,
/* 2A - '*' */ CT_graph | CT_print | CT_punct,
/* 2B - '+' */ CT_graph | CT_print | CT_punct,
/* 2C - ',' */ CT_graph | CT_print | CT_punct,
/* 2D - '-' */ CT_graph | CT_print | CT_punct,
/* 2E - '.' */ CT_graph | CT_print | CT_punct,
/* 2F - '/' */ CT_graph | CT_print | CT_punct,
/* 30 - '0' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 31 - '1' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 32 - '2' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 33 - '3' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 34 - '4' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 35 - '5' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 36 - '6' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 37 - '7' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 38 - '8' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 39 - '9' */ CT_digit | CT_graph | CT_print | CT_xdigi,
/* 3A - ':' */ CT_graph | CT_print | CT_punct,
/* 3B - ';' */ CT_graph | CT_print | CT_punct,
/* 3C - '<' */ CT_graph | CT_print | CT_punct,
/* 3D - '=' */ CT_graph | CT_print | CT_punct,
/* 3E - '>' */ CT_graph | CT_print | CT_punct,
/* 3F - '?' */ CT_graph | CT_print | CT_punct,
/* 40 - '@' */ CT_graph | CT_print | CT_punct,
/* 41 - 'A' */ CT_alpha | CT_graph | CT_print | CT_upper | CT_xdigi,
/* 42 - 'B' */ CT_alpha | CT_graph | CT_print | CT_upper | CT_xdigi,
/* 43 - 'C' */ CT_alpha | CT_graph | CT_print | CT_upper | CT_xdigi,
/* 44 - 'D' */ CT_alpha | CT_graph | CT_print | CT_upper | CT_xdigi,
/* 45 - 'E' */ CT_alpha | CT_graph | CT_print | CT_upper | CT_xdigi,
/* 46 - 'F' */ CT_alpha | CT_graph | CT_print | CT_upper | CT_xdigi,
/* 47 - 'G' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 48 - 'H' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 49 - 'I' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 4A - 'J' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 4B - 'K' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 4C - 'L' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 4D - 'M' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 4E - 'N' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 4F - 'O' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 50 - 'P' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 51 - 'Q' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 52 - 'R' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 53 - 'S' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 54 - 'T' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 55 - 'U' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 56 - 'V' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 57 - 'W' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 58 - 'X' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 59 - 'Y' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 5A - 'Z' */ CT_alpha | CT_graph | CT_print | CT_upper,
/* 5B - '[' */ CT_graph | CT_print | CT_punct,
/* 5C - '\' */ CT_graph | CT_print | CT_punct,
/* 5D - ']' */ CT_graph | CT_print | CT_punct,
/* 5E - '^' */ CT_graph | CT_print | CT_punct,
/* 5F - '_' */ CT_graph | CT_print | CT_punct,
/* 60 - '`' */ CT_graph | CT_print | CT_punct,
/* 61 - 'a' */ CT_alpha | CT_graph | CT_lower | CT_print | CT_xdigi,
/* 62 - 'b' */ CT_alpha | CT_graph | CT_lower | CT_print | CT_xdigi,
/* 63 - 'c' */ CT_alpha | CT_graph | CT_lower | CT_print | CT_xdigi,
/* 64 - 'd' */ CT_alpha | CT_graph | CT_lower | CT_print | CT_xdigi,
/* 65 - 'e' */ CT_alpha | CT_graph | CT_lower | CT_print | CT_xdigi,
/* 66 - 'f' */ CT_alpha | CT_graph | CT_lower | CT_print | CT_xdigi,
/* 67 - 'g' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 68 - 'h' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 69 - 'i' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 6A - 'j' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 6B - 'k' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 6C - 'l' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 6D - 'm' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 6E - 'n' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 6F - 'o' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 70 - 'p' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 71 - 'q' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 72 - 'r' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 73 - 's' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 74 - 't' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 75 - 'u' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 76 - 'v' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 77 - 'w' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 78 - 'x' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 79 - 'y' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 7A - 'z' */ CT_alpha | CT_graph | CT_lower | CT_print,
/* 7B - '{' */ CT_graph | CT_print | CT_punct,
/* 7C - '|' */ CT_graph | CT_print | CT_punct,
/* 7D - '}' */ CT_graph | CT_print | CT_punct,
/* 7E - '~' */ CT_graph | CT_print | CT_punct,
/* 7F - DEL */ CT_cntrl,
};
//----------------------------------------------------------------------------|
// Global Functions |
//
//=========================================================
// Character classification functions.
//
//
// isalnum
//
int isalnum(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & (CT_alpha | CT_digit);
}
//
// isalpha
//
int isalpha(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_alpha;
}
//
// isblank
//
int isblank(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_blank;
}
//
// iscntrl
//
int iscntrl(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_cntrl;
}
//
// isdigit
//
int isdigit(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_digit;
}
//
// isgraph
//
int isgraph(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_graph;
}
//
// islower
//
int islower(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_lower;
}
//
// isprint
//
int isprint(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_print;
}
//
// ispunct
//
int ispunct(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_punct;
}
//
// isspace
//
int isspace(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_space;
}
//
// isupper
//
int isupper(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_upper;
}
//
// isxdigit
//
int isxdigit(int c)
{
if(c & ~CharMax) return 0;
return CharTab[c] & CT_xdigi;
}
//=========================================================
// Character case mapping functions.
//
//
// tolower
//
int tolower(int c)
{
if(c & ~CharMax) return c;
return CharTab[c] & CT_upper ? c + ('a' - 'A') : c;
}
//
// toupper
//
int toupper(int c)
{
if(c & ~CharMax) return c;
return CharTab[c] & CT_lower ? c - ('a' - 'A') : c;
}
// EOF

View file

@ -1,36 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Errors.
//
//-----------------------------------------------------------------------------
#include <errno.h>
//----------------------------------------------------------------------------|
// Extern Objects |
//
int __errno = 0;
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// __get_errno
//
int *__get_errno(void)
{
return &__errno;
}
// EOF

View file

@ -1,930 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2015-2016 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Mathematics.
//
// Exponential and logarithmic functions.
//
//-----------------------------------------------------------------------------
#define __GDCC__DirectObject
#include <math.h>
#include <errno.h>
#include <limits.h>
//----------------------------------------------------------------------------|
// Macros |
//
#define M_E 2.718281828459045235360287471352662498
#define M_Ef 2.718281828459045235360287471352662498F
#define M_El 2.718281828459045235360287471352662498L
#define M_LN2 0.693147180559945309417232121458176568
#define M_LN2f 0.693147180559945309417232121458176568F
#define M_LN2l 0.693147180559945309417232121458176568L
#define M_10LN2 0x1.A934F0979A371p+1
#define M_10LN2f 0x1.A934F0979A371p+1F
#define M_10LN2l 0x1.A934F0979A371p+1L
//
// Impl_Exp
//
#define Impl_Exp(base, suffix, ebit, eoff, emin, emax, itr) \
int exp = u.i1 >> (ebit); \
\
if(exp > (eoff) + (emax)) return __inf##suffix(); \
if(exp <= (eoff) + (emin)) return Exp##base##Table##suffix[0]; \
\
exp -= (eoff) + (emin); \
\
res = Exp##base##Table##suffix[exp]; \
for(int i = 0; i != (itr) && --exp; ++i) \
{ \
u.i <<= 1; \
if(u.i1 & (1 << (ebit))) \
res *= Exp##base##Table##suffix[exp]; \
}
//
// Impl_Log2
//
#define Impl_Log2(type, suffix, N) \
if(isnan(x)) return x; \
if(signbit(x)) {errno = EDOM; return __nan##suffix();} \
if(isinf(x)) return x; \
\
if(x < 1) return -log2##suffix(1/x); \
\
if(x < 2) \
{ \
type res = 0; \
\
x *= x; \
for(int n = 1;;) \
{ \
/* Find the next n for which x**2**n >= 2. */ \
for(; x < 2; x *= x) \
if(++n == N) return res; \
\
/* Set result bit. */ \
res += 1.0##suffix >> n; \
\
/* Start over with x**2**n / 2. */ \
x >>= 1; \
} \
} \
else \
{ \
int n = __approx_log2##suffix(x); \
return n + log2##suffix(x >> n); \
}
//----------------------------------------------------------------------------|
// Types |
//
//
// __frexp_res
//
struct __frexp_res { double value; int exp;};
struct __frexpf_res { float value; int exp;};
struct __frexpl_res {long double value; int exp;};
//
// __modf_res
//
struct __modf_res { double fval, ival;};
struct __modff_res { float fval, ival;};
struct __modfl_res {long double fval, ival;};
//----------------------------------------------------------------------------|
// Static Objects |
//
#if !__GDCC__NoFloat
//
// Exp2Table
//
static double const Exp2Table[] =
{
0x1.0000000000000p+0,
0x1.0000000000001p+0,
0x1.0000000000001p+0,
0x1.0000000000003p+0,
0x1.0000000000006p+0,
0x1.000000000000Bp+0,
0x1.0000000000016p+0,
0x1.000000000002Cp+0,
0x1.0000000000059p+0,
0x1.00000000000B1p+0,
0x1.0000000000163p+0,
0x1.00000000002C6p+0,
0x1.000000000058Cp+0,
0x1.0000000000B17p+0,
0x1.000000000162Ep+0,
0x1.0000000002C5Dp+0,
0x1.00000000058B9p+0,
0x1.000000000B172p+0,
0x1.00000000162E4p+0,
0x1.000000002C5C8p+0,
0x1.0000000058B91p+0,
0x1.00000000B1721p+0,
0x1.0000000162E43p+0,
0x1.00000002C5C86p+0,
0x1.000000058B90Cp+0,
0x1.0000000B17218p+0,
0x1.000000162E430p+0,
0x1.0000002C5C860p+0,
0x1.00000058B90C1p+0,
0x1.000000B172183p+0,
0x1.00000162E430Ep+0,
0x1.000002C5C863Bp+0,
0x1.0000058B90CF2p+0,
0x1.00000B1721BD0p+0,
0x1.0000162E43F50p+0,
0x1.00002C5C89D5Fp+0,
0x1.000058B91B5BDp+0,
0x1.0000B17255776p+0,
0x1.000162E525EE0p+0,
0x1.0002C5CC37DA9p+0,
0x1.00058BA01FBA0p+0,
0x1.000B175EFFDC7p+0,
0x1.00162F3904052p+0,
0x1.002C605E2E8CFp+0,
0x1.0058C86DA1C0Ap+0,
0x1.00B1AFA5ABCBFp+0,
0x1.0163DA9FB3335p+0,
0x1.02C9A3E778061p+0,
0x1.059B0D3158574p+0,
0x1.0B5586CF9890Fp+0,
0x1.172B83C7D517Bp+0,
0x1.306FE0A31B715p+0,
0x1.6A09E667F3BCDp+0,
0x1.0000000000000p+1,
0x1.0000000000000p+2,
0x1.0000000000000p+4,
0x1.0000000000000p+8,
0x1.0000000000000p+16,
0x1.0000000000000p+32,
0x1.0000000000000p+64,
0x1.0000000000000p+128,
0x1.0000000000000p+256,
0x1.0000000000000p+512,
};
//
// Exp2Tablef
//
static float const Exp2Tablef[] =
{
0x1.000000p+0F,
0x1.000002p+0F,
0x1.000002p+0F,
0x1.000006p+0F,
0x1.00000Cp+0F,
0x1.000016p+0F,
0x1.00002Cp+0F,
0x1.000058p+0F,
0x1.0000B2p+0F,
0x1.000162p+0F,
0x1.0002C6p+0F,
0x1.00058Cp+0F,
0x1.000B18p+0F,
0x1.001630p+0F,
0x1.002C60p+0F,
0x1.0058C8p+0F,
0x1.00B1B0p+0F,
0x1.0163DAp+0F,
0x1.02C9A4p+0F,
0x1.059B0Ep+0F,
0x1.0B5586p+0F,
0x1.172B84p+0F,
0x1.306FE0p+0F,
0x1.6A09E6p+0F,
0x1.000000p+1F,
0x1.000000p+2F,
0x1.000000p+4F,
0x1.000000p+8F,
0x1.000000p+16F,
0x1.000000p+32F,
0x1.000000p+64F,
};
//
// Exp2Tablel
//
static long double const Exp2Tablel[] =
{
0x1.0000000000000p+0L,
0x1.0000000000001p+0L,
0x1.0000000000001p+0L,
0x1.0000000000003p+0L,
0x1.0000000000006p+0L,
0x1.000000000000Bp+0L,
0x1.0000000000016p+0L,
0x1.000000000002Cp+0L,
0x1.0000000000059p+0L,
0x1.00000000000B1p+0L,
0x1.0000000000163p+0L,
0x1.00000000002C6p+0L,
0x1.000000000058Cp+0L,
0x1.0000000000B17p+0L,
0x1.000000000162Ep+0L,
0x1.0000000002C5Dp+0L,
0x1.00000000058B9p+0L,
0x1.000000000B172p+0L,
0x1.00000000162E4p+0L,
0x1.000000002C5C8p+0L,
0x1.0000000058B91p+0L,
0x1.00000000B1721p+0L,
0x1.0000000162E43p+0L,
0x1.00000002C5C86p+0L,
0x1.000000058B90Cp+0L,
0x1.0000000B17218p+0L,
0x1.000000162E430p+0L,
0x1.0000002C5C860p+0L,
0x1.00000058B90C1p+0L,
0x1.000000B172183p+0L,
0x1.00000162E430Ep+0L,
0x1.000002C5C863Bp+0L,
0x1.0000058B90CF2p+0L,
0x1.00000B1721BD0p+0L,
0x1.0000162E43F50p+0L,
0x1.00002C5C89D5Fp+0L,
0x1.000058B91B5BDp+0L,
0x1.0000B17255776p+0L,
0x1.000162E525EE0p+0L,
0x1.0002C5CC37DA9p+0L,
0x1.00058BA01FBA0p+0L,
0x1.000B175EFFDC7p+0L,
0x1.00162F3904052p+0L,
0x1.002C605E2E8CFp+0L,
0x1.0058C86DA1C0Ap+0L,
0x1.00B1AFA5ABCBFp+0L,
0x1.0163DA9FB3335p+0L,
0x1.02C9A3E778061p+0L,
0x1.059B0D3158574p+0L,
0x1.0B5586CF9890Fp+0L,
0x1.172B83C7D517Bp+0L,
0x1.306FE0A31B715p+0L,
0x1.6A09E667F3BCDp+0L,
0x1.0000000000000p+1L,
0x1.0000000000000p+2L,
0x1.0000000000000p+4L,
0x1.0000000000000p+8L,
0x1.0000000000000p+16L,
0x1.0000000000000p+32L,
0x1.0000000000000p+64L,
0x1.0000000000000p+128L,
0x1.0000000000000p+256L,
0x1.0000000000000p+512L,
};
//
// ExpETable
//
static double const ExpETable[] =
{
0x1.0000000000000p+0,
0x1.0000000000001p+0,
0x1.0000000000001p+0,
0x1.0000000000002p+0,
0x1.0000000000004p+0,
0x1.0000000000008p+0,
0x1.0000000000010p+0,
0x1.0000000000020p+0,
0x1.0000000000040p+0,
0x1.0000000000080p+0,
0x1.0000000000100p+0,
0x1.0000000000200p+0,
0x1.0000000000400p+0,
0x1.0000000000800p+0,
0x1.0000000001000p+0,
0x1.0000000002000p+0,
0x1.0000000004000p+0,
0x1.0000000008000p+0,
0x1.0000000010000p+0,
0x1.0000000020000p+0,
0x1.0000000040000p+0,
0x1.0000000080000p+0,
0x1.0000000100000p+0,
0x1.0000000200000p+0,
0x1.0000000400000p+0,
0x1.0000000800000p+0,
0x1.0000001000000p+0,
0x1.0000002000000p+0,
0x1.0000004000001p+0,
0x1.0000008000002p+0,
0x1.0000010000008p+0,
0x1.0000020000020p+0,
0x1.0000040000080p+0,
0x1.0000080000200p+0,
0x1.0000100000800p+0,
0x1.0000200002000p+0,
0x1.0000400008000p+0,
0x1.0000800020000p+0,
0x1.0001000080003p+0,
0x1.0002000200015p+0,
0x1.00040008000ABp+0,
0x1.0008002000555p+0,
0x1.0010008002AABp+0,
0x1.0020020015560p+0,
0x1.00400800AAB55p+0,
0x1.0080200556001p+0,
0x1.0100802AB5577p+0,
0x1.0202015600446p+0,
0x1.04080AB55DE39p+0,
0x1.08205601127EDp+0,
0x1.1082B577D34EDp+0,
0x1.2216045B6F5CDp+0,
0x1.48B5E3C3E8186p+0,
0x1.A61298E1E069Cp+0,
0x1.5BF0A8B145769p+1,
0x1.D8E64B8D4DDAEp+2,
0x1.B4C902E273A58p+5,
0x1.749EA7D470C6Ep+11,
0x1.0F2EBD0A80020p+23,
0x1.1F43FCC4B662Cp+46,
0x1.425982CF597CDp+92,
0x1.95E54C5DD4217p+184,
0x1.41C7A8814BEBAp+369,
0x1.9476504BA852Ep+738,
};
//
// ExpETablef
//
static float const ExpETablef[] =
{
0x1.000000p+0F,
0x1.000002p+0F,
0x1.000002p+0F,
0x1.000004p+0F,
0x1.000008p+0F,
0x1.000010p+0F,
0x1.000020p+0F,
0x1.000040p+0F,
0x1.000080p+0F,
0x1.000100p+0F,
0x1.000200p+0F,
0x1.000400p+0F,
0x1.000800p+0F,
0x1.001000p+0F,
0x1.002002p+0F,
0x1.004008p+0F,
0x1.008020p+0F,
0x1.010080p+0F,
0x1.020202p+0F,
0x1.04080Ap+0F,
0x1.082056p+0F,
0x1.1082B6p+0F,
0x1.221604p+0F,
0x1.48B5E4p+0F,
0x1.A61298p+0F,
0x1.5BF0A8p+1F,
0x1.D8E64Cp+2F,
0x1.B4C902p+5F,
0x1.749EA8p+11F,
0x1.0F2EBEp+23F,
0x1.1F43FCp+46F,
0x1.425982p+92F,
};
//
// ExpETablel
//
static long double const ExpETablel[] =
{
0x1.0000000000000p+0L,
0x1.0000000000001p+0L,
0x1.0000000000001p+0L,
0x1.0000000000002p+0L,
0x1.0000000000004p+0L,
0x1.0000000000008p+0L,
0x1.0000000000010p+0L,
0x1.0000000000020p+0L,
0x1.0000000000040p+0L,
0x1.0000000000080p+0L,
0x1.0000000000100p+0L,
0x1.0000000000200p+0L,
0x1.0000000000400p+0L,
0x1.0000000000800p+0L,
0x1.0000000001000p+0L,
0x1.0000000002000p+0L,
0x1.0000000004000p+0L,
0x1.0000000008000p+0L,
0x1.0000000010000p+0L,
0x1.0000000020000p+0L,
0x1.0000000040000p+0L,
0x1.0000000080000p+0L,
0x1.0000000100000p+0L,
0x1.0000000200000p+0L,
0x1.0000000400000p+0L,
0x1.0000000800000p+0L,
0x1.0000001000000p+0L,
0x1.0000002000000p+0L,
0x1.0000004000001p+0L,
0x1.0000008000002p+0L,
0x1.0000010000008p+0L,
0x1.0000020000020p+0L,
0x1.0000040000080p+0L,
0x1.0000080000200p+0L,
0x1.0000100000800p+0L,
0x1.0000200002000p+0L,
0x1.0000400008000p+0L,
0x1.0000800020000p+0L,
0x1.0001000080003p+0L,
0x1.0002000200015p+0L,
0x1.00040008000ABp+0L,
0x1.0008002000555p+0L,
0x1.0010008002AABp+0L,
0x1.0020020015560p+0L,
0x1.00400800AAB55p+0L,
0x1.0080200556001p+0L,
0x1.0100802AB5577p+0L,
0x1.0202015600446p+0L,
0x1.04080AB55DE39p+0L,
0x1.08205601127EDp+0L,
0x1.1082B577D34EDp+0L,
0x1.2216045B6F5CDp+0L,
0x1.48B5E3C3E8186p+0L,
0x1.A61298E1E069Cp+0L,
0x1.5BF0A8B145769p+1L,
0x1.D8E64B8D4DDAEp+2L,
0x1.B4C902E273A58p+5L,
0x1.749EA7D470C6Ep+11L,
0x1.0F2EBD0A80020p+23L,
0x1.1F43FCC4B662Cp+46L,
0x1.425982CF597CDp+92L,
0x1.95E54C5DD4217p+184L,
0x1.41C7A8814BEBAp+369L,
0x1.9476504BA852Ep+738L,
};
#endif // !__GDCC__NoFloat
//----------------------------------------------------------------------------|
// Extern Functions |
//
[[call("StkCall")]] struct __frexp_res __approx_frexp(double value);
[[call("StkCall")]] struct __frexpf_res __approx_frexpf(float value);
[[call("StkCall")]] struct __frexpl_res __approx_frexpl(long double value);
[[call("StkCall")]] struct __modf_res __approx_modf(double value);
[[call("StkCall")]] struct __modff_res __approx_modff(float value);
[[call("StkCall")]] struct __modfl_res __approx_modfl(long double value);
//=========================================================
// Exponential and logarithmic functions.
//
#if !__GDCC__NoFloat
//
// exp
//
double exp(double x)
{
if(isnan(x)) return x;
if(signbit(x)) return 1 / exp(-x);
union {double f; long i; struct {int i0, i1;};} u = {x};
double res;
Impl_Exp(E, , 20, 1023, -54, 9, 52);
return res;
}
//
// expf
//
float expf(float x)
{
if(isnan(x)) return x;
if(signbit(x)) return 1 / exp(-x);
union {float f; int i; struct {int i1;};} u = {x};
float res;
Impl_Exp(E, f, 23, 127, -25, 7, 23);
return res;
}
//
// expl
//
long double expl(long double x)
{
if(isnan(x)) return x;
if(signbit(x)) return 1 / expl(-x);
union {long double f; long i; struct {int i0, i1;};} u = {x};
long double res;
Impl_Exp(E, l, 20, 1023, -54, 9, 52);
return res;
}
//
// exp2
//
double exp2(double x)
{
if(isnan(x)) return x;
if(signbit(x)) return 1 / exp2(-x);
union {double f; long i; struct {int i0, i1;};} u = {x};
double res;
Impl_Exp(2, , 20, 1023, -53, 9, 52);
return res;
}
//
// exp2f
//
float exp2f(float x)
{
if(isnan(x)) return x;
if(signbit(x)) return 1 / exp2f(-x);
union {float f; long i; struct {int i1;};} u = {x};
float res;
Impl_Exp(2, f, 23, 127, -24, 7, 23);
return res;
}
//
// exp2l
//
long double exp2l(long double x)
{
if(isnan(x)) return x;
if(signbit(x)) return 1 / exp2l(-x);
union {long double f; long i; struct {int i0, i1;};} u = {x};
long double res;
Impl_Exp(2, l, 20, 1023, -53, 9, 52);
return res;
}
//
// expm1
//
double expm1(double x)
{
return exp(x) - 1;
}
//
// expm1
//
float expm1f(float x)
{
return expf(x) - 1;
}
//
// expm1
//
long double expm1l(long double x)
{
return expl(x) - 1;
}
//
// frexp
//
double frexp(double value, int *exp)
{
if(isnan(value)) return *exp = FP_ILOGBNAN, value;
if(isinf(value)) return *exp = INT_MAX, value;
if(!value) return *exp = 0, value;
struct __frexp_res res = __approx_frexp(value);
return *exp = res.exp, res.value;
}
//
// frexpf
//
float frexpf(float value, int *exp)
{
if(isnan(value)) return *exp = FP_ILOGBNAN, value;
if(isinf(value)) return *exp = INT_MAX, value;
if(!value) return *exp = 0, value;
struct __frexpf_res res = __approx_frexpf(value);
return *exp = res.exp, res.value;
}
//
// frexpl
//
long double frexpl(long double value, int *exp)
{
if(isnan(value)) return *exp = FP_ILOGBNAN, value;
if(isinf(value)) return *exp = INT_MAX, value;
if(!value) return *exp = 0, value;
struct __frexpl_res res = __approx_frexpl(value);
return *exp = res.exp, res.value;
}
//
// ilogb
//
int ilogb(double x)
{
if(isnan(x)) return FP_ILOGBNAN;
if(isinf(x)) return INT_MAX;
if(!x) return FP_ILOGB0;
return __approx_log2(x);
}
//
// ilogbf
//
int ilogbf(float x)
{
if(isnan(x)) return FP_ILOGBNAN;
if(isinf(x)) return INT_MAX;
if(!x) return FP_ILOGB0;
return __approx_log2f(x);
}
//
// ilogbl
//
int ilogbl(long double x)
{
if(isnan(x)) return FP_ILOGBNAN;
if(isinf(x)) return INT_MAX;
if(!x) return FP_ILOGB0;
return __approx_log2l(x);
}
//
// ldexp
//
double ldexp(double x, int exp)
{
return exp < 0 ? x >> -exp : x << exp;
}
//
// ldexpf
//
float ldexpf(float x, int exp)
{
return exp < 0 ? x >> -exp : x << exp;
}
//
// ldexpl
//
long double ldexpl(long double x, int exp)
{
return exp < 0 ? x >> -exp : x << exp;
}
//
// log
//
double log(double x)
{
return log2(x) * M_LN2;
}
//
// logf
//
float logf(float x)
{
return log2f(x) * M_LN2f;
}
//
// logl
//
long double logl(long double x)
{
return log2l(x) * M_LN2l;
}
//
// log10
//
double log10(double x)
{
return log2(x) * (1 / M_10LN2);
}
//
// log10f
//
float log10f(float x)
{
return log2(x) * (1 / M_10LN2f);
}
//
// log10l
//
long double log10l(long double x)
{
return log2(x) * (1 / M_10LN2l);
}
//
// log1p
//
double log1p(double x)
{
return log(1 + x);
}
//
// log1pf
//
float log1pf(float x)
{
return log(1 + x);
}
//
// log1pl
//
long double log1pl(long double x)
{
return log(1 + x);
}
//
// log2
//
double log2(double x)
{
Impl_Log2(double, , 53);
}
//
// log2f
//
float log2f(float x)
{
Impl_Log2(float, f, 24);
}
//
// log2l
//
long double log2l(long double x)
{
Impl_Log2(long double, l, 53);
}
//
// logb
//
double logb(double x)
{
if(isnan(x)) return x;
if(isinf(x)) return x;
if(!x) {errno = ERANGE; return 0;}
return __approx_log2(x);
}
//
// logbf
//
float logbf(float x)
{
if(isnan(x)) return x;
if(isinf(x)) return x;
if(!x) {errno = ERANGE; return 0;}
return __approx_log2f(x);
}
//
// logbl
//
long double logbl(long double x)
{
if(isnan(x)) return x;
if(isinf(x)) return x;
if(!x) {errno = ERANGE; return 0;}
return __approx_log2l(x);
}
//
// modf
//
double modf(double value, double *iptr)
{
if(isnan(value) || !value) return *iptr = value;
struct __modf_res res = __approx_modf(value);
return *iptr = res.ival, res.fval;
}
//
// modff
//
float modff(float value, float *iptr)
{
if(isnan(value) || !value) return *iptr = value;
struct __modff_res res = __approx_modff(value);
return *iptr = res.ival, res.fval;
}
//
// modfl
//
long double modfl(long double value, long double *iptr)
{
if(isnan(value) || !value) return *iptr = value;
struct __modfl_res res = __approx_modfl(value);
return *iptr = res.ival, res.fval;
}
//
// scalbn
//
double scalbn(double x, int n)
{
return n < 0 ? x >> -n : x << n;
}
//
// scalbnf
//
float scalbnf(float x, int n)
{
return n < 0 ? x >> -n : x << n;
}
//
// scalbnl
//
long double scalbnl(long double x, int n)
{
return n < 0 ? x >> -n : x << n;
}
//
// scalbln
//
double scalbln(double x, long int n)
{
return n < 0 ? x >> -n : x << n;
}
//
// scalblnf
//
float scalblnf(float x, long int n)
{
return n < 0 ? x >> -n : x << n;
}
//
// scalblnl
//
long double scalblnl(long double x, long int n)
{
return n < 0 ? x >> -n : x << n;
}
#endif // !__GDCC__NoFloat
// EOF

View file

@ -1,123 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2018 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Floating-point environment.
//
//-----------------------------------------------------------------------------
#define __GDCC_DirectObject
#include <fenv.h>
//----------------------------------------------------------------------------|
// Extern Functions |
//
//=========================================================
// Floating-point exceptions.
//
//
// feclearexcept
//
int feclearexcept(int excepts)
{
return 0;
}
//
// fegetexceptflag
//
int fegetexceptflag(fexcept_t *flagp, int excepts)
{
return -1;
}
//
// feraiseexcept
//
int feraiseexcept(int excepts)
{
return excepts == 0 ? 0 : -1;
}
//
// fesetexceptflag
//
int fesetexceptflag(fexcept_t const *flagp, int excepts)
{
return excepts == 0 ? 0 : -1;
}
//
// fetestexcept
//
int fetestexcept(int excepts)
{
return 0;
}
//=========================================================
// Rounding.
//
//
// fegetround
//
int fegetround(void)
{
return -1;
}
//
// fesetround
//
int fesetround(int round)
{
return -1;
}
//=========================================================
// Environment.
//
//
// fegetenv
//
int fegetenv(fenv_t *envp)
{
return -1;
}
//
// feholdexcept
//
int feholdexcept(fenv_t *envp)
{
return -1;
}
//
// fesetenv
//
int fesetenv(const fenv_t *envp)
{
return -1;
}
//
// feupdateenv
//
int feupdateenv(const fenv_t *envp)
{
return -1;
}
// EOF

View file

@ -1,532 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Input/output.
//
// File access functions.
//
//-----------------------------------------------------------------------------
#define __GDCC__DirectObject
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <GDCC.h>
#if __GDCC_Family__ZDACS__
#include <ACS_ZDoom.h>
#endif
#if __GDCC_Engine__Doominati__
#include <Doominati.h>
#endif
//----------------------------------------------------------------------------|
// Types |
//
//
// __cookie_mem
//
typedef struct __cookie_mem
{
char *mem;
size_t len;
size_t pos;
} __cookie_mem;
//
// __cookie_mem_rea
//
typedef struct __cookie_mem_rea
{
char **mem_p;
size_t *pos_p;
char *mem;
size_t len;
size_t pos;
} __cookie_mem_rea;
//
// __cookie_mem_str
//
typedef struct __cookie_mem_str
{
char __str_ars *mem;
size_t len;
size_t pos;
} __cookie_mem_str;
//----------------------------------------------------------------------------|
// Static Prototypes |
//
static int FILE_fn_mem_close_rea(void *cookie);
static ssize_t FILE_fn_mem_read(void *cookie, char *buf, size_t size);
static ssize_t FILE_fn_mem_read_rea(void *cookie, char *buf, size_t size);
static ssize_t FILE_fn_mem_read_str(void *cookie, char *buf, size_t size);
static ssize_t FILE_fn_mem_write(void *cookie, char const *buf, size_t size);
static ssize_t FILE_fn_mem_write_rea(void *cookie, char const *buf, size_t size);
static ssize_t FILE_fn_mem_write_sta(void *cookie, char const *buf, size_t size);
static int FILE_fn_mem_seek(void *cookie, off_t *offset, int whence);
static int FILE_fn_mem_seek_rea(void *cookie, off_t *offset, int whence);
static int FILE_fn_mem_seek_str(void *cookie, off_t *offset, int whence);
//----------------------------------------------------------------------------|
// Static Objects |
//
[[no_init]]
static char Buffer_memfile[BUFSIZ];
[[no_init]]
static __cookie_mem Cookie_mem;
[[no_init]]
static __cookie_mem_str Cookie_mem_str;
static FILE __memfile;
//----------------------------------------------------------------------------|
// Static Functions |
//
//=========================================================
// memfile functions.
//
//
// FILE_fn_mem_close_rea
//
static int FILE_fn_mem_close_rea(void *cookie_)
{
__cookie_mem_rea *cookie = cookie_;
free(cookie->mem);
return 0;
}
//
// FILE_fn_mem_read
//
static ssize_t FILE_fn_mem_read(void *cookie_, char *buf, size_t size)
{
__cookie_mem *cookie = cookie_;
size_t avail = cookie->len - cookie->pos;
if(size > avail)
size = avail;
memcpy(buf, cookie->mem + cookie->pos, size);
cookie->pos += size;
return size;
}
//
// FILE_fn_mem_read_rea
//
static ssize_t FILE_fn_mem_read_rea(void *cookie_, char *buf, size_t size)
{
__cookie_mem_rea *cookie = cookie_;
size_t avail = cookie->len - cookie->pos;
if(size > avail)
size = avail;
memcpy(buf, cookie->mem + cookie->pos, size);
cookie->pos += size;
return size;
}
//
// FILE_fn_mem_read_str
//
static ssize_t FILE_fn_mem_read_str(void *cookie_, char *buf, size_t size)
{
__cookie_mem_str *cookie = cookie_;
size_t avail = cookie->len - cookie->pos;
if(size > avail)
size = avail;
#if __GDCC_Family__ZDACS__
ACS_StrArsCpyToGlobalCharRange((int)buf, __GDCC__Sta, 0, size, cookie->mem + cookie->pos);
#else
// TODO
#endif
cookie->pos += size;
return size;
}
//
// FILE_fn_mem_write
//
static ssize_t FILE_fn_mem_write(void *cookie_, char const *buf, size_t size)
{
__cookie_mem *cookie = cookie_;
size_t avail = cookie->len - cookie->pos;
if(size >= avail)
{
memcpy(cookie->mem + cookie->pos, buf, avail);
cookie->pos = cookie->len;
return avail;
}
else
{
memcpy(cookie->mem + cookie->pos, buf, size);
cookie->mem[cookie->pos += size] = '\0';
return size;
}
}
//
// FILE_fn_mem_write_rea
//
static ssize_t FILE_fn_mem_write_rea(void *cookie_, char const *buf, size_t size)
{
__cookie_mem_rea *cookie = cookie_;
size_t avail = cookie->len - cookie->pos;
if(size >= avail)
{
// TODO: Check for overflow.
size_t len = cookie->len + cookie->len / 2 + size + 1;
char *mem = realloc(cookie->mem, len);
if(!mem)
return 0;
cookie->len = len;
cookie->mem = mem;
}
memcpy(cookie->mem + cookie->pos, buf, size);
cookie->mem[cookie->pos += size] = '\0';
*cookie->mem_p = cookie->mem;
*cookie->pos_p = cookie->pos;
return size;
}
//
// FILE_fn_mem_write_sta
//
static ssize_t FILE_fn_mem_write_sta(void *cookie_, char const *buf, size_t size)
{
__cookie_mem *cookie = cookie_;
size_t avail = cookie->len - cookie->pos;
if(size >= avail)
{
memcpy(cookie->mem + cookie->pos, buf, avail);
cookie->pos = cookie->len;
return size; // Silently ignore unwritten data.
}
else
{
memcpy(cookie->mem + cookie->pos, buf, size);
cookie->mem[cookie->pos += size] = '\0';
return size;
}
}
//
// FILE_fn_mem_seek
//
static int FILE_fn_mem_seek(void *cookie_, off_t *offset, int whence)
{
__cookie_mem *cookie = cookie_;
size_t pos;
switch(whence)
{
case SEEK_SET: pos = *offset; break;
case SEEK_CUR: pos = *offset + cookie->pos; break;
case SEEK_END: pos = *offset + cookie->len; break;
default: return EOF;
}
if(pos > cookie->len)
return EOF;
*offset = cookie->pos = pos;
return 0;
}
//
// FILE_fn_mem_seek_rea
//
static int FILE_fn_mem_seek_rea(void *cookie_, off_t *offset, int whence)
{
__cookie_mem_rea *cookie = cookie_;
size_t pos;
switch(whence)
{
case SEEK_SET: pos = *offset; break;
case SEEK_CUR: pos = *offset + cookie->pos; break;
case SEEK_END: pos = *offset + cookie->len; break;
default: return EOF;
}
if(pos > cookie->len)
return EOF;
*offset = cookie->pos = pos;
return 0;
}
//
// FILE_fn_mem_seek_str
//
static int FILE_fn_mem_seek_str(void *cookie_, off_t *offset, int whence)
{
__cookie_mem_str *cookie = cookie_;
size_t pos;
switch(whence)
{
case SEEK_SET: pos = *offset; break;
case SEEK_CUR: pos = *offset + cookie->pos; break;
case SEEK_END: pos = *offset + cookie->len; break;
default: return EOF;
}
if(pos > cookie->len)
return EOF;
*offset = cookie->pos = pos;
return 0;
}
//----------------------------------------------------------------------------|
// Extern Functions |
//
//=========================================================
// POSIX extensions.
//
//
// fmemopen
//
FILE *fmemopen(void *buf, size_t size, char const *mode)
{
cookie_io_functions_t io_funcs =
{
.read = FILE_fn_mem_read,
.write = FILE_fn_mem_write,
.seek = FILE_fn_mem_seek,
.close = NULL,
};
FILE *stream = malloc(sizeof(FILE) + BUFSIZ + sizeof(__cookie_mem));
if(!stream) return NULL;
char *buffer = (char *)(stream + 1);
__cookie_mem *cookie = (__cookie_mem *)(buffer + BUFSIZ);
cookie->mem = buf;
cookie->len = size;
cookie->pos = 0;
if(!__fopencookie_ctor(stream, cookie, mode, io_funcs))
return free(stream), NULL;
stream->_flag |= _FILEFLAG_FRF;
setvbuf(stream, buffer, _IOFBF, BUFSIZ);
return stream;
}
//
// open_memstream
//
FILE *open_memstream(char **ptr, size_t *sizeloc)
{
cookie_io_functions_t io_funcs =
{
.read = FILE_fn_mem_read_rea,
.write = FILE_fn_mem_write_rea,
.seek = FILE_fn_mem_seek_rea,
.close = FILE_fn_mem_close_rea,
};
FILE *stream = malloc(sizeof(FILE) + BUFSIZ + sizeof(__cookie_mem_rea));
if(!stream) return NULL;
char *buffer = (char *)(stream + 1);
__cookie_mem_rea *cookie = (__cookie_mem_rea *)(buffer + BUFSIZ);
*(cookie->mem_p = ptr) = NULL;
*(cookie->pos_p = sizeloc) = 0;
cookie->mem = NULL;
cookie->len = 0;
cookie->pos = 0;
if(!__fopencookie_ctor(stream, cookie, "w+", io_funcs))
return free(stream), NULL;
stream->_flag |= _FILEFLAG_FRF;
setvbuf(stream, buffer, _IOFBF, BUFSIZ);
return stream;
}
//=========================================================
// Implementation extensions.
//
//
// __fmemopen_sta_r
//
FILE *__fmemopen_sta_r(char const *buf, size_t size)
{
Cookie_mem.mem = (char *)buf;
Cookie_mem.len = size;
Cookie_mem.pos = 0;
__memfile._fn.read = FILE_fn_mem_read;
__memfile._fn.write = NULL;
__memfile._fn.seek = FILE_fn_mem_seek;
__memfile._fn.close = NULL;
__memfile._get._buf = Buffer_memfile;
__memfile._get._ptr = Buffer_memfile;
__memfile._get._end = Buffer_memfile;
__memfile._get._len = sizeof(Buffer_memfile);
__memfile._put._buf = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._ptr = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._end = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._len = 0;
__memfile._cookie = &Cookie_mem;
__memfile._flag = 0;
return &__memfile;
}
//
// __fmemopen_sta_r_str
//
FILE *__fmemopen_sta_r_str(char __str_ars const *buf, size_t size)
{
Cookie_mem_str.mem = (char __str_ars *)buf;
Cookie_mem_str.len = size;
Cookie_mem_str.pos = 0;
__memfile._fn.read = FILE_fn_mem_read_str;
__memfile._fn.write = NULL;
__memfile._fn.seek = FILE_fn_mem_seek_str;
__memfile._fn.close = NULL;
__memfile._get._buf = Buffer_memfile;
__memfile._get._ptr = Buffer_memfile;
__memfile._get._end = Buffer_memfile;
__memfile._get._len = sizeof(Buffer_memfile);
__memfile._put._buf = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._ptr = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._end = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._len = 0;
__memfile._cookie = &Cookie_mem_str;
__memfile._flag = 0;
return &__memfile;
}
//
// __fmemopen_sta_w
//
FILE *__fmemopen_sta_w(char *buf, size_t size)
{
Cookie_mem.mem = buf;
Cookie_mem.pos = 0;
Cookie_mem.len = size;
__memfile._fn.read = NULL;
__memfile._fn.write = FILE_fn_mem_write_sta;
__memfile._fn.seek = FILE_fn_mem_seek;
__memfile._fn.close = NULL;
__memfile._get._buf = Buffer_memfile;
__memfile._get._ptr = Buffer_memfile;
__memfile._get._end = Buffer_memfile;
__memfile._get._len = 0;
__memfile._put._buf = Buffer_memfile;
__memfile._put._ptr = Buffer_memfile;
__memfile._put._end = Buffer_memfile + sizeof(Buffer_memfile);
__memfile._put._len = sizeof(Buffer_memfile);
__memfile._cookie = &Cookie_mem;
__memfile._flag = 0;
return &__memfile;
}
//
// __fmemopen_str
//
FILE *__fmemopen_str(char __str_ars *buf, size_t size, char const *mode)
{
cookie_io_functions_t io_funcs =
{
.read = FILE_fn_mem_read_str,
.write = NULL,
.seek = FILE_fn_mem_seek_str,
.close = NULL,
};
FILE *stream = malloc(sizeof(FILE) + BUFSIZ + sizeof(__cookie_mem_str));
if(!stream) return NULL;
char *buffer = (char *)(stream + 1);
__cookie_mem_str *cookie = (__cookie_mem_str *)(buffer + BUFSIZ);
cookie->mem = buf;
cookie->len = size;
cookie->pos = 0;
if(!__fopencookie_ctor(stream, cookie, mode, io_funcs))
return free(stream), NULL;
stream->_flag |= _FILEFLAG_FRF;
setvbuf(stream, buffer, _IOFBF, BUFSIZ);
return stream;
}
// EOF

View file

@ -1,633 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2016-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Input/output.
//
// File access functions.
//
//-----------------------------------------------------------------------------
#define __GDCC__DirectObject
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <GDCC.h>
#if __GDCC_Family__ZDACS__
#include <ACS_ZDoom.h>
#endif
#if __GDCC_Engine__Doominati__
#include <Doominati.h>
#endif
//----------------------------------------------------------------------------|
// Types |
//
//
// __cookie_file
//
typedef struct __cookie_file
{
#if __GDCC_Engine__Doominati__
unsigned int fd;
unsigned long pos;
#else
int pos;
#endif
} __cookie_file;
//----------------------------------------------------------------------------|
// Static Prototypes |
//
static int FILE_fn_file_close(void *cookie);
static ssize_t FILE_fn_file_read(void *cookie, char *buf, size_t size);
static ssize_t FILE_fn_file_write(void *cookie, char const *buf, size_t size);
static int FILE_fn_file_seek(void *cookie, off_t *offset, int whence);
static ssize_t FILE_fn_stdin_read(void *cookie, char *buf, size_t size);
static ssize_t FILE_fn_stdout_write(void *cookie, char const *buf, size_t size);
//----------------------------------------------------------------------------|
// Static Objects |
//
[[no_init]]
static char Buffer_stderr[BUFSIZ];
[[no_init]]
static char Buffer_stdin[BUFSIZ];
[[no_init]]
static char Buffer_stdout[BUFSIZ];
//----------------------------------------------------------------------------|
// Extern Objects |
//
//
// __stderr
//
FILE __stderr =
{
{
.read = NULL,
.write = FILE_fn_stdout_write,
.seek = NULL,
.close = NULL,
},
{Buffer_stderr, Buffer_stderr, Buffer_stderr, 0},
{Buffer_stderr, Buffer_stderr, Buffer_stderr + sizeof(Buffer_stderr), sizeof(Buffer_stderr)},
NULL, _FILEFLAG_LBF
};
//
// __stdin
//
FILE __stdin =
{
{
.read = FILE_fn_stdin_read,
.write = NULL,
.seek = NULL,
.close = NULL,
},
{Buffer_stdin, Buffer_stdin, Buffer_stdin, 0},
{Buffer_stdin, Buffer_stdin, Buffer_stdin + sizeof(Buffer_stdin), sizeof(Buffer_stdin)},
NULL, 0
};
//
// __stdout
//
FILE __stdout =
{
{
.read = NULL,
.write = FILE_fn_stdout_write,
.seek = NULL,
.close = NULL,
},
{Buffer_stdout, Buffer_stdout, Buffer_stdout, 0},
{Buffer_stdout, Buffer_stdout, Buffer_stdout + sizeof(Buffer_stdout), sizeof(Buffer_stdout)},
NULL, _FILEFLAG_LBF
};
//----------------------------------------------------------------------------|
// Static Functions |
//
//=========================================================
// file functions
//
//
// FILE_fn_file_close
//
static int FILE_fn_file_close(void *cookie_)
{
__cookie_file *cookie = cookie_;
#if __GDCC_Engine__Doominati__
DGE_File_Close(cookie->fd);
#endif
return 0;
}
//
// FILE_fn_file_read
//
static ssize_t FILE_fn_file_read(void *cookie_, char *buf, size_t size)
{
__cookie_file *cookie = cookie_;
#if __GDCC_Engine__Doominati__
int read = DGE_File_Read(cookie->fd, cookie->pos, buf, size);
if(read < 0)
return EOF;
cookie->pos += read;
return read;
#else
return 0;
#endif
}
//
// FILE_fn_file_write
//
static ssize_t FILE_fn_file_write(void *cookie_, char const *buf, size_t size)
{
__cookie_file *cookie = cookie_;
return 0;
}
//
// FILE_fn_file_seek
//
static int FILE_fn_file_seek(void *cookie_, off_t *offset, int whence)
{
__cookie_file *cookie = cookie_;
#if __GDCC_Engine__Doominati__
switch(whence)
{
case SEEK_END:
*offset = cookie->pos = DGE_File_Size(cookie->fd) - *offset;
break;
case SEEK_CUR:
*offset = cookie->pos += *offset;
break;
case SEEK_SET:
cookie->pos = *offset;
break;
}
return 0;
#else
return EOF;
#endif
}
//=========================================================
// stdin functions.
//
//
// FILE_fn_stdin_read
//
static ssize_t FILE_fn_stdin_read(void *cookie, char *buf, size_t size)
{
#if __GDCC_Engine__Doominati__
int res;
while((res = DGE_Shell_ReadStd(0, buf, size)) == 0)
DGE_Task_Sleep(0, 1);
return res;
#else
return 0;
#endif
}
//=========================================================
// stdout functions.
//
//
// FILE_fn_stdout_write
//
static ssize_t FILE_fn_stdout_write(void *cookie, char const *buf, size_t size)
{
#if __GDCC_Family__ZDACS__
ACS_BeginPrint();
if(buf[size - 1] == '\n')
ACS_PrintGlobalCharRange((int)buf, __GDCC__Sta, 0, size - 1);
else
ACS_PrintGlobalCharRange((int)buf, __GDCC__Sta, 0, size);
ACS_EndLog();
return size;
#elif __GDCC_Engine__Doominati__
return DGE_Shell_WriteStd(0, buf, size);
#else
return 0;
#endif
}
//----------------------------------------------------------------------------|
// Extern Functions |
//
//=========================================================
// File access functions.
//
//
// fclose
//
int fclose(FILE *stream)
{
int res = 0;
if(fflush(stream) == EOF)
res = EOF;
if(stream->_fn.close && stream->_fn.close(stream->_cookie) == EOF)
res = EOF;
if(stream->_flag & _FILEFLAG_FRB)
free(stream->_get._buf);
if(stream->_flag & _FILEFLAG_FRC)
free(stream->_cookie);
if(stream->_flag & _FILEFLAG_FRF)
free(stream);
return res;
}
//
// fflush
//
int fflush(FILE *stream)
{
size_t len;
if(stream->_flag & _FILEFLAG_ERR)
return EOF;
// Flush get buffer by ungetting read buffer.
len = stream->_get._end - stream->_get._ptr;
if(len && stream->_fn.read)
{
if(!stream->_fn.seek)
return stream->_flag |= _FILEFLAG_ERR, EOF;
off_t off = -(off_t)len;
ssize_t res = stream->_fn.seek(stream->_cookie, &off, SEEK_CUR);
if(res == EOF) return stream->_flag |= _FILEFLAG_ERR, EOF;
stream->_get._end = stream->_get._ptr;
}
// Flush put buffer by writing it.
len = stream->_put._ptr - stream->_put._buf;
if(len && stream->_fn.write)
{
ssize_t res = stream->_fn.write(stream->_cookie, stream->_put._buf, len);
if(res != len) return stream->_flag |= _FILEFLAG_ERR, EOF;
stream->_put._ptr = stream->_put._buf;
}
return 0;
}
//
// fopen
//
FILE *fopen(char const *restrict filename, char const *restrict mode)
{
cookie_io_functions_t io_funcs =
{
.read = FILE_fn_file_read,
.write = FILE_fn_file_write,
.seek = FILE_fn_file_seek,
.close = FILE_fn_file_close,
};
#if __GDCC_Engine__Doominati__
int fd;
if(*mode == 'r')
{
if((fd = DGE_File_Open(filename)) == -1)
return NULL;
}
else
return NULL;
FILE *stream = malloc(sizeof(FILE) + sizeof(__cookie_file) + BUFSIZ);
if(!stream) return DGE_File_Close(fd), NULL;
__cookie_file *cookie = (__cookie_file *)(stream + 1);
char *buffer = (char *)(cookie + 1);
cookie->fd = fd;
cookie->pos = 0;
if(!__fopencookie_ctor(stream, cookie, mode, io_funcs))
return free(stream), DGE_File_Close(fd), NULL;
stream->_flag |= _FILEFLAG_FRF;
setvbuf(stream, buffer, _IOFBF, BUFSIZ);
return stream;
#else
return NULL;
#endif
}
//
// freopen
//
FILE *freopen(char const *restrict filename, char const *restrict mode,
FILE *restrict stream)
{
return NULL;
}
//
// setbuf
//
void setbuf(FILE *restrict stream, char *restrict buf)
{
if(buf)
setvbuf(stream, buf, _IOFBF, BUFSIZ);
else
setvbuf(stream, buf, _IONBF, 0);
}
//
// setvbuf
//
int setvbuf(FILE *restrict stream, char *restrict buf, int mode, size_t size)
{
bool alloc = false;
if(mode == _IOFBF || mode == _IOLBF)
{
// Allocate buffer.
if(!buf)
alloc = true;
// Fuck off.
if(size < 4)
return EOF;
}
else if(mode == _IONBF)
{
// Discard passed buffer data for unbuffered mode.
buf = NULL;
size = 0;
}
else
{
// Invalid mode.
errno = EINVAL;
return EOF;
}
size_t getUsed = stream->_get._end - stream->_get._ptr;
size_t putUsed = stream->_put._ptr - stream->_put._buf;
// Divide buffer as needed.
size_t getSize, putSize;
if(stream->_fn.write)
{
if(stream->_fn.read)
{
getSize = size / 2;
putSize = size - getSize;
}
else
{
getSize = 0;
putSize = size;
}
}
else
{
if(stream->_fn.read)
{
getSize = size;
putSize = 0;
}
else
{
return EOF;
}
}
// Line-buffered writes need a reserved byte.
if(mode == _IOLBF && stream->_fn.write)
--putSize;
// Check that new buffer large enough for existing contents.
if(getUsed > getSize || putUsed > putSize)
return EOF;
// Allocate new buffer, if needed.
if(alloc)
{
if(!(buf = malloc(size)))
return EOF;
}
// Transfer buffer contents.
memcpy(buf, stream->_get._ptr, getUsed);
memcpy(buf + getSize, stream->_put._buf, putUsed);
// Free old buffer, if needed.
if(stream->_flag & _FILEFLAG_FRB)
{
free(stream->_get._buf);
stream->_flag &= ~_FILEFLAG_FRB;
}
// Set buffers.
stream->_get._buf = buf;
stream->_get._ptr = buf;
stream->_get._end = buf + getUsed;
stream->_get._len = getSize;
stream->_put._buf = buf + getSize;
stream->_put._ptr = buf + getSize + putUsed;
stream->_put._end = buf + getSize + putSize;
stream->_put._len = putSize;
// Set free buffer flag.
if(alloc)
stream->_flag |= _FILEFLAG_FRB;
// Set linebuffer flag.
if(mode == _IOLBF)
stream->_flag |= _FILEFLAG_LBF;
else
stream->_flag &= ~_FILEFLAG_LBF;
return 0;
}
//=========================================================
// GNU extensions.
//
//
// fopencookie
//
FILE *fopencookie(void *cookie, char const *mode, cookie_io_functions_t io_funcs)
{
FILE *stream = malloc(sizeof(FILE) + BUFSIZ);
if(!stream) return NULL;
if(!__fopencookie_ctor(stream, cookie, mode, io_funcs))
return free(stream), NULL;
stream->_flag |= _FILEFLAG_FRF;
setvbuf(stream, (char *)(stream + 1), _IOFBF, BUFSIZ);
return stream;
}
//=========================================================
// Implementation extensions.
//
//
// __fopencookie_ctor
//
FILE *__fopencookie_ctor(FILE *stream, void *cookie, char const *mode,
cookie_io_functions_t io_funcs)
{
// Init members.
stream->_fn = io_funcs;
stream->_get._buf = NULL;
stream->_get._ptr = NULL;
stream->_get._end = NULL;
stream->_get._len = 0;
stream->_put._buf = NULL;
stream->_put._ptr = NULL;
stream->_put._end = NULL;
stream->_put._len = 0;
stream->_cookie = cookie;
stream->_flag = 0;
// Parse mode string.
char modeBase = *mode++;
// Ignore binary mode flag.
if(*mode == 'b') ++mode;
// Check + mode flag.
_Bool modePlus = *mode == '+';
if(modePlus)
++mode;
// Must be at end of mode string.
if(*mode)
return errno = EINVAL, NULL;
switch(modeBase)
{
case 'r':
if(!modePlus)
stream->_fn.write = NULL;
break;
case 'w':
if(!modePlus)
stream->_fn.read = NULL;
break;
case 'a':
if(!modePlus)
stream->_fn.read = NULL;
// Seek to stream end.
if(!stream->_fn.seek)
return errno = EINVAL, NULL;
if(stream->_fn.seek(stream->_cookie, &(off_t){0}, SEEK_END) == -1)
return NULL;
break;
default:
return NULL;
}
return stream;
}
//
// __get_stderr
//
FILE *__get_stderr(void)
{
return &__stderr;
}
//
// __get_stdin
//
FILE *__get_stdin(void)
{
return &__stdin;
}
//
// __get_stdout
//
FILE *__get_stdout(void)
{
return &__stdout;
}
// EOF

View file

@ -1,681 +0,0 @@
//-----------------------------------------------------------------------------
//
// Copyright(C) 2014-2019 David Hill
//
// See COPYLIB for license information.
//
//-----------------------------------------------------------------------------
//
// Number to string formatting functions.
//
//-----------------------------------------------------------------------------
#include <GDCC_libc.h>
//----------------------------------------------------------------------------|
// Macros |
//
//
// FormatFixCoreD
//
#define FormatFixCoreD(T, op) \
/* Perform core conversion. */ \
FormatFixCoreDI(T, op); \
FormatFixCoreDF(T, op); \
\
ret._len = ret._end - ret._begin;
//
// FormatFixCoreDF
//
#define FormatFixCoreDF(T, op) \
/* Fractional conversion. */ \
if(format._prec) \
{ \
*ret._end++ = '.'; \
\
unsigned precDigs = format._prec; \
\
FormatFixCoreDFLoop_##op(T); \
\
for(; precDigs; --precDigs) \
*ret._end++ = '0'; \
} \
else if(format._flags & __GDCC__FormatFlag_AltF) \
*ret._end++ = '.';
//
// FormatFixCoreDFLoop_k
//
#if __GDCC_Family__ZDACS__
#define FormatFixCoreDFLoop_k(T) \
for(union {T _Accum k; T int i;} u = {data}; u.i && precDigs; --precDigs) \
{ \
u.i &= 0xFFFF; \
u.i *= 10; \
*ret._end++ = (u.i >> 16) + '0'; \
}
#else
#define FormatFixCoreDFLoop_k(T) \
for(T _Accum k = data; k && precDigs; --precDigs) \
{ \
k -= (T FormatTypeInt_k)k; \
k *= 10; \
*ret._end++ = (int)k + '0'; \
}
#endif
//
// FormatFixCoreDFLoop_kh
//
#if __GDCC_Family__ZDACS__
#define FormatFixCoreDFLoop_kh(T) FormatFixCoreDFLoop_k(T)
#else
#define FormatFixCoreDFLoop_kh(T) \
for(T short _Accum k = data; k && precDigs; --precDigs) \
{ \
k -= (T FormatTypeInt_kh)k; \
k *= 10; \
*ret._end++ = (int)k + '0'; \
}
#endif
//
// FormatFixCoreDFLoop_kl
//
#if __GDCC_Family__ZDACS__
#define FormatFixCoreDFLoop_kl(T) \
for(union {T long _Accum k; T int i;} u = {data}; u.i && precDigs; --precDigs) \
{ \
*ret._end++ = ((int)(((unsigned)u.i >> 24) * 10) >> 8) + '0'; \
u.i *= 10; \
}
#else
#define FormatFixCoreDFLoop_kl(T) \
for(T long _Accum k = data; k && precDigs; --precDigs) \
{ \
k -= (T FormatTypeInt_kl)k; \
k *= 10; \
*ret._end++ = (int)k + '0'; \
}
#endif
//
// FormatFixCoreDI
//
#define FormatFixCoreDI(T, op) \
/* Integral conversion. */ \
for(T FormatTypeInt_##op int i = data; i;) \
{ \
T FormatTypeInt_##op __div_t d = __div(i, 10); \
*--ret._begin = d.rem + '0'; \
i = d.quot; \
} \
\
if(ret._begin == ret._end && \
(format._prec || !(format._flags & __GDCC__FormatFlag_AltF))) \
*--ret._begin = '0';
//
// FormatFixPreS
//
#define FormatFixPreS() \
__GDCC__FormatRet ret; \
ret._begin = ret._end = __GDCC__FormatBufMid; \
\
if(format._prec == -1) format._prec = 6; \
\
char sign; \
if(data < 0) \
{ \
sign = '-'; \
data = -data; \
} \
else if(format._flags & __GDCC__FormatFlag_Sign) \
sign = '+'; \
else if(format._flags & __GDCC__FormatFlag_PadS) \
sign = ' '; \
else \
sign = '\0';
//
// FormatFixPreU
//
#define FormatFixPreU() \
__GDCC__FormatRet ret; \
ret._begin = ret._end = __GDCC__FormatBufMid; \
\
if(format._prec == -1) format._prec = 6; \
\
char const sign = '\0';
//
// FormatFixWidth
//
#define FormatFixWidth() \
/* Pad to width. */ \
if(format._flags & __GDCC__FormatFlag_Pad0 && \
!(format._flags & __GDCC__FormatFlag_Left)) \
{ \
if(sign && format._width) --format._width; \
\
while(ret._len < format._width) \
*--ret._begin = '0', ++ret._len; \
}
//
// FormatIntAltB
//
#define FormatIntAltB(c) \
if(format._flags & __GDCC__FormatFlag_AltF) \
{ \
*--ret._begin = (c); \
*--ret._begin = '0'; \
\
if(!(format._flags & __GDCC__FormatFlag_Pad0) || \
format._flags & __GDCC__FormatFlag_Left) \
{ \
ret._len += 2; \
} \
}
//
// FormatIntAltX
//
#define FormatIntAltX(c) \
if(format._flags & __GDCC__FormatFlag_AltF) \
{ \
*--ret._begin = (c); \
*--ret._begin = '0'; \
\
if(!(format._flags & __GDCC__FormatFlag_Pad0) || \
format._flags & __GDCC__FormatFlag_Left) \
{ \
ret._len += 2; \
} \
}
//
// FormatIntCoreB
//
#define FormatIntCoreB() \
/* Perform core conversion. */ \
for(; data; data >>= 1) \
*--ret._begin = ((int)data & 1) + '0'; \
\
ret._len = ret._end - ret._begin; \
\
if(format._flags & __GDCC__FormatFlag_AltF && \
format._flags & __GDCC__FormatFlag_Pad0 && \
!(format._flags & __GDCC__FormatFlag_Left)) \
{ \
ret._len += 2; \
}
//
// FormatIntCoreD
//
#define FormatIntCoreD(T) \
/* Perform core conversion. */ \
while(data) \
{ \
T __div_t d = __div(data, 10); \
*--ret._begin = (int)d.rem + '0'; \
data = d.quot; \
} \
\
ret._len = ret._end - ret._begin;
//
// FormatIntCoreO
//
#define FormatIntCoreO() \
/* Perform core conversion. */ \
for(; data; data >>= 3) \
*--ret._begin = ((int)data & 7) + '0'; \
\
if(format._flags & __GDCC__FormatFlag_AltF) \
{ \
if(ret._begin == ret._end || *ret._begin != '0') \
*--ret._begin = '0'; \
} \
\
ret._len = ret._end - ret._begin;
//
// FormatIntCoreX
//
#define FormatIntCoreX(table) \
/* Perform core conversion. */ \
for(; data; data >>= 4) \
*--ret._begin = table[(int)data & 0xF]; \
\
ret._len = ret._end - ret._begin; \
\
if(format._flags & __GDCC__FormatFlag_AltF && \
format._flags & __GDCC__FormatFlag_Pad0 && \
!(format._flags & __GDCC__FormatFlag_Left)) \
{ \
ret._len += 2; \
}
//
// FormatIntPreS
//
#define FormatIntPreS() \
__GDCC__FormatRet ret; \
ret._begin = ret._end = __GDCC__FormatBufMid; \
\
char sign; \
if(data < 0) \
{ \
sign = '-'; \
data = -data; \
} \
else if(format._flags & __GDCC__FormatFlag_Sign) \
sign = '+'; \
else if(format._flags & __GDCC__FormatFlag_PadS) \
sign = ' '; \
else \
sign = '\0';
//
// FormatIntPreU
//
#define FormatIntPreU() \
__GDCC__FormatRet ret; \
ret._begin = ret._end = __GDCC__FormatBufMid; \
\
char const sign = '\0';
//
// FormatIntPrec
//
#define FormatIntPrec() \
/* Pad to precision. */ \
if(format._prec == -1) \
{ \
if(!ret._len) \
*--ret._begin = '0', ret._len = 1; \
\
/* When padding to width with 0, use width as precision. */ \
if(format._flags & __GDCC__FormatFlag_Pad0 && \
!(format._flags & __GDCC__FormatFlag_Left)) \
{ \
if(sign && format._width) --format._width; \
\
while(ret._len < format._width) \
*--ret._begin = '0', ++ret._len; \
} \
} \
else \
{ \
while(ret._len < format._prec) \
*--ret._begin = '0', ++ret._len; \
}
//
// FormatIntSign
//
#define FormatIntSign() \
if(sign) *--ret._begin = sign, ++ret._len;
//
// FormatTypeInt_k
//
#if __GDCC_Engine__Doominati__
#define FormatTypeInt_k long
#else
#define FormatTypeInt_k
#endif
//
// FormatTypeInt_kh
//
#define FormatTypeInt_kh
//
// FormatTypeInt_kl
//
#if __GDCC_Engine__Doominati__
#define FormatTypeInt_kl long
#else
#define FormatTypeInt_kl long
#endif
//----------------------------------------------------------------------------|
// Static Objects |
//
static char const HexTableL[16] = "0123456789abcdef";
static char const HexTableU[16] = "0123456789ABCDEF";
//----------------------------------------------------------------------------|
// Extern Objects |
//
[[no_init]]
char __GDCC__FormatBuf[__GDCC__FormatBufLen];
//----------------------------------------------------------------------------|
// Extern Functions |
//
//
// __GDCC__FormatI_d
//
__GDCC__FormatDefn(I, d, int)
{
FormatIntPreS();
FormatIntCoreD(signed);
FormatIntPrec();
FormatIntSign();
return ret;
}
//
// __GDCC__FormatI_dl
//
__GDCC__FormatDefn(I, dl, long int)
{
FormatIntPreS();
FormatIntCoreD(long signed);
FormatIntPrec();
FormatIntSign();
return ret;
}
//
// __GDCC__FormatI_dll
//
__GDCC__FormatDefn(I, dll, long long int)
{
FormatIntPreS();
FormatIntCoreD(long long signed);
FormatIntPrec();
FormatIntSign();
return ret;
}
//
// __GDCC__FormatK_d
//
__GDCC__FormatDefn(K, d, _Accum)
{
FormatFixPreU();
FormatFixCoreD(unsigned, k);
FormatFixWidth();
return ret;
}
//
// __GDCC__FormatK_dh
//
__GDCC__FormatDefn(K, dh, short _Accum)
{
FormatFixPreU();
FormatFixCoreD(unsigned, kh);
FormatFixWidth();
return ret;
}
//
// __GDCC__FormatK_dl
//
__GDCC__FormatDefn(K, dl, long _Accum)
{
FormatFixPreU();
FormatFixCoreD(unsigned, kl);
FormatFixWidth();
return ret;
}
//
// __GDCC__FormatU_X
//
__GDCC__FormatDefn(U, X, unsigned)
{
FormatIntPreU();
FormatIntCoreX(HexTableU);
FormatIntPrec();
FormatIntAltX('X');
return ret;
}
//
// __GDCC__FormatU_Xl
//
__GDCC__FormatDefn(U, Xl, long unsigned)
{
FormatIntPreU();
FormatIntCoreX(HexTableU);
FormatIntPrec();
FormatIntAltX('X');
return ret;
}
//
// __GDCC__FormatU_Xll
//
__GDCC__FormatDefn(U, Xll, long long unsigned)
{
FormatIntPreU();
FormatIntCoreX(HexTableU);
FormatIntPrec();
FormatIntAltX('X');
return ret;
}
//
// __GDCC__FormatU_b
//
__GDCC__FormatDefn(U, b, unsigned)
{
FormatIntPreU();
FormatIntCoreB();
FormatIntPrec();
FormatIntAltB('b');
return ret;
}
//
// __GDCC__FormatU_bl
//
__GDCC__FormatDefn(U, bl, long unsigned)
{
FormatIntPreU();
FormatIntCoreB();
FormatIntPrec();
FormatIntAltB('b');
return ret;
}
//
// __GDCC__FormatU_bll
//
__GDCC__FormatDefn(U, bll, long long unsigned)
{
FormatIntPreU();
FormatIntCoreB();
FormatIntPrec();
FormatIntAltB('b');
return ret;
}
//
// __GDCC__FormatU_d
//
__GDCC__FormatDefn(U, d, unsigned)
{
FormatIntPreU();
FormatIntCoreD(unsigned);
FormatIntPrec();
return ret;
}
//
// __GDCC__FormatU_dl
//
__GDCC__FormatDefn(U, dl, long unsigned)
{
FormatIntPreU();
FormatIntCoreD(long unsigned);
FormatIntPrec();
return ret;
}
//
// __GDCC__FormatU_dll
//
__GDCC__FormatDefn(U, dll, long long unsigned)
{
FormatIntPreU();
FormatIntCoreD(long long unsigned);
FormatIntPrec();
return ret;
}
//
// __GDCC__FormatU_o
//
__GDCC__FormatDefn(U, o, unsigned)
{
FormatIntPreU();
FormatIntCoreO();
FormatIntPrec();
return ret;
}
//
// __GDCC__FormatU_ol
//
__GDCC__FormatDefn(U, ol, long unsigned)
{
FormatIntPreU();
FormatIntCoreO();
FormatIntPrec();
return ret;
}
//
// __GDCC__FormatU_oll
//
__GDCC__FormatDefn(U, oll, long long unsigned)
{
FormatIntPreU();
FormatIntCoreO();
FormatIntPrec();
return ret;
}
//
// __GDCC__FormatU_x
//
__GDCC__FormatDefn(U, x, unsigned)
{
FormatIntPreU();
FormatIntCoreX(HexTableL);
FormatIntPrec();
FormatIntAltX('x');
return ret;
}
//
// __GDCC__FormatU_xl
//
__GDCC__FormatDefn(U, xl, long unsigned)
{
FormatIntPreU();
FormatIntCoreX(HexTableL);
FormatIntPrec();
FormatIntAltX('x');
return ret;
}
//
// __GDCC__FormatU_xll
//
__GDCC__FormatDefn(U, xll, long long unsigned)
{
FormatIntPreU();
FormatIntCoreX(HexTableL);
FormatIntPrec();
FormatIntAltX('x');
return ret;
}
//
// __GDCC__FormatX_d
//
__GDCC__FormatDefn(X, d, _Accum)
{
FormatFixPreS();
FormatFixCoreD(signed, k);
FormatFixWidth();
FormatIntSign();
return ret;
}
//
// __GDCC__FormatX_dh
//
__GDCC__FormatDefn(X, dh, short _Accum)
{
FormatFixPreS();
FormatFixCoreD(signed, kh);
FormatFixWidth();
FormatIntSign();
return ret;
}
//
// __GDCC__FormatX_dl
//
__GDCC__FormatDefn(X, dl, long _Accum)
{
FormatFixPreS();
FormatFixCoreD(signed, kl);
FormatFixWidth();
FormatIntSign();
return ret;
}
//
// __GDCC__GetFormatBuf
//
char __sta *__GDCC__GetFormatBuf(void)
{
return __GDCC__FormatBuf;
}
// EOF

Some files were not shown because too many files have changed in this diff Show more