Compare commits

...
302 Commits
v2 ... v4
Author SHA1 Message Date
Alug ee2bc85fe7 v4 2023-10-31 11:02:12 +01:00
alufolie91 9b3bfaabad Merge remote-tracking branch 'origin/Saturn-Next' into Saturn 2023-10-31 11:01:00 +01:00
alufolie91 3f8a227769 comment that out for now
we dont use it yet, so lets not make compiler cry about smth unused
2023-10-30 20:59:38 +01:00
indev 7993df1be7 Merge branch 'Saturn-Next' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2023-10-30 12:36:23 +03:00
indev f2b0b8359e Add description for custom lua features 2023-10-30 12:35:57 +03:00
alufolie91 7d7c053fc1 Revert "more sprite rotation anlges = smoother sprite rotation"
This reverts commit 0921eb57c4792fc5cb2b120de04d8905513ae75c.
2023-10-30 08:19:55 +01:00
alufolie91 25398af8f5 add toggle for dark itembox bg
some may dislike how it looks with the colour hud
2023-10-27 18:54:53 +02:00
alufolie91 c98971953c Merge remote-tracking branch 'ball/colorizeditembox' into Saturn-Next 2023-10-26 02:08:11 +02:00
alufolie91 d9739755ce Merge remote-tracking branch 'origin/command-history' into Saturn-Next 2023-10-26 02:07:43 +02:00
NepDisk 895bd2da15 Made this a menu option anyway lololololol 2023-10-25 19:57:46 -04:00
NepDisk 8950e31f4c Colorized Itembox 2023-10-25 19:26:34 -04:00
indev 601928f49f Only add command to history if it differs from previous one 2023-10-24 20:57:42 +03:00
alufolie91 773e243c88 ugh make that save lol 2023-10-23 15:34:38 +02:00
indev 311f3a6cf4 Merge branch 'Saturn-Next' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2023-10-22 13:00:05 +03:00
NepDisk fed1b23b8b Port Prevent dropped ticcmds due to interp timing jutter from srb2-next 2023-10-22 12:01:14 +02:00
indev 5c2d8f6901 Fix characters with SF_HIRES flag being displayed too big in grid skin select menu 2023-10-22 12:59:25 +03:00
alufolie91 68b88e40b5 smol change 2023-10-21 15:44:38 +02:00
alufolie91 6f3770a54a update the credits and menu
add ppl to credits, and just have less seperation between the ppl that contributed to saturn
move flashpal setting to opengl options
2023-10-21 12:57:55 +02:00
alufolie91 eaf2506b4f almost forgor
respect the menu caps choice
2023-10-21 12:24:12 +02:00
alufolie91 2cec4c8b52 add M_DrawGenericScrollMenu
will most likely need this since saturn menu esp is starting to fill up
2023-10-21 12:12:35 +02:00
alufolie91 7ebccc19db fixuer de typo 2023-10-21 12:06:43 +02:00
alufolie91 797d080df0 Join last server button in multiplayer menu (thx nep c:)
from:  https://github.com/NepDisk/srb2k-planeptune/commit/3f42ca357e16702a47a1197a738d92741b38950f

also now finally works with server browser
2023-10-21 11:42:19 +02:00
alufolie91 7c6b03145d uncap water effects
also caps software heatwave effect since it was sped up with interp

note : waterofs was left out, due to it producing stutters on water surfaces in softwaremode
2023-10-21 03:20:23 +02:00
alufolie91 7b136a62c4 revert this part
well with how some kart mapss are set up, this doesent work out
2023-10-21 03:05:30 +02:00
alufolie91 fec433372d clean up shader stuff a bit
Makes the game not "hard crash" when it fails to compile shaders
Fixes issues with shader leveltime
also fixes an issue where certain textures were blurred with shaders enables
2023-10-21 02:49:14 +02:00
alufolie91 41a827727d Merge remote-tracking branch 'origin/fix-bool-types-w-checkmultiplewads' into Saturn-Next 2023-10-20 22:19:35 +02:00
indev bfd0f0c7c2 Fix wrong boolean constants used in W_CheckMultipleWads. That was causing compilation error on linux, and maybe on other non windows platforms 2023-10-20 15:38:53 +03:00
alufolie91 21c9ae8f7e revert this again
despite what kk says, opengl sdl render hint is so much worse performancewise in software mode.
some of the feedback we´ve gotten on saturn also more or less confirms this
2023-10-20 08:09:07 +02:00
alufolie91 581b503edf Uncap palette lump palettes & allow flashpal palettes to display during pause 2023-10-20 07:45:00 +02:00
alufolie91 d380391d80 Clean up the backtrace code and make it use write() more safely. 2023-10-19 11:15:03 +02:00
alufolie91 ff41393edd Fix segfaults on some systems due to polyvertex being NULL
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2065
2023-10-19 10:46:30 +02:00
alufolie91 654784690e we dont have asm stuff 2023-10-19 10:12:32 +02:00
alufolie91 cd682e3961 Avoid branch prediction slowdowns in bla bla but better
i hope
2023-10-19 09:39:35 +02:00
alufolie91 cd4482dd97 Merge remote-tracking branch 'sdfadfsa/gitlab-ci' into Saturn-Next 2023-10-18 15:11:56 +02:00
hayaunderscore 6eb96a4992 clean up extra.kart and extra2.kart lump checking 2023-10-18 15:03:53 +02:00
Alam Ed Arias 3c3c59928d Makefile: support for Mingw64 toolchain 2023-10-18 00:02:17 -04:00
Alam Ed Arias 01911e4d37 Clear unused-but-set-variable warnings 2023-10-18 00:02:17 -04:00
Alam Ed Arias 37c65ca7e4 Makefile: PREFIX overwrite make's default CC and CXX 2023-10-17 23:14:09 -04:00
Alam Ed Arias cb4ffe6f60 no Dr. Mingw support for Win x64 build 2023-10-17 23:12:14 -04:00
Alam Ed Arias 98f8b49e45 Makefile: support toolchain envs 2023-10-17 22:36:17 -04:00
Alam Ed Arias bf6be522ea GitLib CI: SRB2 2.1 codebase use WFLAGS to control warning flags 2023-10-17 21:46:56 -04:00
Alam Ed Arias 2365ee9cb0 GitLab CI: SRB2 2.1 wants nasm 2023-10-17 21:46:56 -04:00
Alam Ed Arias 16c70e7b29 GitLab CI: Compile the SDL version of Win32 builds 2023-10-17 21:46:37 -04:00
Alam Ed Arias 46f0385566 d_netfile.c: Update libcurl support to 7.88 2023-10-17 21:45:47 -04:00
Alam Ed Arias 579c5ab052 Makefile: Support GCC version 11, 12 and 13 2023-10-17 21:45:34 -04:00
Alam Ed Arias 94e7430dd9 copy gitlib-ci config from SRB2's next 2023-10-17 20:57:14 -04:00
Alam Ed Arias 7fea4894a2 Add support for GCC 13.2 2023-10-17 20:55:26 -04:00
Alam Ed Arias a5b99199fc Clear implicit-const-int-float-conversion warnings 2023-10-17 20:05:48 -04:00
Alam Ed Arias 79e2596ce6 Clear missing-noreturn warnings 2023-10-17 19:57:56 -04:00
Alam Ed Arias 1b82918384 Clear misleading-indentation warnings 2023-10-17 19:56:27 -04:00
Alam Ed Arias 4e9e18df82 Clear unused-but-set-variable warnings 2023-10-17 19:54:07 -04:00
Alug cec92474d2 Add check for "extra.kart" files contents......
make lapcounter bigger when a map has 10 or more laps (needs updated extra.kart),
fixed menu not greying out user defined hud colour
2023-10-18 01:27:37 +02:00
Alug d8f3dca2fc more sprite rotation anlges = smoother sprite rotation 2023-10-17 22:58:14 +02:00
alufolie91 89576adbcf Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Next 2023-10-16 02:12:22 +02:00
Alug d9b8bd0b8c Add Colourized Hud Color to menu 2023-10-16 02:12:15 +02:00
Alug 525f1b317c Merge pull request #75 from Indev450/more-colorized-hud
More colorized hud
2023-10-16 02:11:16 +02:00
Alug ac119f9d42 Merge pull request #76 from Indev450/pspawnmapthing-null-check
Add null check into P_SpawnMapThing so game doesn't crash if it fails…
2023-10-16 02:11:10 +02:00
Alug a18af5b3e0 Add toggle for CECHO messages
Well you could turn em off with "cechoflags" before, but this is easier and it also saves
2023-10-16 02:10:12 +02:00
alufolie91 ae87cdc8d9 Show "OVERTIME" in karttimer when overtime occurs in battle
instead of it just showing "00´00´00"
2023-10-16 02:08:18 +02:00
indev f2f324c487 Add null check into P_SpawnMapThing so game doesn't crash if it fails to spawn mapthing for some reason 2023-10-13 01:30:46 +03:00
indev 8cd848e44d Default value for colorizedhudcolor is now called 'Skin Color' 2023-10-12 23:40:11 +03:00
indev d83842df55 Allow selecting hud color via colorizedhudcolor cvar. 'None' means use current player's skincolor 2023-10-12 21:35:18 +03:00
alufolie91 0a0567c311 Add a check if stplyr even exists
cause the game otherwise crashes in some situations
2023-10-12 11:32:48 +02:00
alufolie91 1c067d7eec pls 2023-10-12 00:32:12 +02:00
alufolie91 1b5c155dda Revert " Fix a series of buffer overflows in SOC loading"
This reverts commit 1af9e362e0.
2023-10-12 00:26:16 +02:00
alufolie91 8065761c38 Fix spelling "Colourized Hud" 2023-10-11 18:44:46 +02:00
alufolie91 118bb5b107 unfuck sound stuff
-Fix sound sometimes not unmuting when unfocusing and refocusing the game

- Fix the game not being able to turn sound on when starting the game with sound and music disabled

- Fix the sound toggles looking weird in the menu
2023-10-11 17:21:41 +02:00
alufolie91 d1db73342a lowercase kc_ uhgugugeusg 2023-10-11 12:58:16 +02:00
alufolie91 f3e8630049 fix color hud menu grey out thingie 2023-10-11 12:18:41 +02:00
alufolie91 17b1369085 uh also make it support the small minimap icons 2023-10-11 11:41:39 +02:00
alufolie91 497b7e983e give "libd_drawOnMinimap" support for hud offsets 2023-10-11 11:22:33 +02:00
alufolie91 e8e24be6e1 ah move it to saturn options instead
both menus are cramped, but eh, we already had the speedometer toggle there, so this should be also there for consistency
2023-10-11 02:00:25 +02:00
alufolie91 52e2c2bc17 Add colorized hud to menu, make default off
Its in HUD Options since it makes the most sense its in there.
Also off by default, as always
2023-10-11 01:43:36 +02:00
alufolie91 d5d3445fae HUD colorization
https://github.com/NepDisk/srb2k-nepanus/commit/6e45c9bb5ebf8a7335e05316c1e1f70cab1fb160
2023-10-11 01:24:16 +02:00
alufolie91 f22fcbc31c Merge remote-tracking branch 'origin/lua-localskin-fields' into Saturn-Next 2023-10-11 01:22:37 +02:00
alufolie91 275f2f7c28 Merge remote-tracking branch 'origin/miscfixes2' into Saturn-Next 2023-10-11 01:22:02 +02:00
alufolie91 b96663ffb8 Merge remote-tracking branch 'origin/Saturn' into Saturn-Next 2023-10-11 01:21:56 +02:00
indev 939aedd384 Add mobj.localskin and player.localskin fields 2023-10-09 13:43:06 +03:00
Alug b3509e46dd Revert "Avoid branch prediction slowdowns in R_PointOnSide and R_PointOnSegSide"
This reverts commit c5476ff8f9.
2023-10-09 07:39:52 +02:00
Alug 869ddb0b35 Revert "optimise mipmaps"
This reverts commit 7dae68561e.
2023-10-09 06:56:16 +02:00
Alug 466ab2883b remove this
uneeded and i think it crashes
2023-10-09 06:54:49 +02:00
Alug 544c471a9c Add toggle for showing all race maps in level select
"showallmaps yes/no"
2023-10-08 23:27:27 +02:00
alufolie91 b3c1111cd3 forgor 1 line 2023-10-08 03:36:30 +02:00
alufolie91 2fa79155de make the player afterimage sprites follow however the player sprite look
playerafter images now support things like saltyhop and gravstretching to make them feel more grounded or whatever
2023-10-08 03:34:56 +02:00
indev 8af91b8c9b Attempt to fix some replays segfaulting when trying unarchive lua tables from demo 2023-10-06 18:33:55 +02:00
Alug 7dae68561e optimise mipmaps
https://git.do.srb2.org/STJr/SRB2/-/commit/cc12496e9c3fce929546640bbe2c1b35056d7a86
2023-10-05 21:32:08 +02:00
Alug c5476ff8f9 Avoid branch prediction slowdowns in R_PointOnSide and R_PointOnSegSide
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2168/diffs

a bit experimental
2023-10-05 20:55:03 +02:00
alufolie91 2071684fec forgor this oops 2023-10-05 01:05:12 +02:00
alufolie91 50cde90736 add all gl commands even when in software mode
this makes the game not reset some things everytime you switch from opengl to software and back to opengl
2023-10-05 01:04:30 +02:00
alufolie91 b00538a123 lol 2023-10-05 00:38:07 +02:00
alufolie91 1f900c4c75 remove some double defines and move some stuffs 2023-10-04 22:33:14 +02:00
alufolie91 72890d6ed4 move those where they belong 2023-10-04 22:14:02 +02:00
alufolie91 1a13e70b37 rename to maptitle to not conflict with mods 2023-10-04 02:44:32 +02:00
alufolie91 21dcd757b5 toggable stagetitles
basically what it says, made a toggle for stagetitles.
2023-10-04 02:35:18 +02:00
alufolie91 817c4a4042 add some missing stuff to m_menu.c 2023-10-03 12:18:59 +02:00
Alug ea2281355a forgor to delet 2023-10-03 04:12:55 +02:00
Alug 643c7a851d lemme change the audio buffersize for less sound lag pls
"buffersize" command
2023-10-03 04:11:41 +02:00
Alug 3d56f3f212 ugh oops 2023-10-03 03:04:20 +02:00
Alug f086d9a698 nah dont wanna mess with software
leave it as is
2023-10-03 02:58:58 +02:00
alufolie91 e4cd3f8bb7 comment this out for now 2023-10-03 02:56:00 +02:00
alufolie91 4647fd80b9 Revert "fix some things resetting when switching to software from ogl and back"
i am a dumbass lmao


This reverts commit 6f998f922b.
2023-10-03 02:53:15 +02:00
alufolie91 2ce9803257 remove direct3d stuff aswell as minigl stuff 2023-10-03 02:38:09 +02:00
alufolie91 90623359c7 total destruction
removed wince, wii, psp, ps3, msdos and gp2x things aswell as removing sdl 1.2 things since that cant be used with kart anyways
2023-10-03 02:10:33 +02:00
alufolie91 8ecf4f26a7 death 2023-10-03 01:12:07 +02:00
alufolie91 b5c525a990 rip wii and psp 2023-10-03 01:02:45 +02:00
alufolie91 09fcff21ed red light of death, bye ps3 2023-10-03 00:35:02 +02:00
alufolie91 eb229e1844 get Xecuted
rip xbox
2023-10-03 00:06:21 +02:00
alufolie91 22bdf442d4 rip dreamcast sweet prince 2023-10-02 23:38:23 +02:00
alufolie91 f92a7582c6 oops 2023-10-02 23:05:59 +02:00
alufolie91 d158eae377 wtf online mp3 playlists, die! 2023-10-02 23:04:02 +02:00
alufolie91 67c67ec1b0 rip in pieces cd music
death
2023-10-02 23:02:23 +02:00
alufolie91 6f998f922b fix some things resetting when switching to software from ogl and back
also add a missing hwrender ifdef
2023-10-02 22:01:42 +02:00
Alug 859c0181a1 Merge pull request #74 from Indev450/lua-fix-drawpingnum
Fix v.drawPingNum flickering in any fps higher than 35
2023-10-02 15:32:00 +02:00
indev 6a8bfb0da2 This can be const too 2023-10-02 13:08:05 +03:00
indev 26fae628da Forgor to remove first V_DrawPingNum, also change colormap type to const to silence warning 2023-10-02 13:01:36 +03:00
indev 7ce18078f0 Fix v.drawPingNum flickering in any fps higher than 35 2023-10-02 12:31:36 +03:00
alufolie91 c9289dec5a fix opengl sprite shadows 2023-10-02 00:47:52 +02:00
lug420 2ba311705f redo gif recording
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/928?commit_id=ab7987d1cf34fd5d30ce82385bf1c81caf1cb2d3
2023-10-01 02:32:13 +02:00
alufolie91 5201ccd6d2 Optimize HWR_RenderBatches polygon sorting 2023-10-01 02:31:38 +02:00
alufolie91 74a6f76621 oops this doesent belong here 2023-10-01 02:20:17 +02:00
alufolie91 1702cc249d why even 2023-10-01 02:14:25 +02:00
alufolie91 0fbe87a481 change those to UINT32 2023-10-01 01:43:04 +02:00
alufolie91 ad3a5e9329 avoid a crash in intermission drawer
https://git.do.srb2.org/STJr/SRB2/-/commit/38c74cecc04b4cc06158b337b4ce71f45a11984d
2023-10-01 01:10:39 +02:00
alufolie91 2a3acc7286 Fix G_GhostTicker crashing trying to read netvars as ghost data 2023-09-30 22:16:45 +02:00
alufolie91 e7fc777e57 Lua: disallow bitwise not on anything but number values
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1262
2023-09-30 22:12:55 +02:00
alufolie91 5cd4b79ecf Fix sigsegv caused by bad target check in A_Custom3DRotate
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1430
2023-09-30 22:09:50 +02:00
alufolie91 1af9e362e0 Fix a series of buffer overflows in SOC loading
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1457
2023-09-30 22:06:17 +02:00
alufolie91 9c35e61f6c lower max precip dist again
3072 should be absolute max, it already tanks performance

also with precip dist on 4096 you literally hit the games vissprite limit and things start to disappear
2023-09-30 21:25:47 +02:00
alufolie91 e2a1147eea Fix PRIdS define for Windows MINGW64
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1367
2023-09-30 21:00:35 +02:00
alufolie91 503629024a comptime refactoring
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1776
2023-09-30 20:48:41 +02:00
alufolie91 1fa7eb24ac Compile with -rdynamic for UNIXCOMMON platforms
should fix backtrace logging only showing adresses
2023-09-30 20:14:55 +02:00
alufolie91 ac211aabe8 Print a backtrace when SRB2 crashes in a Unix-like environment.
good stuff

https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1288
2023-09-30 20:07:08 +02:00
alufolie91 e9e501bb10 Merge remote-tracking branch 'origin/weathershit' into Saturn 2023-09-30 11:16:34 +02:00
alufolie91 1bc674d73f Merge remote-tracking branch 'origin/removeasmstuff' into Saturn 2023-09-30 11:16:31 +02:00
Alug 10a724a048 fix software mode flashpals when gr_paletteshader is turned off 2023-09-29 22:43:20 +02:00
Alug 7a780bf898 make precip interpolation toggable
saves a few frames while looking basically the same
2023-09-29 21:07:58 +02:00
alufolie91 b9d6d510be Revert "completely remove precip interpolation"
This reverts commit c444d4180e.
2023-09-29 20:48:09 +02:00
alufolie91 5d98bde04c a 2023-09-29 20:24:12 +02:00
alufolie91 1059a7ca5e Revert "Revert "Clean up and simplify zone memory allocation" and "Some memory allocations have been properly aligned" Fixes #35"
This reverts commit 44c9b87557.
2023-09-29 16:15:48 +02:00
alufolie91 05173de41f forgor 2023-09-29 15:35:48 +02:00
alufolie91 ec1cd5f933 rip in pieces asm code
this thing makes software crash so goddamn often, its useless nowadays anyways, and SRB2 removed it some time ago aswell

https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2074?commit_id=7634a960314d5a576656cc4300a74caf889f8d7f
2023-09-29 15:34:29 +02:00
alufolie91 074be933ad remove asm FixedDiv and FixedMul functions
DIE!
2023-09-29 15:15:13 +02:00
alufolie91 41229be341 Merge branch 'Saturn' into weathershit 2023-09-27 17:22:49 +02:00
Alug 1336848f1d Merge pull request #73 from Indev450/lua-remove-unneeded-interpolation
Remove unneeded interpolation from R_PlayerSliptideAngle
2023-09-27 16:03:08 +02:00
indev e10ed14a3c Remove unneeded interpolation from R_PlayerSliptideAngle (this function is only used from lua, and lua is always running at 35 fps anyway) 2023-09-27 12:36:10 +03:00
alufolie91 dc0e67515b compiler complains 2023-09-27 06:00:27 +02:00
alufolie91 6544851ba5 c90 shit 2023-09-27 05:45:29 +02:00
Alug 02fab76406 remove all that crap
nothing uses it, leftovers from cep port
2023-09-27 02:17:23 +02:00
Alug acb139a8c6 die 2023-09-27 02:02:03 +02:00
Alug 82fe3e5362 ughuguha 2023-09-27 02:00:40 +02:00
Alug 26b28f9b4d why are these here?? 2023-09-27 01:49:54 +02:00
alufolie91 689f5add60 smooooth console
uncap console opening/closing animation
2023-09-27 00:48:21 +02:00
alufolie91 c444d4180e completely remove precip interpolation
DIE!
2023-09-27 00:46:48 +02:00
alufolie91 c4312e3f2f smooooth console
uncap console opening/closing animation
2023-09-26 22:54:34 +02:00
alufolie91 50526d2728 remove parts of precip interpolation
it looks exactly the same, but improves performance on maps with weather a bit
2023-09-26 22:44:52 +02:00
alufolie91 04edcd03f2 refactor weather switching 2023-09-26 22:42:39 +02:00
hayaunderscore 09cb8779e4 Fix an issue where flats dont look correctly without retoggling gr_paletteshader 2023-09-26 21:21:47 +02:00
alufolie91 d86eec52ae precip doesent need that stuff interpolated 2023-09-26 21:18:41 +02:00
lug420 e6a1e58405 uaaagheue 2023-09-18 17:14:59 +02:00
lug420 ea10c9ac13 v3 2023-09-18 16:00:19 +02:00
indev e6d3f3f27c Merge pull request #72 from Indev450/localskins
Localskins
2023-09-18 16:52:11 +03:00
indev f713b7fb60 Merge pull request #71 from Indev450/paletteshader
Paletteshader
2023-09-18 16:51:58 +03:00
indev c35a542d60 Merge pull request #70 from Indev450/slopetexture
Slopetexture
2023-09-18 16:51:45 +03:00
indev e6c699faf4 Merge pull request #69 from Indev450/lua-more-rotation-fields
Add mo.rollsum and player.sliproll fields. Rendering and frame interp…
2023-09-18 16:51:34 +03:00
indev f626b4b031 Merge pull request #61 from Indev450/animatedvotescreens
Animatedvotescreens
2023-09-18 16:51:23 +03:00
indev aed81c0ff5 Merge pull request #60 from Indev450/sdldraganddrop-utf8-on-windows
Sdldraganddrop utf8 on windows
2023-09-18 16:51:07 +03:00
indev 1354f2f302 Merge pull request #59 from Indev450/softwarestuff
Softwarestuff
2023-09-18 16:50:49 +03:00
indev 8ea5d0f729 Merge pull request #58 from Indev450/no-discordrpc-when-cvar-is-off
No discordrpc when cvar is off
2023-09-18 16:50:29 +03:00
alufolie91 a4f5f3b7dc Merge remote-tracking branch 'origin/paletteshader' into Saturn-Next 2023-09-18 15:41:14 +02:00
lug420 ab93865255 make flashpals toggable
could be a bit distracting for some
2023-09-18 15:39:13 +02:00
hayaunderscore 1ecdd3dae6 fix compilation error 2023-09-18 14:49:56 +02:00
hayaunderscore ddcd6b0d31 Redo localskin command 2023-09-18 14:49:19 +02:00
alufolie91 5196f1c5b9 Merge remote-tracking branch 'origin/Saturn' into localskins 2023-09-18 14:47:56 +02:00
alufolie91 e4afbc93fe Merge remote-tracking branch 'origin/Saturn' into Saturn-Next 2023-09-17 02:08:50 +02:00
alufolie91 ec62d20a7c Merge remote-tracking branch 'origin/paletteshader' into Saturn-Next 2023-09-17 02:07:51 +02:00
Alug 9dd6ec718f Merge pull request #68 from hayaunderscore/paletteshader
`P_FlashPal` support in palette renderering
2023-09-17 01:52:12 +02:00
hayaunderscore 69237d6a3a Fix stuttering and gamma 2023-09-17 07:28:47 +08:00
hayaunderscore 426cbee752 Make flashpals work
I hate this
2023-09-17 07:28:34 +08:00
alufolie91 d8ed0681ab Merge remote-tracking branch 'origin/paletteshader' into Saturn-Next 2023-09-15 21:36:18 +02:00
lug420 c2f3486e6d Revert "(hopefully) make flashpals work with palette rendering"
This reverts commit e4a575cc5e.
2023-09-15 21:36:05 +02:00
alufolie91 784093603e Merge remote-tracking branch 'origin/paletteshader' into Saturn-Next 2023-09-15 20:56:49 +02:00
lug420 e4a575cc5e (hopefully) make flashpals work with palette rendering 2023-09-15 20:54:57 +02:00
lug420 f00c9d8c23 dont do this in dedi
unecessary if someone runs this thing in dedi mode
2023-09-15 20:54:25 +02:00
indev 9440a22e88 Merge pull request #67 from Indev450/paletteshader
Paletteshader
2023-09-14 21:55:25 +03:00
lug420 f70f7152ab let the thing do its thing
fixes switching of paletterenderer thing
2023-09-14 20:24:36 +02:00
lug420 8c7f35fa29 absolute hell
lighttable sorting was on even with the palette shader disabled, but, we dont need that shit for non palette renderer mode

hope this shit doesent break anything ever pls
2023-09-14 19:17:46 +02:00
lug420 fe74e69da6 dont need this 2023-09-14 18:42:35 +02:00
alufolie91 c170f53948 Merge remote-tracking branch 'origin/slopetexture' into paletteshader 2023-09-14 18:32:10 +02:00
alufolie91 13fd825bcf hackiest shit to make custom shaders not kill palette shader
this is so super dumb its unreal
but it works
2023-09-14 03:43:11 +02:00
indev 8ee4fc2fa1 Oops used upscaled image >< 2023-09-14 00:18:22 +03:00
indev 679a8387c9 Add logo (WIP) 2023-09-14 00:09:33 +03:00
alufolie91 00f3805721 Merge remote-tracking branch 'origin/lua-more-rotation-fields' into Saturn-Next 2023-09-13 21:47:09 +02:00
alufolie91 ab2194e053 Merge remote-tracking branch 'origin/slopetexture' into Saturn-Next 2023-09-13 21:44:26 +02:00
lug420 9044a46b31 fix fullscreen toggle and resolution changes 2023-09-13 21:32:35 +02:00
indev 53d76ea037 Merge pull request #66 from Indev450/no-discordrpc-when-cvar-is-off
No discordrpc when cvar is off (into saturn-next)
2023-09-13 21:23:02 +03:00
indev f3a28c83d8 Merge pull request #65 from Indev450/softwarestuff
Softwarestuff (into saturn-next)
2023-09-13 21:21:59 +03:00
indev b1e2986f65 Merge pull request #64 from Indev450/sdldraganddrop-utf8-on-windows
Sdldraganddrop utf8 on windows (into saturn-next)
2023-09-13 21:21:14 +03:00
indev 267b53a90e Merge pull request #63 from Indev450/animatedvotescreens
Animatedvotescreens (merge into saturn-next)
2023-09-13 21:20:12 +03:00
indev e1b41d2c58 Merge pull request #62 from Indev450/fix-lua-onchange-error-in-error-handling
Fix 'error in error handling' for cases when error happens in cvar.fu…
2023-09-13 21:16:54 +03:00
lug420 3204095afb revert "redo parts of the lighttable shader"
die
2023-09-13 16:09:58 +02:00
lug420 538de7d2d2 fix memfree command on 64bit 2023-09-13 04:42:35 +02:00
alufolie91 2cba586d9c im good at coding
absolute bruh thing, but it somehow works, fixes the midtextures, and doesent kill performance lmao
2023-09-13 03:54:12 +02:00
alufolie91 ad4d587a52 screw you
bleh, pegging midtextures to slopes now works correctly, but cutting them is broken again
atleast this fixes the performance issues
no idea tho why it screws up things so much
2023-09-13 02:58:20 +02:00
alufolie91 a929636a28 Revert "cleanup HWR_SplitWall"
This reverts commit 06a2508a9c.
2023-09-13 02:56:11 +02:00
alufolie91 06a2508a9c cleanup HWR_SplitWall
e
2023-09-13 01:52:25 +02:00
alufolie91 64b2e2ee37 Fix bugs with HWR_SplitWall and sloped midtextures but cleaner
performance still pretty bad, atleast this is cleaner than last time
2023-09-13 01:40:52 +02:00
alufolie91 b6ef6eb801 revert sloped midtexture fix for now
huge performance regression on some maps
ill look into it in the future again maybe
2023-09-12 21:03:58 +02:00
indev b4d48cc9ec Set palette uniform in InitPalette instead of DrawScreenFinalTexture 2023-09-12 21:55:35 +03:00
alufolie91 f83a937dc5 redo parts of the lighttable shader
this caused performance drops before even with the whole thing disabled
2023-09-12 18:56:51 +02:00
alufolie91 e2acb4c3fc only do this when were running the palette shader 2023-09-12 17:07:19 +02:00
alufolie91 5bf722a1fb only allow this thing when shaders are enabled aswell
yes i will do it like that
no i wont use gl_allowshaders
i want this thing to be able to affect the menus and hud, just like software :p
2023-09-12 01:50:46 +02:00
alufolie91 0751484439 fix some effects
idk lmao but this fixes a few effects to be "on par" with software renderer
aswell as menus and hud stuff
2023-09-12 00:38:50 +02:00
alufolie91 e5b16c7aa0 Merge remote-tracking branch 'origin/Saturn' into paletteshader 2023-09-11 20:45:20 +02:00
lug420 bac058d128 forgor some things 2023-09-11 20:07:03 +02:00
haya dd4a9ae890 i may be stupid 2023-09-11 20:01:27 +02:00
hayaunderscore f91687209b fix horizon lines on batching somewhat 2023-09-11 20:01:22 +02:00
lug420 ec4140a9d2 remove custom shader toggle + clear colormaps when toggle palette shader
the custom shader toggle often broke stuff when toggled while palette shader was active

also clearing colormaps when toggling palette shader is ugly midlevel but atleast it doesent visually break completely

def need to somehow reinitialze colormaps instead or smth
2023-09-11 20:00:09 +02:00
lug420 2553c9e878 cleanup a bit
remove debug prints and vars
clean stuff up a bit
2023-09-11 18:30:35 +02:00
lug420 f9f33aa53a add lighttabble shader
this was way too much headache
set up a basic condition atm, so lighttable generation turns off if the paletteshader is turned off
this will break visually if the shader is turned on midrace atm
will implement smth better
2023-09-11 18:13:59 +02:00
hayaunderscore 4455ebe58f Fix issue with upside-down salty hop 2023-09-11 16:03:18 +02:00
alufolie91 35cfdea9e7 allow opengl to also use widescreen backgrounds for votes
thanks kk for locking this to software mode only despite this working without issues in opengl aswell
2023-09-11 15:55:59 +02:00
indev 346433d248 Shutdown DiscordRPC when discordrp cvar is set to Off 2023-09-11 13:17:12 +03:00
indev 16a7e69292 Don't init discord rich presence untill discordrp is set to On
Haven't tested this since i'm on linux and the feature looks like it is windows only
2023-09-11 13:01:29 +03:00
Alug 441824fc70 Merge pull request #57 from hayaunderscore/paletteshader
Fix shader compile error and level palettes
2023-09-11 10:40:01 +02:00
hayaunderscore f46b77ab7b fix shader compile error, fix custom level palettes 2023-09-11 14:00:36 +08:00
alufolie91 561af0e601 smol adjustment 2023-09-11 02:14:22 +02:00
alufolie91 362c21505d smol fixup
fixes the weird black/white screen on game start
2023-09-11 01:04:43 +02:00
alufolie91 d3d40de996 unfuck this thing change lut size to full 64
holy fuck, goddamit, im so mad at this
2023-09-10 18:59:31 +02:00
alufolie91 3ce4653bb5 smol adjustment 2023-09-10 16:57:38 +02:00
alufolie91 a639c87a90 rework this thing, use parts of the new palette renderer
this atleast completely fixed the stutters and prob the memory leaks the thing had before

its still super messy and idk
2023-09-10 16:43:42 +02:00
alufolie91 3aac16432a adjust things more
try to mitigate performance loss and stutters
readjust the look a bit
cleanup stuff a bit
this thing still pretty much runs badly
2023-09-09 16:18:46 +02:00
lug420 1c9ea1eb2e fix a crash with rotsprites
+ clean up this absolute mess
2023-09-09 01:38:23 +02:00
indev a47aea4c9f Fix 'error in error handling' for cases when error happens in cvar.func right when cvar is registered 2023-09-08 18:29:05 +03:00
indev 9cd0e6c385 Why is this 'variable-sized' and can't be initialized like that??? 2023-09-08 12:00:10 +03:00
indev c23a0f08c4 Merge pull request #55 from Indev450/rotsnap
smoother slope rotation for players
2023-09-08 11:51:55 +03:00
indev 3ff865b1b6 Merge pull request #56 from Indev450/sdldraganddrop
Addfile per drag and drop
2023-09-08 11:51:31 +03:00
indev cdedf1349c Attempt to fix non-ansii filenames on windows 2023-09-08 11:47:19 +03:00
alufolie91 7beab3b582 fix the sprite renderstats again
aAAaaa
2023-09-08 10:42:31 +02:00
alufolie91 b1b592f88d readd the stuff blubuabb 2023-09-08 10:38:48 +02:00
lug420 8737a40a4d bleh 2023-09-07 23:55:26 +02:00
lug420 71ce5be570 me wondering why the hw sprite perfstats were broken
+ removing some stuff we dont need
2023-09-07 23:54:22 +02:00
indev b883d02abb Use P_AddWadFile directly instead of command so non-ansii file names also supported 2023-09-07 19:28:53 +03:00
alufolie91 09f79a6934 Addfile per drag and drop
https://git.do.srb2.org/SteelT/SRB2/-/commit/01cc2b91e189e4d268eddd38f3ba917133a07adc
2023-09-07 17:24:06 +02:00
lug420 9bdcfe9750 adjust some stuff
bleh looks alr, but def loose some color depth with it
2023-09-07 15:59:10 +02:00
lug420 b767180473 readd the lookup texture, adjust its size
it runs a bit better like this, but also is a bit darker
def needs adjustments
2023-09-07 14:38:10 +02:00
indev acb5d96788 Merge pull request #54 from Indev450/misc-fixes
Fix few typos
2023-09-06 19:58:45 +03:00
indev 228a932598 Fix few typos 2023-09-06 19:54:14 +03:00
lug420 b53cc6fd2b fuck it palette renderer "lite"
remove the goddamn lookup textures, this atleast runs okish and looks not that bad
2023-09-06 18:29:26 +02:00
lug420 01cd8f5a0f 4fps
this thing runs like crap 4fps
2023-09-06 18:02:04 +02:00
alufolie91 9732e74bf3 more work
https://git.do.srb2.org/Hannu_Hanhi/SRB2/-/commit/140dba15b86ad7e206c50c8336103bee89e6b032
2023-09-06 15:24:31 +02:00
alufolie91 2ed4a7b548 Palette Lookup Texture
https://git.do.srb2.org/Hannu_Hanhi/SRB2/-/commit/9562a95d0adb9384b5db26145ed03cb5d3e5a893
https://git.do.srb2.org/Hannu_Hanhi/SRB2/-/commit/d8a329b89dad75a57e076d88b8d5d1fdb5f959bc
2023-09-06 15:19:39 +02:00
alufolie91 52c11d1444 paletteshader
stuff from hannu
https://git.do.srb2.org/Hannu_Hanhi/SRB2/-/commit/2530e8b2938eb3ecb6f56b6cdc9916f387a72c6a

this thing tanks my framerate to hell
2023-09-06 15:12:18 +02:00
alufolie91 78d50e4c43 just a bit more
looks even better like this imo
2023-09-05 23:01:03 +02:00
indev 7f05d27f42 Allow lua to change vote background via hud.setVoteBackground 2023-09-05 12:47:49 +03:00
alufolie91 3675fdd361 smoother slope rotation for players
dont snap player directly to whatever theyre standing on
instead make the sprite rotate a bit smoother
see: https://git.do.srb2.org/haya_/Kart-Public/-/commit/8448d75b031fa86cdb854d13eda4712352d35a89
2023-09-05 09:13:12 +02:00
alufolie91 98dfe528d8 remove this 2023-09-04 16:37:11 +02:00
alufolie91 7da590df94 Fix sprite scale column iteration crash
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2130
2023-09-04 15:30:42 +02:00
alufolie91 90cc5a6cb0 Fix a possible crash in R_RenderMaskedSegRange
https://git.do.srb2.org/STJr/SRB2/-/commit/55b4458001b2ffe76774ff07a11b56ebf1f70de9
2023-09-04 15:30:21 +02:00
alufolie91 ca9277366c anim screen stuff 2023-09-01 19:43:24 +02:00
indev e79bf24bcd Add lua memory usage in memfree command output 2023-09-01 18:34:06 +03:00
indev 2c1201ff34 Add mo.rollsum and player.sliproll fields. Rendering and frame interpolation code was used, so they are NOT synch safe! 2023-09-01 12:45:23 +03:00
alufolie91 c4ff1a3aca forgor to readd those 2023-09-01 10:12:06 +02:00
alufolie91 5760f25c74 readd the namecheck to addlocalskin menu
until we find a better way to check for skins c:
2023-08-31 13:41:25 +02:00
indev 0a6f700c6f Addon browser can now be in 2 states - loading addons and loading localskins, which fixes its behavior when trying to load character addon as server admin 2023-08-31 13:59:30 +03:00
alufolie91 3147dfb012 2.1 2023-08-31 11:18:38 +02:00
Alug 5007a33bbf Merge pull request #49 from Indev450/fixspeedometer
fix the speedometer
2023-08-31 10:57:03 +02:00
Alug c65acfa90e Merge pull request #50 from Indev450/nospecialmusic
Nospecialmusic
2023-08-31 10:56:50 +02:00
Alug b167c19137 Merge pull request #51 from hayaunderscore/readme-refactor
make the readme look more consistent
2023-08-31 10:56:15 +02:00
alufolie91 d48b08856e Support for Animated Votingscreens
i hate the interpolation i hate it
no idea honestly if those play correctly atm but atleast they dont freak out with uncapped
https://gitlab.com/blondedradio/srb-2-k-cep/-/commit/776a547087cdef46b2bdbfc3ddc9d4d963bbea4b
2023-08-31 10:42:43 +02:00
alufolie91 9ba5c9a38b bruuuuuh 2023-08-31 03:35:42 +02:00
haya 1a9f30a328 ok github markdown 2023-08-31 07:06:17 +08:00
haya 97058bfcf6 try being consistent 2023-08-31 07:05:06 +08:00
alufolie91 bd41bbb304 fix the speedometer
things got swapped X)
also removed the extra number, kart adds a 3rd one if needed
2023-08-31 00:24:16 +02:00
alufolie91 f47cb885cc eeeeheheheeheheh ifdefs 2023-08-30 22:27:52 +02:00
alufolie91 1ab243d93a add shit to menu 2023-08-30 22:26:38 +02:00
alufolie91 15d59cbbd8 i dont want any special music
no to grow and star music!
2023-08-30 22:20:07 +02:00
Alug c88d2dadb0 Update README.md again 2023-08-30 21:15:07 +02:00
alufolie91 a4e96d2380 bruh 2023-08-30 19:20:35 +02:00
alufolie91 002c550263 more fixes
ugh
2023-08-30 19:17:51 +02:00
alufolie91 25b9bc4100 smol fix 2023-08-30 19:15:22 +02:00
alufolie91 7105606475 more menu shit
- Youll now get a preview of what skin is going to be used.
- Removed redundant code
https://git.do.srb2.org/haya_/Kart-Public/-/commit/a6728c26f76bfc94f7bc07aa076c8979c9bef5c9
2023-08-30 19:14:41 +02:00
alufolie91 71e4005226 add menu n shit
https://git.do.srb2.org/haya_/Kart-Public/-/commit/b85a55137cfef0a18b297c59e62018586323a2e9
2023-08-30 19:12:56 +02:00
alufolie91 76b66b41b6 Argh!
https://git.do.srb2.org/haya_/Kart-Public/-/commit/217f15452c1fda9ea3c0d00650d470e13e14e0f5
2023-08-30 18:58:26 +02:00
alufolie91 43e1331594 another localfile thingie
https://git.do.srb2.org/haya_/Kart-Public/-/commit/4a60babf75ce6362d32a1633b12a718d65bcd18c
2023-08-30 18:51:10 +02:00
alufolie91 23ba3d493b issues fixing 2023-08-30 18:50:00 +02:00
alufolie91 487cbc495a more changes
https://git.do.srb2.org/haya_/Kart-Public/-/commit/9e3919195d143956e31bf092f6822cab61d1ee81
2023-08-30 18:47:57 +02:00
alufolie91 faeb4d22ed Add a -force parameter to addskins, fix localskin not playing the right sounds
https://git.do.srb2.org/haya_/Kart-Public/-/commit/932e9b92c3551dc4910157ea8d3eea1145ccfc40
2023-08-30 18:43:55 +02:00
alufolie91 9dc2ad4f32 add localskinall command
https://git.do.srb2.org/haya_/Kart-Public/-/commit/958fe796eb070b6678cd45ea835a998d8dc6d2c9
2023-08-30 17:39:41 +02:00
alufolie91 ceae12baba fix an issue with desynchs
https://git.do.srb2.org/haya_/Kart-Public/-/commit/a47d965b82e45bcf600217899a2cd6951024093b
2023-08-30 17:34:28 +02:00
alufolie91 58c58e9542 fix shit even more
https://git.do.srb2.org/haya_/Kart-Public/-/commit/37d72b4680bbb1ecb68aaa817f2afc8b34deab96
2023-08-30 17:31:57 +02:00
alufolie91 46c7bf8b03 fix shit
https://git.do.srb2.org/haya_/Kart-Public/-/commit/e4ba8b9a753fe741f1e5a65490ae0d2d645baa97
2023-08-30 17:24:50 +02:00
alufolie91 c011d09e33 fix for localskins not properly saving when returning back into the titlescreen
https://git.do.srb2.org/haya_/Kart-Public/-/commit/e679dfe0aa059cca68bc67da5a45c12c26dfd9ac
2023-08-30 17:11:38 +02:00
alufolie91 65fadcf709 fix
https://git.do.srb2.org/haya_/Kart-Public/-/commit/b6b3dcb3f08b470d6075c2949b2dee364afb5c99
2023-08-30 17:09:40 +02:00
alufolie91 e2b06aa600 Ghost and signpost support
https://git.do.srb2.org/haya_/Kart-Public/-/commit/f07179589414b15605da14901f742342ab53de66
2023-08-30 17:08:50 +02:00
alufolie91 7ab0a808a9 Show which skin is the real one 2023-08-30 17:05:21 +02:00
alufolie91 bc7ce5c983 "immersion"
https://git.do.srb2.org/haya_/Kart-Public/-/commit/4547347e219158c1d11a6f373c9c94a7bd2ee789
2023-08-30 17:04:40 +02:00
alufolie91 6e55d88816 more shit
https://git.do.srb2.org/haya_/Kart-Public/-/commit/28fa3039c147d7b479b8d4ddfca50918c620aa2f
2023-08-30 17:02:05 +02:00
alufolie91 97f0ea1b0f initial support
https://git.do.srb2.org/haya_/Kart-Public/-/commit/a464df2165d62528af46d7ef0a6cbdbf29c3d07c
2023-08-30 16:59:23 +02:00
James R 684b016487 Merge branch 'fix-ban-txt-crash' into 'master'
Fix ban.txt crashing game

See merge request KartKrew/Kart-Public!329
2023-08-14 11:41:53 +00:00
James R 0b55e8df7b Rename HAVE_STRLCPY to SRB2_HAVE_STRLCPY, fix non-glibc compile
- Fix compile with msvcrt
- Fix compile with SDL 2.28.2
2023-08-14 04:40:00 -07:00
indev f9880e8413 Fix ban.txt crashing game 2023-08-05 14:50:12 +03:00
James R c499a8387e Fix glibc 2.38 compile
glibc 2.38 added strlcpy and strlcat.
2023-08-03 16:45:34 -07:00
327 changed files with 6241 additions and 63784 deletions

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@ jobs:
- v1-SRB2-APT
- run:
name: Install SDK
command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
command: apt-get -qq -y --no-install-recommends install git build-essential libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
- save_cache:
key: v1-SRB2-APT
paths:
+436
View File
@@ -0,0 +1,436 @@
default:
image: debian:stable-slim
stages: # List of stages for jobs, and their order of execution
- build
variables:
GIT_STRATEGY: clone
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_PATH
.job_template: &job_build # This job runs in the build stage, which runs first.
stage: build
cache:
- key: ccache-$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME_SLUG
fallback_keys:
- cache-$CI_PROJECT_PATH_SLUG-$CI_DEFAULT_BRANCH
- cache-$CI_PROJECT_PATH_SLUG-default
paths:
- ccache
- ccache_statslog
- key: apt-$CI_JOB_IMAGE
paths:
- apt-cache
unprotect: true
before_script:
- - |
# debconf
echo -e "\e[0Ksection_start:`date +%s`:debconf[collapsed=true]\r\e[0KSetup debconf's environment"
- export DEBIAN_FRONTEND="noninteractive"
- export DEBIAN_PRIORITY="low"
- export DEBCONF_NONINTERACTIVE_SEEN="true"
- |
# debconf
echo -e "\e[0Ksection_end:`date +%s`:debconf\r\e[0K"
- - |
# dpkg_aa
echo -e "\e[0Ksection_start:`date +%s`:dpkg_aa[collapsed=true]\r\e[0KAdding architectures to dpkg"
- dpkg --add-architecture i386
- dpkg --add-architecture amd64
- dpkg --add-architecture arm64
- |
# dpkg_aa
echo -e "\e[0Ksection_end:`date +%s`:dpkg_aa\r\e[0K"
- - |
# apt_conf
echo -e "\e[0Ksection_start:`date +%s`:apt_conf[collapsed=true]\r\e[0KSetting up APT conf"
- export APT_CACHE_DIR=`pwd`/apt-cache
- mkdir --parents --verbose $APT_CACHE_DIR/partial/
- touch /etc/apt/apt.conf.d/99build
- |
# apt.conf
echo Adding options to apt.conf':'
- |
# APT::Install-Recommends
echo APT::Install-Recommends "false"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# quit
echo quiet "1"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# APT::Get::Assume-Yes
echo APT::Get::Assume-Yes "true"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# Dir::Cache::Archives
echo Dir::Cache::Archives "$APT_CACHE_DIR"\; | tee --append /etc/apt/apt.conf.d/99build
- |
# apt_conf
echo -e "\e[0Ksection_end:`date +%s`:apt_conf\r\e[0K"
- - |
# apt_update
echo -e "\e[0Ksection_start:`date +%s`:apt_update[collapsed=true]\r\e[0KUpdating APT listing"
- apt-get update
- |
# apt_update
echo -e "\e[0Ksection_end:`date +%s`:apt_update\r\e[0K"
- - |
# apt_pre
echo -e "\e[0Ksection_start:`date +%s`:apt_pre[collapsed=true]\r\e[0KInstalling pre packages"
- apt-get install apt-utils
- |
# apt_pre
echo -e "\e[0Ksection_end:`date +%s`:apt_pre\r\e[0K"
- - |
# apt_upgrade
echo -e "\e[0Ksection_start:`date +%s`:apt_upgrade[collapsed=true]\r\e[0KUpdating existing packages"
- apt-get upgrade
- |
# apt_update
echo -e "\e[0Ksection_end:`date +%s`:apt_upgrade\r\e[0K"
- - |
# apt_common
echo -e "\e[0Ksection_start:`date +%s`:apt_common[collapsed=true]\r\e[0KInstalling common packages"
- apt-get install make git ccache
- |
# apt_common
echo -e "\e[0Ksection_end:`date +%s`:apt_common\r\e[0K"
- - |
# ccache_config
echo -e "\e[0Ksection_start:`date +%s`:ccache_config[collapsed=true]\r\e[0KSetting up ccache config"
- mkdir --parents --verbose ~/.ccache/
- touch ~/.ccache/ccache.conf
- |
# cache.conf
echo Adding ccache configution option
- |
# base_dir
echo base_dir = $PWD | tee --append ~/.ccache/ccache.conf
- |
# cache_dir
echo cache_dir = $PWD/ccache | tee --append ~/.ccache/ccache.conf
- |
# compiler_check
echo compiler_check = content | tee --append ~/.ccache/ccache.conf
- |
# stats_log
echo stats_log = $PWD/ccache_statslog | tee --append ~/.ccache/ccache.conf
- |
# max_size
echo max_size = 50M | tee --append ~/.ccache/ccache.conf
- |
# ccache_config
echo -e "\e[0Ksection_end:`date +%s`:ccache_config\r\e[0K"
- - |
# cache_reset
echo -e "\e[0Ksection_start:`date +%s`:ccache_reset[collapsed=true]\r\e[0KResetting ccache statistics"
- ccache --zero-stats
- ccache --show-stats
- |
# ccache_reset
echo -e "\e[0Ksection_end:`date +%s`:ccache_reset\r\e[0K"
after_script:
- - |
# apt_clean
echo -e "\e[0Ksection_start:`date +%s`:apt_clean[collapsed=true]\r\e[0KCleaning of unneeded APT packages"
- apt-get autoclean
- |
# apt_clean
echo -e "\e[0Ksection_end:`date +%s`:apt_clean\r\e[0K"
- - |
# ccache_stats
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
- ccache --show-stats --verbose
- ccache --show-log-stats --verbose
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
Debian testing GCC:
<<: *job_build
image: debian:testing-slim
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian GCC testing"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc"
variables:
CC: gcc
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Windows x86:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32"
variables:
PREFIX: i686-w64-mingw32
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-mingw-w64-i686-win32
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW=1 SDL=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:amd64:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian amd64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86-64"
variables:
CC: x86_64-linux-gnu-gcc
OBJCOPY: x86_64-linux-gnu-objcopy
OBJDUMP: x86_64-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-x86-64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libgme-dev:amd64 libopenmpt-dev:amd64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:i386:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian i386"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-i686"
variables:
CC: i686-linux-gnu-gcc
OBJCOPY: i686-linux-gnu-objcopy
OBJDUMP: i686-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-i686-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libgme-dev:i386 libopenmpt-dev:i386
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:arm64:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian arm64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-aarch64"
variables:
CC: aarch64-linux-gnu-gcc
OBJCOPY: aarch64-linux-gnu-objcopy
OBJDUMP: aarch64-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-aarch64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libgme-dev:arm64 libopenmpt-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Windows x64:
<<: *job_build
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Win64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64"
variables:
PREFIX: x86_64-w64-mingw32
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-mingw-w64-x86-64-win32
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 MINGW64=1 SDL=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable Clang:
<<: *job_build
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian Clang"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang"
variables:
CC: clang
WFLAGS: -Wno-cast-align
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install clang
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian testing Clang:
extends: Debian stable Clang
image: debian:testing-slim
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debina Clang testing"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
variables:
CC: clang
WFLAGS: -Wno-cast-align -Wno-deprecated-non-prototype
+1 -4
View File
@@ -109,13 +109,10 @@ FILE_PATTERNS = *.c \
*.mm \
*.dox
RECURSIVE = YES
EXCLUDE = ./src/djgppdos/internal.h \
./src/djgppdos/setup.c \
./src/sdl/IMG_xpm.c \
EXCLUDE = ./src/sdl/IMG_xpm.c \
./src/sdl/SRB2DC/scramble.c
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */src/hardware/*/* \
*/src/djgppdos/bcd.? \
*/src/sdl/SDL_main/* \
*/src/*/*_private.h \
*/src/sdl/*/*help.? \
+39
View File
@@ -0,0 +1,39 @@
# SRB2Kart Saturn: Custom lua features
## mobj.localskin and player.localskin fields
Allow reading and assigning localskins to players. Local skins for other objects aren't supported currently.
## mobj.rollsum field
**Not netsafe**. Returns total sprite rotation value, taking sliptideroll and sloperoll cvars value into account.
Mainly for use in visual-only addons like secondcolor.
## player.sliproll field
**Not netsafe**. Returns player's current sliptide roll angle, taking sliptideroll cvar value into account.
## hud.setVoteBackground(name)
Changes vote background texture prefix (game looks for PREFIX + "W" or "C" (depends on resolution) + FRAME\_NUMBER).
## hud.add(fn, "vote") and hud.add(fn, "intermission")
Hud hooks for vote screen and intermission screen. They only get drawer (`v`) as argument.
To check if those hooks are available, check if globals FEATURE\_VOTEHUD and FEATURE\_INERMISSIONHUD
exist.
## mobj.spritexscale, mobj.spriteyscale, mobj.spritexoffset, mobj.spriteyoffset, mobj.rollangle, mobj.sloperoll, mobj.rollmodel fields
Same fields as in SRB2 2.2
## S\_StopSoundByNum
Allows stopping specific sound globally. Because this function starts with S\_, like state, checking
if it exists is a bit more complicated:
```lua
if rawget(_G, "S_StopSoundByNum") ~= nil then
... -- Can use it
end
```
+22 -17
View File
@@ -6,29 +6,34 @@
- Sprites player rotation on slopes; going on hills, levitate, going down, and so on alters your sprites (configurable)
- You can alter all the base kart HUD element offsets on the fly in the Saturn Options settings menu
- "addfilelocal" Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
- OpenMPT for Tracker module playback (Complete with filters) fixed looping issues while even sounding better than the old GME playback
- `addfilelocal` Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
- OpenMPT for Tracker module playback instead of GME
- Fixes looping and sounds better
- Allows filter configuration
- The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values)
- Lua hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
- Lua hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
- Lua HUD hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
- Lua HUD hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
- Saltyhop! do a funny hop
- Smaller Speedometer (optional / requieres extra.kart file)
- Record Attack input display can now be used everywhere
- Smaller minimap icons and also show player names on the minimap (toggable)
- "showmusiccredits" command, shows you the current music track again
- "listskins" show a list of all skins currently loaded
- Visual Portals from Haya´s HEP Client
- Toggable lowercase menu´s also from Haya´s HEP client
- `showmusiccredit` command, shows you the current music track again
- `listskins` show a list of all skins currently loaded
- Visual Portals from Haya's HEP Client
- Toggable lowercase menu's also from Haya's HEP client
- Everything that Galaxy has
## Improvements / Bug fixes
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen (can be set to 100MiB max with "maxdemosize" command in console)
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music) *The mapper still has to provide a MusicDEF for this to work.
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen
- can be set to 100MiB max with `maxdemosize` command in console
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music)
- The mapper still has to provide a MusicDEF for this to work.
- Configurable chatlog length (yay can read those messages from 30 mins ago without opening log.txt)
- Configurable timeout for waiting to join a full server (in vanilla this is capped to 5 minutes before it boots you out)
- Characters now spin in skin selection menu (configurable)
- HTTP Addon download speed has been raised dramatically (configurable with "downloadspeed" command)
- HTTP Addon download speed has been raised dramatically
- configurable with `downloadspeed` command
- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals
- The Position Number in the corner is alot smaller now (half the size!)
- Toggable Lap animation
@@ -40,17 +45,18 @@
- Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts
- Lua shows Tracebacks whenever an error occurs
- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X in console)
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss (Note intermission screen background is broken with this)
- Software mode has gotten "ffloorclip", which boosts performance on maps with many Floor over Floor roads
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss
- Intermission backgrounds, heat wave effects and etc are broken with this
- `ffloorclip`, exclusive to Software, which boosts performance on maps with many Floor over Floor sectors
## Technical fixes
- ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it)
- Fof's intersecting with slopes have less issues and now render correctly in Opengl
- FOFs intersecting with slopes have less issues and now render correctly in Opengl
- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone
- The annoying depraction messages for "P_TeleportMove" and "P_AproxDistance" have been silenced
- The annoying depraction messages for `P_TeleportMove` and `P_AproxDistance` have been silenced
- Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways
- Added a small cooldown on "map" command due to spamming causing a SIGSEGV
- Added a small cooldown on `map` command due to spamming causing a SIGSEGV
## MISC
- Bird's Camara Tilting feature is no longer turned on by default
@@ -62,7 +68,6 @@
- You tell us! c:
## Dependencies
- NASM (x86 builds only)
- SDL2 (Linux/OS X only)
- SDL2-Mixer (Linux/OS X only)
- libupnp (Linux/OS X only)
-18
View File
@@ -1996,24 +1996,6 @@ HW3SOUND for 3D hardware sound support
<Option compilerVar="CC" />
</Unit>
<Unit filename="src/v_video.h" />
<Unit filename="src/vid_copy.s">
<Option compilerVar="CC" />
<Option compiler="avrgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gnu_gcc_compiler_for_mingw32" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gnu_gcc_compiler_for_mingw64" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="armelfgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="tricoregcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="ppcgcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option compiler="gcc" use="1" buildCommand="$compiler $options -x assembler-with-cpp -c $file -o $object" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
<Option target="Debug Mingw/DirectX" />
<Option target="Release Mingw/DirectX" />
</Unit>
<Unit filename="src/w_wad.c">
<Option compilerVar="CC" />
</Unit>
-3
View File
@@ -25,9 +25,6 @@
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(PlatformTarget)'=='x86'">
<ClCompile>
<PreprocessorDefinitions>USEASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
+1 -51
View File
@@ -5,7 +5,7 @@ Ver=3
IsCpp=0
Type=0
UnitCount=279
Folders=A_Asm,B_Bot,BLUA,D_Doom,F_Frame,G_Game,H_Hud,Hw_Hardware,Hw_Hardware/r_opengl,I_Interface,I_Interface/Dummy,I_Interface/SDL,I_Interface/Win32,LUA,M_Misc,P_Play,R_Rend,S_Sounds,W_Wad
Folders=B_Bot,BLUA,D_Doom,F_Frame,G_Game,H_Hud,Hw_Hardware,Hw_Hardware/r_opengl,I_Interface,I_Interface/Dummy,I_Interface/SDL,I_Interface/Win32,LUA,M_Misc,P_Play,R_Rend,S_Sounds,W_Wad
CommandLine=
CompilerSettings=00000000000100000111e1
PchHead=-1
@@ -1473,36 +1473,6 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit149]
FileName=src\tmap.nas
Folder=A_Asm
Compile=0
CompileCpp=0
Link=0
Priority=1000
OverrideBuildCmd=1
BuildCmd=nasm.exe -g -o $@ -f win32 src/tmap.nas
[Unit150]
FileName=src\asm_defs.inc
Folder=A_Asm
Compile=0
CompileCpp=0
Link=0
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit151]
FileName=src\vid_copy.s
Folder=A_Asm
Compile=1
CompileCpp=0
Link=1
Priority=1000
OverrideBuildCmd=1
BuildCmd=$(CC) $(CFLAGS) -x assembler-with-cpp -c src/vid_copy.s -o $@
[Unit152]
FileName=src\y_inter.h
Folder=H_Hud
@@ -1543,26 +1513,6 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit156]
FileName=src\p5prof.h
Folder=A_Asm
Compile=1
CompileCpp=0
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit157]
FileName=src\tmap_mmx.nas
Folder=A_Asm
Compile=0
CompileCpp=0
Link=0
Priority=1000
OverrideBuildCmd=1
BuildCmd=nasm.exe -g -o $@ -f win32 src/tmap_mmx.nas
[Unit159]
FileName=src\lzf.h
Folder=W_Wad
-8
View File
@@ -11,8 +11,6 @@ environment:
# c:\msys64 x86_64 has gcc 8.2.0, so use c:\mingw-w64 7.3.0 instead
MINGW_SDK_64: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
CFLAGS: -Wall -W -Werror -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-tautological-compare -Wno-error=suggest-attribute=noreturn
NASM_ZIP: nasm-2.12.01
NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip
UPX_ZIP: upx391w
UPX_URL: http://upx.sourceforge.net/download/upx391w.zip
CCACHE_EXE: ccache.exe
@@ -46,7 +44,6 @@ environment:
ASSET_CLEAN: 0
cache:
- nasm-2.12.01.zip
- upx391w.zip
- ccache.exe
- C:\Users\appveyor\.ccache
@@ -58,10 +55,6 @@ install:
- if [%X86_64%] == [1] ( set "MINGW_SDK=%MINGW_SDK_64%" )
- if [%X86_64%] == [1] ( set "CCACHE_CC=%CCACHE_CC_64%" )
- if not exist "%NASM_ZIP%.zip" appveyor DownloadFile "%NASM_URL%" -FileName "%NASM_ZIP%.zip"
- 7z x -y "%NASM_ZIP%.zip" -o%TMP% >null
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%NASM_ZIP%" "%MINGW_SDK%\bin" nasm.exe || exit 0
- if not exist "%UPX_ZIP%.zip" appveyor DownloadFile "%UPX_URL%" -FileName "%UPX_ZIP%.zip"
- 7z x -y "%UPX_ZIP%.zip" -o%TMP% >null
- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs "%TMP%\%UPX_ZIP%" "%MINGW_SDK%\bin" upx.exe || exit 0
@@ -78,7 +71,6 @@ before_build:
- set "Path=%MINGW_SDK%\bin;%Path%"
- if [%X86_64%] == [1] ( x86_64-w64-mingw32-gcc --version ) else ( i686-w64-mingw32-gcc --version )
- mingw32-make --version
- if not [%X86_64%] == [1] ( nasm -v )
- if not [%NOUPX%] == [1] ( upx -V )
- ccache -V
- ccache -s
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-5
View File
@@ -1,5 +0,0 @@
/*.elf
/*.self
/*.pkg
/*.BIN
/pkg
-5
View File
@@ -1,5 +0,0 @@
/*.elf
/*.self
/*.pkg
/*.BIN
/pkg
-4
View File
@@ -1,4 +0,0 @@
/EBOOT.PBP
/PARAM.SFO
/SRB2PSP.PBP
/SRB2PSP.elf
-3
View File
@@ -1,3 +0,0 @@
/*.elf
/*.dol
/apps
-3
View File
@@ -1,3 +0,0 @@
/*.elf
/*.dol
/apps
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-3
View File
@@ -1,3 +0,0 @@
*.arm9
*.elf*
*.nds
-3
View File
@@ -1,3 +0,0 @@
*.arm9
*.elf*
*.nds
@@ -1,46 +0,0 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# support for the yasm assembler
set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS nasm yasm asm)
if(NOT CMAKE_ASM_YASM_OBJECT_FORMAT)
if(WIN32)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(CMAKE_ASM_YASM_OBJECT_FORMAT win64)
else()
set(CMAKE_ASM_YASM_OBJECT_FORMAT win32)
endif()
elseif(APPLE)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(CMAKE_ASM_YASM_OBJECT_FORMAT macho64)
else()
set(CMAKE_ASM_YASM_OBJECT_FORMAT macho)
endif()
else()
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(CMAKE_ASM_YASM_OBJECT_FORMAT elf64)
else()
set(CMAKE_ASM_YASM_OBJECT_FORMAT elf)
endif()
endif()
endif()
set(CMAKE_ASM_YASM_COMPILE_OBJECT "<CMAKE_ASM_YASM_COMPILER> <FLAGS> -f ${CMAKE_ASM_YASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
# Load the generic ASMInformation file:
set(ASM_DIALECT "_YASM")
include(CMakeASMInformation)
set(ASM_DIALECT)
@@ -1,27 +0,0 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
set(CMAKE_ASM_YASM_COMPILER_LIST nasm yasm)
if(NOT CMAKE_ASM_YASM_COMPILER)
find_program(CMAKE_ASM_YASM_COMPILER yasm
"$ENV{ProgramFiles}/YASM")
endif()
# Load the generic DetermineASM compiler file with the DIALECT set properly:
set(ASM_DIALECT "_YASM")
include(CMakeDetermineASMCompiler)
set(ASM_DIALECT)
@@ -1,23 +0,0 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that the selected ASM_NASM "compiler" works.
# For assembler this can only check whether the compiler has been found,
# because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture.
set(ASM_DIALECT "_YASM")
include(CMakeTestASMCompiler)
set(ASM_DIALECT)
+23 -32
View File
@@ -1,54 +1,45 @@
#!/bin/bash -e
#!/bin/sh
path="."
if [ x"$1" != x ]; then
path="$1"
fi
versiongit() {
gitbranch=`git rev-parse --abbrev-ref HEAD`
gitversion=`git rev-parse HEAD`
cat <<EOF > $path/comptime.h
version() {
cat <<EOF > "$path/comptime.h"
// Do not edit! This file was autogenerated
// by the $0 script with git
//
const char* compbranch = "$gitbranch";
const char* comprevision = "${gitversion:0:8}";
const char* compbranch = "$1";
const char* comprevision = "$2";
EOF
exit 0
}
versiongit() {
gitbranch="$(git rev-parse --abbrev-ref HEAD)"
gitversion="$(git rev-parse HEAD | cut -c -8)"
version "$gitbranch" "$gitversion";
exit 0
}
versionsvn() {
svnrevision=`svnversion -n $1`
cat <<EOF > $path/comptime.h
// Do not edit! This file was autogenerated
// by the $0 script with subversion
//
const char* compbranch = "Subversion";
const char* comprevision = "r$svnrevision";
EOF
exit 0
svnrevision="$(svnversion -n "$1")"
version "Subversion" "r$svnrevision";
exit 0
}
versionfake() {
cat <<EOF > $path/comptime.h
// Do not edit! This file was autogenerated
// by the $0 script with an unknown or nonexist SCM
//
const char* compbranch = "Unknown";
const char* comprevision = "illegal";
EOF
version "Unknown" "illegal";
}
compversion() {
touch $path/comptime.c
versionfake
test -d $path/.svn && versionsvn
test -d $path/../.git && versiongit
exit 1
touch "$path/comptime.c"
versionfake
[ -d "$path/.svn" ] && versionsvn "$@"
[ -d "$path/../.git" ] && versiongit
exit 1
}
test -f $path/comptime.c && compversion
[ -f "$path/comptime.c" ] && compversion "$@"
exit 2
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
-2
View File
@@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing
+1 -1
View File
@@ -76,7 +76,7 @@ LOCAL_SRC_FILES := am_map.c \
android/i_system.c \
android/i_video.c
LOCAL_CFLAGS += -DPLATFORM_ANDROID -DNONX86 -DLINUX -DDEBUGMODE -DNOASM -DNOPIX -DUNIXCOMMON -DNOTERMIOS
LOCAL_CFLAGS += -DPLATFORM_ANDROID -DNONX86 -DLINUX -DDEBUGMODE -DNOPIX -DUNIXCOMMON -DNOTERMIOS
LOCAL_MODULE := libsrb2
+2 -52
View File
@@ -3,6 +3,7 @@
# Core sources
set(SRB2_CORE_SOURCES
am_map.c
args.c
b_bot.c
command.c
comptime.c
@@ -52,6 +53,7 @@ set(SRB2_CORE_SOURCES
set(SRB2_CORE_HEADERS
am_map.h
args.h
b_bot.h
byteptr.h
command.h
@@ -196,32 +198,6 @@ source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS})
source_group("Renderer" FILES ${SRB2_CORE_RENDER_SOURCES})
source_group("Game" FILES ${SRB2_CORE_GAME_SOURCES})
set(SRB2_ASM_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/vid_copy.s
)
set(SRB2_NASM_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tmap_mmx.nas
${CMAKE_CURRENT_SOURCE_DIR}/tmap.nas
)
if(MSVC)
list(APPEND SRB2_NASM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tmap_vc.nas)
endif()
set(SRB2_NASM_OBJECTS
${CMAKE_CURRENT_BINARY_DIR}/tmap_mmx.obj
${CMAKE_CURRENT_BINARY_DIR}/tmap.obj
)
if(MSVC)
list(APPEND SRB2_NASM_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/tmap_vc.obj)
endif()
source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
### Configuration
set(SRB2_CONFIG_HAVE_BLUA ON CACHE BOOL
"Enable Lua interpreter support")
@@ -239,10 +215,6 @@ set(SRB2_CONFIG_HAVE_CURL ON CACHE BOOL
"Enable curl support, used for downloading files via HTTP.")
set(SRB2_CONFIG_HWRENDER ON CACHE BOOL
"Enable hardware rendering through OpenGL.")
set(SRB2_CONFIG_USEASM OFF CACHE BOOL
"Enable NASM tmap implementation for software mode speedup.")
set(SRB2_CONFIG_YASM OFF CACHE BOOL
"Use YASM in place of NASM.")
set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
"Use statically linked OpenGL. NOT RECOMMENDED.")
@@ -533,28 +505,6 @@ if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
endif()
endif()
if(${SRB2_CONFIG_USEASM})
#SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm.
if(${CMAKE_SYSTEM} MATCHES "Linux")
set(SRB2_ASM_FLAGS "-DLINUX ${SRB2_ASM_FLAGS}")
endif()
if(${SRB2_CONFIG_YASM})
set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS} nas)
set(CMAKE_ASM_YASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
enable_language(ASM_YASM)
else()
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} nas)
set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.")
enable_language(ASM_NASM)
endif()
set(SRB2_USEASM ON)
add_definitions(-DUSEASM)
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -msse3 -mfpmath=sse)
else()
set(SRB2_USEASM OFF)
add_definitions(-DNONX86 -DNORUSEASM)
endif()
# Targets
+5 -256
View File
@@ -8,14 +8,11 @@
# terms of the GNU General Public License, version 2.
# See the 'LICENSE' file for more details.
#
# -DPC_DOS -> use DOS specific code (eg:textmode stuff)...
# -DLINUX -> use for the GNU/Linux specific
# -D_WINDOWS -> use for the Win32/DirectX specific
# -DHAVE_SDL -> use for the SDL interface
#
# Sets:
# Compile the DGJPP/DOS version with 'make WATTCP=1'
# Compile the DirectX/Mingw version with 'make MINGW=1'
# Compile the Mingw version with 'make MINGW=1'
# Compile the SDL/Mingw version with 'make MINGW=1 SDL=1'
# Compile the SDL/Linux version with 'make LINUX=1'
# Compile the SDL/Solaris version with 'make SOLARIS=1'
@@ -62,7 +59,6 @@
# Compile a debug version, add 'DEBUGMODE=1'
# Compile with less warnings, add 'RELAXWARNINGS=1'
# Generate compiler errors for most compiler warnings, add 'ERRORMODE=1'
# Compile without NASM's tmap.nas, add 'NOASM=1'
# Compile without 3D hardware support, add 'NOHW=1'
# Compile with GDBstubs, add 'RDB=1'
# Compile without PNG, add 'NOPNG=1'
@@ -88,7 +84,6 @@ ALL_SYSTEMS=\
MINGW64\
HAIKU\
DUMMY\
DJGPPDOS\
MINGW\
UNIX\
LINUX\
@@ -149,10 +144,6 @@ D_FILES=$(D_DIR)/srb2.srb \
PKG_CONFIG?=pkg-config
ifdef WIILINUX
LINUX=1
endif
ifdef PANDORA
LINUX=1
endif
@@ -166,7 +157,6 @@ endif
ifdef MINGW64
MINGW=1
NONX86=1
NOASM=1
# MINGW64 should not necessarily imply X86_64=1, but we make that assumption elsewhere
# Once that changes, remove this
X86_64=1
@@ -176,12 +166,6 @@ ifdef HAIKU
SDL=1
endif
ifdef NDS
# Include this before the main Makefile.cfg
EXENAME?=srb2.elf
include nds/Makefile.cfg
endif
include Makefile.cfg
ifdef DUMMY
@@ -189,7 +173,6 @@ NOPNG=1
NOZLIB=1
NONET=1
NOHW=1
NOASM=1
NOIPX=1
EXENAME?=srb2dummy
OBJS=$(OBJDIR)/i_video.o
@@ -198,7 +181,6 @@ endif
ifdef HAIKU
NOIPX=1
NOASM=1
ifndef NONET
LIBS=-lnetwork
endif
@@ -207,35 +189,11 @@ PNG_CFLAGS?=
PNG_LDFLAGS?=-lpng
endif
ifdef WIILINUX
NONX86=1
NOTERMIOS=1
NOHW=1
CFLAGS+=-DWMINPUT
NOTERMIOS=1
NOPOSTPROCESSING=1
endif
ifdef PANDORA
NONX86=1
NOHW=1
endif
ifdef WII
NONX86=1
NOHW=1
NOPOSTPROCESSING=1
endif
ifdef PS3N
NONX86=1
NOHW=1
endif
ifdef DJGPPDOS
include djgppdos/Makefile.cfg
endif
ifndef NOOPENMPT
HAVE_OPENMPT=1
endif
@@ -267,26 +225,8 @@ ifdef MACOSX
UNIXCOMMON=1
endif
ifdef NDS
NOPNG=1
NOZLIB=1
NONET=1
#NOHW=1
NOASM=1
NOIPX=1
NONX86=1
OBJS+=$(OBJDIR)/i_video.o
LIBS+=-lm
endif
ifdef SDL
#SDL 2.0
ifndef SDL12
include sdl/Makefile.cfg
#SDL 1.2
else
include sdl12/Makefile.cfg
endif #ifndef SDL12
endif #ifdef SDL
ifdef DISTCC
@@ -300,7 +240,6 @@ endif
MSGFMT?=msgfmt
ifndef ECHO
NASM:=@$(NASM)
REMOVE:=@$(REMOVE)
CC:=@$(CC)
CXX:=@$(CXX)
@@ -331,10 +270,8 @@ endif
ifdef NOHW
OPTS+=-DNOHW
else
ifndef DC
#Hurdler: not really supported and not tested recently
#OPTS+=-DUSE_PALETTED_TEXTURE
endif
OPTS+=-DHWRENDER
OBJS+=$(OBJDIR)/hw_bsp.o $(OBJDIR)/hw_draw.o $(OBJDIR)/hw_light.o \
$(OBJDIR)/hw_main.o $(OBJDIR)/hw_clip.o $(OBJDIR)/hw_md2.o $(OBJDIR)/hw_cache.o $(OBJDIR)/hw_trick.o \
@@ -355,12 +292,6 @@ ifdef X86_64
endif
endif
ifndef NOASM
ifndef NONX86
OBJS+=$(OBJDIR)/tmap.o $(OBJDIR)/tmap_mmx.o
OPTS+=-DUSEASM
endif
endif
ifndef NOPNG
OPTS+=-DHAVE_PNG
@@ -470,14 +401,6 @@ else
OBJS:=$(OBJDIR)/md5.o $(OBJS)
endif
ifdef FAKEDC
OPTS+=-DDC
endif
ifdef FAKEPSP
OPTS+=-DPSP
endif
ifdef NOPOSTPROCESSING
OPTS+=-DNOPOSTPROCESSING
endif
@@ -511,16 +434,6 @@ else
endif
CFLAGS+=-g $(OPTS) $(ARCHOPTS) $(WINDRESFLAGS)
ifdef YASM
ifdef STABS
NASMOPTS?= -g stabs
else
NASMOPTS?= -g dwarf2
endif
else
NASMOPTS?= -g
endif
ifdef PROFILEMODE
# build with profiling information
CFLAGS+=-pg
@@ -624,9 +537,8 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/i_tcp.o \
$(OBJDIR)/i_time.o \
$(OBJDIR)/lzf.o \
$(OBJDIR)/vid_copy.o \
$(OBJDIR)/b_bot.o \
$(i_cdmus_o) \
$(OBJDIR)/args.o \
$(i_net_o) \
$(i_system_o) \
$(i_sound_o) \
@@ -642,53 +554,19 @@ POS:=$(BIN)/en.mo
OPTS+=-DGETTEXT
endif
ifdef DJGPPDOS
all: pre-build $(BIN)/$(EXENAME)
endif
ifdef XBOX
all: pre-build $(BIN)/$(BINNAME)
endif
ifdef PS3N
all: pre-build $(BIN)/$(PKGNAME)
endif
ifdef WII
all: pre-build $(BIN)/$(DOLNAME)
endif
ifdef PANDORA
all: pre-build $(BIN)/$(PNDNAME)
endif
ifdef PSP
all: pre-build $(BIN)/$(BINNAME) post-build
endif
ifdef DC
all: pre-build $(BIN)/$(BINNAME) post-build
endif
ifndef DC
ifndef PSP
ifndef XBOX
ifdef MINGW
ifndef SDL
all: pre-build $(BIN)/$(EXENAME) dll
endif
endif
endif
endif
ifdef SDL
all: pre-build $(BIN)/$(EXENAME)
endif
endif
ifdef NDS
all: $(BIN)/$(EXENAME:.elf=.nds)
endif
ifdef DUMMY
all: $(BIN)/$(EXENAME)
@@ -700,9 +578,9 @@ cleandep:
pre-build:
ifdef WINDOWSHELL
-..\comptime.bat .
-$(.)..\comptime.bat .
else
-@../comptime.sh .
-$(.)../comptime.sh .
endif
clean:
@@ -717,14 +595,8 @@ ifdef CYGWIN32
$(REMOVE) $(OBJDIR)/*.res
endif
#make a big srb2.s that is the disasm of the exe (dos only ?)
asm:
$(CC) $(LDFLAGS) $(OBJS) -o $(OBJDIR)/tmp.exe $(LIBS)
$(OBJDUMP) -d $(OBJDIR)/tmp.exe --no-show-raw-insn > srb2.s
$(REMOVE) $(OBJDIR)/tmp.exe
# executable
# NOTE: DJGPP's objcopy do not have --add-gnu-debuglink
$(BIN)/$(EXENAME): $(POS) $(OBJS)
-$(MKDIR) $(BIN)
@@ -742,12 +614,10 @@ endif
# mac os x lsdlsrb2 does not like objcopy
ifndef MACOSX
ifndef PSP
$(OBJCOPY) $(BIN)/$(EXENAME) $(BIN)/$(DBGNAME)
$(OBJCOPY) --strip-debug $(BIN)/$(EXENAME)
-$(OBJCOPY) --add-gnu-debuglink=$(BIN)/$(DBGNAME) $(BIN)/$(EXENAME)
endif
endif
ifndef NOUPX
-$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME)
endif
@@ -772,7 +642,7 @@ else
dll : opengl_dll
endif
ifdef MINGW
all_dll: opengl_dll minigl_dll ds3d_dll fmod_dll openal_dll
all_dll: opengl_dll ds3d_dll fmod_dll openal_dll
opengl_dll: $(BIN)/r_opengl.dll
$(BIN)/r_opengl.dll: $(OBJDIR)/ogl_win.o $(OBJDIR)/r_opengl.o
@@ -783,12 +653,6 @@ ifndef NOUPX
-$(UPX) $(UPX_OPTS) $@
endif
minigl_dll: $(BIN)/r_minigl.dll
$(BIN)/r_minigl.dll: $(OBJDIR)/r_minigl.o
-$(MKDIR) $(BIN)
@echo Linking R_MiniGL.dll...
$(CC) --shared $^ -o $@ -g -Wl,--add-stdcall-alias -lgdi32
ds3d_dll: $(BIN)/s_ds3d.dll
$(BIN)/s_ds3d.dll: $(OBJDIR)/s_ds3d.o
@echo Linking S_DS3d.dll...
@@ -868,16 +732,6 @@ endif
$(REMOVE) $(OBJDIR)/depend.ped
@echo "Created dependency file, depend.dep"
ifdef DC
$(OBJDIR)/v_video.o: v_video.c doomdef.h doomtype.h g_state.h m_swap.h r_local.h \
tables.h m_fixed.h screen.h command.h m_bbox.h r_main.h d_player.h \
p_pspr.h info.h d_think.h sounds.h p_mobj.h doomdata.h d_ticcmd.h \
r_data.h r_defs.h r_state.h r_bsp.h r_segs.h r_plane.h r_sky.h \
r_things.h r_draw.h v_video.h hu_stuff.h d_event.h w_wad.h console.h \
i_video.h z_zone.h doomstat.h d_clisrv.h d_netcmd.h
$(CC) $(CFLAGS) -fno-omit-frame-pointer $(WFLAGS) -c $< -o $@
endif
ifdef VALGRIND
$(OBJDIR)/z_zone.o: z_zone.c
$(CC) $(CFLAGS) $(WFLAGS) -DHAVE_VALGRIND $(VALGRIND_CFLAGS) -c $< -o $@
@@ -907,117 +761,12 @@ $(OBJDIR)/%.o: hardware/%.c
$(OBJDIR)/%.o: blua/%.c
$(CC) $(CFLAGS) $(LUA_CFLAGS) $(WFLAGS) -c $< -o $@
$(OBJDIR)/%.o: %.nas
$(NASM) $(NASMOPTS) -o $@ -f $(NASMFORMAT) $<
$(OBJDIR)/vid_copy.o: vid_copy.s asm_defs.inc
$(CC) $(OPTS) $(ASFLAGS) -x assembler-with-cpp -c $< -o $@
$(OBJDIR)/%.o: %.s
$(CC) $(OPTS) -x assembler-with-cpp -c $< -o $@
$(OBJDIR)/SRB2.res: win32/Srb2win.rc win32/afxres.h win32/resource.h
$(WINDRES) -i $< -O rc $(WINDRESFLAGS) --include-dir=win32 -o $@ -O coff
ifdef DC
$(OBJDIR)/romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d ../data -v
$(OBJDIR)/romdisk.o: romdisk.img
$(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o
$(OBJDIR)/dchelp.o: $(INTERFACE)/SRB2DC/dchelp.c
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
$(OBJDIR)/i_udp.o: $(INTERFACE)/SRB2DC/i_udp.c
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
$(BIN)/IP.BIN: $(INTERFACE)/SRB2DC/IP.BIN
$(CP) $< $@
$(BIN)/SRB2DC.cdi.pass1: $(INTERFACE)/SRB2DC/SELFBOOT.BIN
$(CP) $< $@
$(BIN)/$(BINNAME): $(BIN)/$(EXENAME)
$(KOS_OBJCOPY) -R .stack -O binary $< $@
$(BIN)/1ST_READ.BIN: $(BIN)/$(BINNAME) $(BIN)/scramble
$(BIN)/scramble $< $@
$(BIN)/scramble: $(INTERFACE)/SRB2DC/scramble.c
-$(MKDIR) $(BIN)
$(HOSTCC) $< -o $@
iso: $(BIN)/SRB2DC.iso
cdi: $(BIN)/SRB2DC.cdi
$(BIN)/SRB2DC.iso.pass1: $(BIN)/1ST_READ.BIN $(BIN)/IP.BIN
-$(MKDIR) $(BIN)/cdrom
$(CP) $(BIN)/1ST_READ.BIN $(D_FILES) $(BIN)/cdrom
$(MKISOFS) -l -r -o $@ $(BIN)/cdrom
$(BIN)/SRB2DC.iso.pass2: $(BIN)/SRB2DC.iso.pass1
$(DD) if=$< of=$@ bs=2048 skip=16 status=noxfer
$(BIN)/SRB2DC.iso: $(BIN)/SRB2DC.iso.pass2 $(BIN)/IP.BIN
@cat $(BIN)/IP.BIN $(BIN)/SRB2DC.iso.pass2 > $@
$(BIN)/SRB2DC.cdi: $(BIN)/SRB2DC.iso.pass2 $(BIN)/SRB2DC.cdi.pass1 $(BIN)/IP.BIN
@cat $(BIN)/SRB2DC.cdi.pass1 $(BIN)/IP.BIN $(BIN)/SRB2DC.iso.pass2 > $@
post-build: $(BIN)/1ST_READ.BIN
endif
ifdef XBOX
$(OBJDIR)/xboxhelp.o: $(INTERFACE)/SRB2XBOX/xboxhelp.c
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
$(BIN)/$(BINNAME): $(BIN)/$(EXENAME)
$(CXBE) -OUT:"$@" -DUMPINFO:"$(BIN)/SRB2XBOX.cxbe" -TITLE:"Sonic Robo Blast 2" $<
endif
ifdef NDS
$(BIN)/$(EXENAME:.elf=.nds): $(BIN)/$(EXENAME:.elf=.arm9)
$(NDSTOOL) -c $@ -9 $(BIN)/$(EXENAME:.elf=.arm9)
%.arm9: %.elf
$(OBJCOPY) -O binary $< $@
endif
ifdef MINGW
ifndef SDL
ifndef NOHW
$(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \
hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \
am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
$(OBJDIR)/ogl_win.o: hardware/r_opengl/ogl_win.c hardware/r_opengl/r_opengl.h \
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \
hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \
am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
$(OBJDIR)/r_minigl.o: hardware/r_minigl/r_minigl.c hardware/r_opengl/r_opengl.h \
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \
hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \
hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \
am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
endif
endif
endif
ifdef SDL
ifdef MINGW
+138 -153
View File
@@ -12,29 +12,32 @@
# to avoid a false positive with the version detection...
SUPPORTED_GCC_VERSIONS:=\
101 102\
91 92 93\
81 82 83 84\
71 72 73 74 75\
61 62 63 64\
51 52 53 54 55\
40 41 42 43 44 45 46 47 48 49
132 131 130 13\
123 122 121 120 12\
114 113 112 111 110 11\
105 104 103 102 101 100 10\
95 94 93 92 91 90\
85 84 83 82 81 80\
75 74 73 72 71 70\
64 63 62 61 60\
55 54 53 52 51 50\
49 48 47 46 45 44 43 42 41 40
LATEST_GCC_VERSION=10.2
LATEST_GCC_VERSION=13.2
# gcc or g++
ifdef PREFIX
CC=$(PREFIX)-gcc
CXX=$(PREFIX)-g++
OBJCOPY=$(PREFIX)-objcopy
OBJDUMP=$(PREFIX)-objdump
STRIP=$(PREFIX)-strip
WINDRES=$(PREFIX)-windres
CC:=$(PREFIX)-gcc
CXX:=$(PREFIX)-g++
OBJCOPY?=$(PREFIX)-objcopy
OBJDUMP?=$(PREFIX)-objdump
STRIP?=$(PREFIX)-strip
WINDRES?=$(PREFIX)-windres
else
OBJCOPY=objcopy
OBJDUMP=objdump
STRIP=strip
WINDRES=windres
OBJCOPY?=objcopy
OBJDUMP?=objdump
STRIP?=strip
WINDRES?=windres
endif
# because Apple screws with us on this
@@ -51,7 +54,10 @@ ifeq (,$(filter GCC%,$(.VARIABLES)))
version:=$(shell $(CC) --version)
# check if this is in fact GCC
ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version))))
version:=$(shell $(CC) -dumpversion)
shellversion:=$(shell $(CC) -dumpversion)
# Try to remove "-win32"
version:=$(subst -win32,.0,$(shellversion))
# Turn version into words of major, minor
v:=$(subst ., ,$(version))
@@ -71,11 +77,99 @@ ifeq (,$(filter GCC%,$(.VARIABLES)))
endif
endif
ifdef GCC132
GCC131=1
endif
ifdef GCC131
GCC130=1
endif
ifdef GCC13
GCC130=1
endif
ifdef GCC130
GCC123=1
endif
ifdef GCC123
GCC122=1
endif
ifdef GCC122
GCC121=1
endif
ifdef GCC121
GCC120=1
endif
ifdef GCC12
GCC120=1
endif
ifdef GCC120
GCC114=1
endif
ifdef GCC114
GCC113=1
endif
ifdef GCC113
GCC112=1
endif
ifdef GCC112
GCC111=1
endif
ifdef GCC111
GCC110=1
endif
ifdef GCC11
GCC110=1
endif
ifdef GCC110
GCC105=1
endif
ifdef GCC105
GCC104=1
endif
ifdef GCC104
GCC103=1
endif
ifdef GCC103
GCC102=1
endif
ifdef GCC102
GCC101=1
endif
ifdef GCC101
GCC100=1
endif
ifdef GCC10
GCC100=1
endif
ifdef GCC100
GCC93=1
endif
ifdef GCC95
GCC94=1
endif
ifdef GCC94
GCC93=1
endif
@@ -88,6 +182,14 @@ GCC91=1
endif
ifdef GCC91
GCC90=1
endif
ifdef GCC90
GCC85=1
endif
ifdef GCC85
GCC84=1
endif
@@ -104,6 +206,10 @@ GCC81=1
endif
ifdef GCC81
GCC80=1
endif
ifdef GCC80
GCC75=1
endif
@@ -124,6 +230,10 @@ GCC71=1
endif
ifdef GCC71
GCC70=1
endif
ifdef GCC70
GCC64=1
endif
@@ -140,6 +250,10 @@ GCC61=1
endif
ifdef GCC61
GCC60=1
endif
ifdef GCC60
GCC55=1
endif
@@ -160,6 +274,10 @@ GCC51=1
endif
ifdef GCC51
GCC50=1
endif
ifdef GCC50
GCC49=1
endif
@@ -204,10 +322,6 @@ ifdef GCC295
GCC29=1
endif
ifdef DC
NOCASTALIGNWARN=1
endif
OLDWFLAGS:=$(WFLAGS)
# -W -Wno-unused
WFLAGS=-Wall
@@ -264,15 +378,11 @@ endif
ifdef GCC40
WFLAGS+=-Wold-style-definition
endif
ifndef XBOX
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
endif
ifdef GCC40
WFLAGS+=-Wmissing-field-initializers
endif
ifndef XBOX
WFLAGS+=-Wmissing-noreturn
endif
#WFLAGS+=-Wmissing-format-attribute
#WFLAGS+=-Wno-multichar
#WFLAGS+=-Wno-deprecated-declarations
@@ -344,28 +454,14 @@ endif
#indicate platform and what interface use with
ifndef WINCE
ifndef XBOX
ifndef PSP
ifndef DC
ifndef WII
ifndef PS3N
ifndef LINUX
ifndef FREEBSD
ifndef CYGWIN32
ifndef MINGW
ifndef MINGW64
ifndef SDL
ifndef NDS
ifndef DUMMY
DJGPPDOS=1
endif
endif
endif
endif
endif
endif
endif
$(error No interface or platform flag defined)
endif
endif
endif
@@ -375,7 +471,6 @@ endif
endif
#determine the interface directory (where you put all i_*.c)
i_cdmus_o=$(OBJDIR)/i_cdmus.o
i_net_o=$(OBJDIR)/i_net.o
i_system_o=$(OBJDIR)/i_system.o
i_sound_o=$(OBJDIR)/i_sound.o
@@ -383,12 +478,6 @@ i_main_o=$(OBJDIR)/i_main.o
#set OBJDIR and BIN's starting place
OBJDIR=../objs
BIN=../bin
#Nasm ASM and rm
ifdef YASM
NASM?=yasm
else
NASM?=nasm
endif
REMOVE?=rm -f
CP?=cp
MKDIR?=mkdir -p
@@ -404,23 +493,12 @@ UPX_OPTS+=-q
endif
#Interface Setup
ifdef DJGPPDOS
INTERFACE=djgppdos
NASMFORMAT=coff
OBJDIR:=$(OBJDIR)/djgppdos
ifdef WATTCP
OBJDIR:=$(OBJDIR)/wattcp
endif
WFLAGS+=-Wno-format
BIN:=$(BIN)/Dos
else
ifdef DUMMY
INTERFACE=dummy
OBJDIR:=$(OBJDIR)/dummy
BIN:=$(BIN)/dummy
else
ifdef LINUX
NASMFORMAT=elf -DLINUX
SDL=1
ifdef LINUX64
OBJDIR:=$(OBJDIR)/Linux64
@@ -432,7 +510,6 @@ endif
else
ifdef FREEBSD
INTERFACE=sdl
NASMFORMAT=elf -DLINUX
SDL=1
OBJDIR:=$(OBJDIR)/FreeBSD
@@ -440,7 +517,6 @@ ifdef FREEBSD
else
ifdef SOLARIS
INTERFACE=sdl
NASMFORMAT=elf -DLINUX
SDL=1
OBJDIR:=$(OBJDIR)/Solaris
@@ -448,7 +524,6 @@ ifdef SOLARIS
else
ifdef CYGWIN32
INTERFACE=sdl
NASMFORMAT=win32
SDL=1
OBJDIR:=$(OBJDIR)/cygwin
@@ -456,83 +531,13 @@ ifdef CYGWIN32
else
ifdef MINGW64
INTERFACE=win32
#NASMFORMAT=win64
OBJDIR:=$(OBJDIR)/Mingw64
BIN:=$(BIN)/Mingw64
else
ifdef WII
INTERFACE=sdl12
NONX86=1
STATIC=1
PREFIX?=powerpc-eabi
SDL=1
SDL12=1
SDLMAIN=1
OBJDIR:=$(OBJDIR)/Wii
BIN:=$(BIN)/Wii
NOUPX=1
else
ifdef PS3N
INTERFACE=sdl12
NONX86=1
STATIC=1
PREFIX?=ppu
SDL=1
SDL12=1
# unsure?
#SDLMAIN=1
# can't compile SDL_mixer for ps3...
NOMIXER=1
OBJDIR:=$(OBJDIR)/PS3
BIN:=$(BIN)/PS3
else
ifdef MINGW
INTERFACE=win32
NASMFORMAT=win32
OBJDIR:=$(OBJDIR)/Mingw
BIN:=$(BIN)/Mingw
else
ifdef XBOX
INTERFACE=sdl12
NASMFORMAT=win32
PREFIX?=/usr/local/openxdk/bin/i386-pc-xbox
SDL=1
SDL12=1
OBJDIR:=$(OBJDIR)/XBOX
BIN:=$(BIN)/XBOX
else
ifdef PSP
INTERFACE=sdl12
NONX86=1
SDL=1
SDL12=1
OBJDIR:=$(OBJDIR)/PSP
BIN:=$(BIN)/PSP
NOUPX=1
else
ifdef DC
INTERFACE=sdl12
NONX86=1
SDL=1
SDL12=1
OBJDIR:=$(OBJDIR)/DC
BIN:=$(BIN)/DC
NOUPX=1
else
ifdef WINCE
INTERFACE=sdl12
NONX86=1
PREFIX?=arm-wince-pe
SDL=1
SDL12=1
OBJDIR:=$(OBJDIR)/WinCE
BIN:=$(BIN)/WinCE
else
ifdef NDS
INTERFACE=nds
OBJDIR:=$(OBJDIR)/nds
BIN:=$(BIN)/nds
NOUPX=1
endif
endif
endif
@@ -540,20 +545,6 @@ endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
ifdef GP2X
ifdef SDL
SDL12=1
endif
endif
ifdef ARCHNAME
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
@@ -564,13 +555,7 @@ OBJDUMP_OPTS?=--wide --source --line-numbers
LD=$(CC)
ifdef SDL
# SDL 2.0
ifndef SDL12
INTERFACE=sdl
# SDL 1.2
else
INTERFACE=sdl12
endif
OBJDIR:=$(OBJDIR)/SDL
endif
-5
View File
@@ -42,11 +42,6 @@ static const UINT8 NOCLIMBGRAYS = 204;
static const UINT8 NOCLIMBBROWNS = (2*16);
static const UINT8 NOCLIMBYELLOWS = (11*16);
#ifdef _NDS
#undef BACKGROUND
#endif
// Automap colors
#define BACKGROUND DBLACK
#define WALLCOLORS (REDS + REDRANGE/2)
+1 -1
View File
@@ -24,7 +24,7 @@ static INT64 start_time; // as microseconds since the epoch
// I should probably return how much memory is remaining
// for this process, considering Android's process memory limit.
UINT32 I_GetFreeMem(UINT32 *total)
size_t I_GetFreeMem(size_t *total)
{
// what the heck? sysinfo() is partially missing in bionic?
/* struct sysinfo si; */
-43
View File
@@ -1,43 +0,0 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file asm_defs.inc
/// \brief must match the C structures
#ifndef __ASM_DEFS__
#define __ASM_DEFS__
// this makes variables more noticable,
// and make the label match with C code
// Linux, unlike DOS, has no "_" 19990119 by Kin
// and nasm needs .data code segs under linux 20010210 by metzgermeister
// FIXME: nasm ignores these settings, so I put the macros into the makefile
#ifdef __ELF__
#define C(label) label
#define CODE_SEG .data
#else
#define C(label) _##label
#define CODE_SEG .text
#endif
/* This is a more readable way to access the arguments passed from C code */
/* PLEASE NOTE: it is supposed that all arguments passed from C code are */
/* 32bit integer (INT32, long, and most *pointers) */
#define ARG1 8(%ebp)
#define ARG2 12(%ebp)
#define ARG3 16(%ebp)
#define ARG4 20(%ebp)
#define ARG5 24(%ebp)
#define ARG6 28(%ebp)
#define ARG7 32(%ebp)
#define ARG8 36(%ebp)
#define ARG9 40(%ebp) //(c)tm ... Allegro by Shawn Hargreaves.
#endif
+11 -12
View File
@@ -686,6 +686,15 @@ static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) {
}
static void codeunaryarith (FuncState *fs, OpCode op, expdesc *e) {
expdesc e2;
e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
if (!isnumeral(e))
luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */
codearith(fs, op, e, &e2);
}
static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1,
expdesc *e2) {
int o1 = luaK_exp2RK(fs, e1);
@@ -706,18 +715,8 @@ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
expdesc e2;
e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
switch (op) {
case OPR_MINUS: {
if (!isnumeral(e))
luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */
codearith(fs, OP_UNM, e, &e2);
break;
}
case OPR_BNOT: {
if (e->k == VK)
luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */
codearith(fs, OP_BNOT, e, &e2);
break;
}
case OPR_MINUS: codeunaryarith(fs, OP_UNM, e); break;
case OPR_BNOT: codeunaryarith(fs, OP_BNOT, e); break;
case OPR_NOT: codenot(fs, e); break;
case OPR_LEN: {
luaK_exp2anyreg(fs, e); /* cannot operate on constants */
-2
View File
@@ -445,7 +445,6 @@ static int io_readline (lua_State *L) {
static int g_write (lua_State *L, FILE *f, int arg) {
int nargs = lua_gettop(L) - 1;
int status = 1;
size_t count;
for (; nargs--; arg++) {
if (lua_type(L, arg) == LUA_TNUMBER) {
/* optimization: could be done exactly as for strings */
@@ -455,7 +454,6 @@ static int g_write (lua_State *L, FILE *f, int arg) {
else {
size_t l;
const char *s = luaL_checklstring(L, arg, &l);
count += l;
if (ftell(f) + l > FILELIMIT)
{
luaL_error(L,"write limit bypassed in file. Changes have been discarded.");
+13 -6
View File
@@ -277,7 +277,7 @@ static xcommand_t *com_commands = NULL; // current commands
#define MAX_ARGS 80
static size_t com_argc;
static char *com_argv[MAX_ARGS];
char *com_argv[MAX_ARGS];
static const char *com_null_string = "";
static char *com_args = NULL; // current command args or NULL
@@ -327,6 +327,16 @@ const char *COM_Argv(size_t arg)
return com_argv[arg];
}
/** Returns all of the console command arguments
*
* \return String pointer to the argv table.
* \sa COM_ArgvList
*/
char **COM_ArgvList(void)
{
return com_argv;
}
/** Gets all console command arguments.
*
* \return String pointer to all arguments for the last command.
@@ -1445,7 +1455,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -1464,9 +1474,6 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
CONS_Alert(CONS_WARNING, "Netvar not found with netid %hu\n", netid);
return;
}
#if 0 //defined (GP2X) || defined (PSP)
CONS_Printf("Netvar received: %s [netid=%d] value %s\n", cvar->name, netid, svalue);
#endif
DEBFILE(va("Netvar received: %s [netid=%d] value %s\n", cvar->name, netid, svalue));
Setvalue(cvar, svalue, stealth);
@@ -1587,7 +1594,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
if (var->flags & CV_NETVAR)
{
// send the value of the variable
XBOXSTATIC UINT8 buf[128];
UINT8 buf[128];
UINT8 *p = buf;
if (!(server || (IsPlayerAdmin(consoleplayer))))
{
+4
View File
@@ -33,8 +33,12 @@ typedef void (*com_func_t)(void);
void COM_AddCommand(const char *name, com_func_t func);
int COM_AddLuaCommand(const char *name);
#define MAX_ARGS 80
extern char *com_argv[MAX_ARGS];
size_t COM_Argc(void);
const char *COM_Argv(size_t arg); // if argv > argc, returns empty string
char **COM_ArgvList(void);
char *COM_Args(void);
size_t COM_CheckParm(const char *check); // like M_CheckParm :)
size_t COM_CheckPartialParm(const char *check);
+35 -60
View File
@@ -12,9 +12,6 @@
#ifdef __GNUC__
#include <unistd.h>
#ifdef _XBOX
#include <openxdk/debug.h>
#endif
#endif
#include "doomdef.h"
@@ -23,6 +20,7 @@
#include "g_input.h"
#include "hu_stuff.h"
#include "keys.h"
#include "r_main.h"
#include "r_defs.h"
#include "sounds.h"
#include "st_stuff.h"
@@ -36,10 +34,6 @@
#include "m_menu.h"
#include "filesrch.h"
#ifdef _WINDOWS
#include "win32/win_main.h"
#endif
#ifdef HWRENDER
#include "hardware/hw_main.h"
#endif
@@ -374,14 +368,10 @@ static void CON_SetupColormaps(void)
CON_SetupBackColormap();
}
//
// Setup the console text buffer
//
// for WII, libogc already has a CON_Init function, we must rename it here
#ifdef _WII
void CON_InitWii(void)
#else
void CON_Init(void)
#endif
{
INT32 i;
@@ -456,6 +446,8 @@ void CON_Init(void)
Unlock_state();
}
}
//
// Console input initialization
//
static void CON_InputInit(void)
@@ -602,32 +594,38 @@ static void CON_ChangeHeight(void)
//
static void CON_MoveConsole(void)
{
fixed_t conspeed;
static fixed_t fracmovement = 0;
Lock_state();
conspeed = FixedDiv(cons_speed.value*vid.fdupy, FRACUNIT);
// instant
if (!cons_speed.value)
{
con_curlines = con_destlines;
Unlock_state();
return;
}
// up/down move to dest
if (con_curlines < con_destlines)
// Not instant - Increment fracmovement fractionally
fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics);
if (con_curlines < con_destlines) // Move the console downwards
{
con_curlines += FixedInt(conspeed);
if (con_curlines > con_destlines)
con_curlines = con_destlines;
con_curlines += FixedInt(fracmovement); // Move by fracmovement's integer value
if (con_curlines > con_destlines) // If we surpassed the destination...
con_curlines = con_destlines; // ...clamp to it!
}
else if (con_curlines > con_destlines)
else // Move the console upwards
{
con_curlines -= FixedInt(conspeed);
con_curlines -= FixedInt(fracmovement);
if (con_curlines < con_destlines)
con_curlines = con_destlines;
if (con_destlines == 0) // If the console is being closed, not just moved up...
con_tick = 0; // ...don't show the blinking cursor
}
fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction
Unlock_state();
}
@@ -724,10 +722,6 @@ void CON_Ticker(void)
CON_ChangeHeight();
}
// console movement
if (con_destlines != con_curlines)
CON_MoveConsole();
// clip the view, so that the part under the console is not drawn
con_clipviewtop = -1;
if (cons_backpic.value) // clip only when using an opaque background
@@ -1148,7 +1142,10 @@ boolean CON_Responder(event_t *ev)
CONS_Printf("\x86""%c""\x80""%s\n", CON_PROMPTCHAR, inputlines[inputline]);
inputline = (inputline+1) & 31;
// Only add command to history if it differs from previous one
if (strcmp(inputlines[inputline], inputlines[(inputline-1) & 31]))
inputline = (inputline+1) & 31;
inputhist = inputline;
CON_InputClear();
@@ -1215,10 +1212,10 @@ boolean CON_Responder(event_t *ev)
// allow people to use keypad in console (good for typing IP addresses) - Calum
if (key >= KEY_KEYPAD7 && key <= KEY_KPADDEL)
{
XBOXSTATIC char keypad_translation[] = {'7','8','9','-',
'4','5','6','+',
'1','2','3',
'0','.'};
char keypad_translation[] = {'7','8','9','-',
'4','5','6','+',
'1','2','3',
'0','.'};
key = keypad_translation[key - KEY_KEYPAD7];
}
@@ -1376,7 +1373,7 @@ static void CON_Print(char *msg)
void CON_LogMessage(const char *msg)
{
XBOXSTATIC char txt[8192], *t;
char txt[8192], *t;
const char *p = msg, *e = txt+sizeof (txt)-2;
for (t = txt; *p != '\0'; p++)
@@ -1413,28 +1410,12 @@ void CONS_Printf(const char *fmt, ...)
va_end(argptr);
// echo console prints to log file
#ifndef _arch_dreamcast
DEBFILE(txt);
#endif
if (!con_started)
{
#if defined (_XBOX) && defined (__GNUC__)
if (!keyboard_started) debugPrint(txt);
#endif
#ifdef PC_DOS
CON_LogMessage(txt);
free(txt);
return;
#endif
}
else
// write message in con text buffer
if (con_started)
CON_Print(txt);
#ifndef PC_DOS
CON_LogMessage(txt);
#endif
Lock_state();
@@ -1447,19 +1428,9 @@ void CONS_Printf(const char *fmt, ...)
// if not in display loop, force screen update
if (startup)
{
#if (defined (_WINDOWS)) || (defined (__OS2__) && !defined (HAVE_SDL))
patch_t *con_backpic = W_CachePatchName("KARTKREW", PU_CACHE);
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch
V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, con_backpic, NULL);
W_UnlockCachedPatch(con_backpic);
I_LoadingScreen(txt); // Win32/OS2 only
#else
// here we display the console text
CON_Drawer();
I_FinishUpdate(); // page flip or blit buffer
#endif
}
}
@@ -1774,6 +1745,10 @@ void CON_Drawer(void)
if (con_curlines <= 0)
CON_ClearHUD();
}
// console movement
if (con_curlines != con_destlines)
CON_MoveConsole();
if (con_curlines > 0)
CON_DrawConsole();
-4
View File
@@ -14,11 +14,7 @@
#include "command.h"
#include "i_threads.h"
#ifdef _WII
void CON_InitWii(void);
#else
void CON_Init(void);
#endif
boolean CON_Responder(event_t *ev);
+49 -46
View File
@@ -10,9 +10,7 @@
/// \file d_clisrv.c
/// \brief SRB2 Network game communication and protocol, all OS independent parts.
#if !defined (UNDER_CE)
#include <time.h>
#endif
#ifdef __GNUC__
#include <unistd.h> //for unlink
#endif
@@ -56,10 +54,6 @@
#include "f_finale.h"
#endif
#ifdef _XBOX
#include "sdl12/SRB2XBOX/xboxhelp.h"
#endif
#ifdef HAVE_DISCORDRPC
#include "discord.h"
#endif
@@ -452,7 +446,7 @@ static void ExtraDataTicker(void)
{
if (server)
{
XBOXSTATIC UINT8 buf[3];
UINT8 buf[3];
buf[0] = (UINT8)i;
buf[1] = KICK_MSG_CON_FAIL;
@@ -1073,7 +1067,7 @@ static void SV_SendResynch(INT32 node)
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)nodetoplayer[node];
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
@@ -1833,7 +1827,7 @@ static void SV_SavedGame(void)
{
size_t length;
UINT8 *savebuffer;
XBOXSTATIC char tmpsave[264];
char tmpsave[264];
if (!cv_dumpconsistency.value)
return;
@@ -1875,7 +1869,7 @@ static void CL_LoadReceivedSavegame(void)
{
UINT8 *savebuffer = NULL;
size_t length, decompressedlen;
XBOXSTATIC char tmpsave[264];
char tmpsave[264];
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
@@ -2639,7 +2633,7 @@ static void CL_ConnectToServer(void)
tic_t asksent;
#endif
#ifdef JOININGAME
XBOXSTATIC char tmpsave[264];
char tmpsave[264];
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
#endif
@@ -3381,7 +3375,7 @@ static void Command_Ban(void)
if (server || IsPlayerAdmin(consoleplayer))
{
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 *p = buf;
const SINT8 pn = nametonum(COM_Argv(1));
@@ -3498,7 +3492,7 @@ static void Command_Kick(void)
if (server || IsPlayerAdmin(consoleplayer))
{
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 *p = buf;
const SINT8 pn = nametonum(COM_Argv(1));
@@ -3550,7 +3544,7 @@ static void Command_Kick(void)
static void Got_KickCmd(UINT8 **p, INT32 playernum)
{
INT32 pnum, msg;
XBOXSTATIC char buf[3 + MAX_REASONLENGTH];
char buf[3 + MAX_REASONLENGTH];
char *reason = buf;
kickreason_t kickreason = KR_KICK;
UINT32 banMinutes = 0;
@@ -4124,7 +4118,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4209,7 +4203,7 @@ static void Got_RemovePlayer(UINT8 **p, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal remove player command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4231,7 +4225,7 @@ static void Got_RemovePlayer(UINT8 **p, INT32 playernum)
static boolean SV_AddWaitingPlayers(void)
{
INT32 node, n, newplayer = false;
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
UINT8 newplayernum = 0;
// What is the reason for this? Why can't newplayernum always be 0?
@@ -4304,7 +4298,7 @@ void CL_AddSplitscreenPlayer(void)
void CL_RemoveSplitscreenPlayer(UINT8 p)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
if (cl_mode != CL_CONNECTED)
return;
@@ -4890,7 +4884,7 @@ static boolean CheckForSpeedHacks(UINT8 p)
|| netcmds[maketic%TICQUEUE][p].sidemove > MAXPLMOVE || netcmds[maketic%TICQUEUE][p].sidemove < -MAXPLMOVE
|| netcmds[maketic%TICQUEUE][p].driftturn > KART_FULLTURN || netcmds[maketic%TICQUEUE][p].driftturn < -KART_FULLTURN)
{
XBOXSTATIC char buf[2];
char buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), playernode[p]);
//D_Clearticcmd(k);
@@ -4912,11 +4906,11 @@ static boolean CheckForSpeedHacks(UINT8 p)
*
*/
static void HandlePacketFromPlayer(SINT8 node)
{FILESTAMP
XBOXSTATIC INT32 netconsole;
XBOXSTATIC tic_t realend, realstart;
XBOXSTATIC UINT8 *pak, *txtpak, numtxtpak;
FILESTAMP
{
INT32 netconsole;
tic_t realend, realstart;
UINT8 *pak, *txtpak, numtxtpak;
txtpak = NULL;
@@ -4987,26 +4981,36 @@ FILESTAMP
/// \todo Use a separate cvar for that kind of timeout?
freezetimeout[node] = I_GetTime() + connectiontimeout;
//Ported this from 2.2 Prevent dropped ticcmds due to interp timing jutter
// If we've alredy received a ticcmd for this tic, just submit it for the next one.
tic_t faketic = maketic;
if ((!!(netcmds[maketic % TICQUEUE][netconsole].angleturn & TICCMD_RECEIVED))
&& (maketic - firstticstosend < TICQUEUE - 1))
faketic++;
// Don't do anything for packets of type NODEKEEPALIVE?
// Sryder 2018/07/01: Update the freezetimeout still!
if (netbuffer->packettype == PT_NODEKEEPALIVE
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
break;
// Copy ticcmd
G_MoveTiccmd(&netcmds[maketic%TICQUEUE][netconsole], &netbuffer->u.clientpak.cmd, 1);
// Copy ticcmd Prevent dropped ticcmds due to interp timing jutter
G_MoveTiccmd(&netcmds[faketic%TICQUEUE][netconsole], &netbuffer->u.clientpak.cmd, 1);
// Check ticcmd for "speed hacks"
if (CheckForSpeedHacks((UINT8)netconsole))
break;
// Splitscreen cmd
// Splitscreen cmd Prevent dropped ticcmds due to interp timing jutter
if (((netbuffer->packettype == PT_CLIENT2CMD || netbuffer->packettype == PT_CLIENT2MIS)
|| (netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
&& (nodetoplayer2[node] >= 0))
{
G_MoveTiccmd(&netcmds[maketic%TICQUEUE][(UINT8)nodetoplayer2[node]],
G_MoveTiccmd(&netcmds[faketic%TICQUEUE][(UINT8)nodetoplayer2[node]],
&netbuffer->u.client2pak.cmd2, 1);
if (CheckForSpeedHacks((UINT8)nodetoplayer2[node]))
@@ -5017,7 +5021,7 @@ FILESTAMP
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
&& (nodetoplayer3[node] >= 0))
{
G_MoveTiccmd(&netcmds[maketic%TICQUEUE][(UINT8)nodetoplayer3[node]],
G_MoveTiccmd(&netcmds[faketic%TICQUEUE][(UINT8)nodetoplayer3[node]],
&netbuffer->u.client3pak.cmd3, 1);
if (CheckForSpeedHacks((UINT8)nodetoplayer3[node]))
@@ -5027,7 +5031,7 @@ FILESTAMP
if ((netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)
&& (nodetoplayer4[node] >= 0))
{
G_MoveTiccmd(&netcmds[maketic%TICQUEUE][(UINT8)nodetoplayer4[node]],
G_MoveTiccmd(&netcmds[faketic%TICQUEUE][(UINT8)nodetoplayer4[node]],
&netbuffer->u.client4pak.cmd4, 1);
if (CheckForSpeedHacks((UINT8)nodetoplayer4[node]))
@@ -5061,7 +5065,7 @@ FILESTAMP
}
else
{
XBOXSTATIC UINT8 buf[3];
UINT8 buf[3];
buf[0] = (UINT8)netconsole;
buf[1] = KICK_MSG_CON_FAIL;
@@ -5174,7 +5178,7 @@ FILESTAMP
nodewaiting[node] = 0;
if (netconsole != -1 && playeringame[netconsole])
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)netconsole;
if (netbuffer->packettype == PT_NODETIMEOUT)
buf[1] = KICK_MSG_TIMEOUT;
@@ -5219,7 +5223,7 @@ FILESTAMP
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
@@ -5244,7 +5248,7 @@ FILESTAMP
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
@@ -5311,7 +5315,7 @@ FILESTAMP
if (server)
{
XBOXSTATIC char buf[2];
char buf[2];
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
@@ -5330,7 +5334,7 @@ FILESTAMP
if (server)
{
XBOXSTATIC char buf[2];
char buf[2];
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
@@ -5361,7 +5365,7 @@ FILESTAMP
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
@@ -5384,9 +5388,9 @@ FILESTAMP
*
*/
static void GetPackets(void)
{FILESTAMP
XBOXSTATIC SINT8 node; // The packet sender
FILESTAMP
{
SINT8 node; // The packet sender
player_joining = false;
@@ -6085,7 +6089,7 @@ static inline void PingUpdate(void)
UINT8 minimumkicklevel = (nonlaggers > 0) ? PINGKICK_LIMIT : PINGKICK_TICQUEUE;
for (i = 0; i < MAXPLAYERS; i++)
{
XBOXSTATIC char buf[2];
char buf[2];
if (!playeringame[i] || pingkick[i] < minimumkicklevel)
continue;
@@ -6190,10 +6194,9 @@ void NetKeepAlive(void)
UpdatePingTable();
// Sryder: What is FILESTAMP???
FILESTAMP
// Sryder: What is FILESTAMP??? << lmao
GetPackets();
FILESTAMP
#ifdef MASTERSERVER
MasterClient_Ticker();
@@ -6305,9 +6308,9 @@ void NetUpdate(void)
if (server)
CL_SendClientCmd(); // send it
FILESTAMP
GetPackets(); // get packet from client or from server
FILESTAMP
// client send the command after a receive of the server
// the server send before because in single player is beter
+55 -115
View File
@@ -15,7 +15,7 @@
/// plus functions to parse command line parameters, configure game
/// parameters, and call the startup functions.
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
#include <sys/stat.h>
#include <sys/types.h>
#endif
@@ -24,22 +24,12 @@
#include <unistd.h> // for getcwd
#endif
#ifdef PC_DOS
#include <stdio.h> // for snprintf
int snprintf(char *str, size_t n, const char *fmt, ...);
//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
#endif
#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX)
#ifdef _WIN32
#include <direct.h>
#include <malloc.h>
#endif
#if !defined (UNDER_CE)
#include <time.h>
#elif defined (_XBOX)
#define NO_TIME
#endif
#include "doomdef.h"
#include "am_map.h"
@@ -86,18 +76,10 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "config.h.in"
#endif
#ifdef _XBOX
#include "sdl12/SRB2XBOX/xboxhelp.h"
#endif
#ifdef HWRENDER
#include "hardware/hw_main.h" // 3D View Rendering
#endif
#ifdef _WINDOWS
#include "win32/win_main.h" // I_DoStartupMouse
#endif
#ifdef HW3SOUND
#include "hardware/hw3sound.h"
#endif
@@ -134,19 +116,11 @@ INT32 postimgparam[MAXSPLITSCREENPLAYERS];
// These variables are only true if
// whether the respective sound system is disabled
// or they're init'ed, but the player just toggled them
#ifdef _XBOX
#ifndef NO_MIDI
boolean midi_disabled = true;
#endif
boolean sound_disabled = true;
boolean digital_disabled = true;
#else
#ifndef NO_MIDI
boolean midi_disabled = false;
#endif
boolean sound_disabled = false;
boolean digital_disabled = false;
#endif
#ifdef DEBUGFILE
INT32 debugload = 0;
@@ -154,13 +128,8 @@ INT32 debugload = 0;
char savegamename[256];
#ifdef _arch_dreamcast
char srb2home[256] = "/cd";
char srb2path[256] = "/cd";
#else
char srb2home[256] = ".";
char srb2path[256] = ".";
#endif
boolean usehome = true;
const char *pandf = "%s" PATHSEP "%s";
@@ -185,10 +154,6 @@ void D_PostEvent(const event_t *ev)
events[eventhead] = *ev;
eventhead = (eventhead+1) & (MAXEVENTS-1);
}
// just for lock this function
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void) {};
#endif
// modifier keys
// Now handled in I_OsPolling
@@ -663,11 +628,6 @@ void D_SRB2Loop(void)
// Pushing of + parameters is now done back in D_SRB2Main, not here.
#ifdef _WINDOWS
CONS_Printf("I_StartupMouse()...\n");
I_DoStartupMouse();
#endif
I_UpdateTime(cv_timescale.value);
oldentertics = I_GetTime();
@@ -802,9 +762,6 @@ void D_SRB2Loop(void)
// consoleplayer -> displayplayers (hear sounds from viewpoint)
S_UpdateSounds(); // move positional sounds
// check for media change, loop music..
I_UpdateCD();
#ifdef HW3SOUND
HW3S_EndFrameUpdate();
#endif
@@ -958,13 +915,20 @@ static boolean AddIWAD(void)
}
boolean found_extra_kart;
boolean found_extra2_kart;
boolean snw_speedo; // snowy speedometer check
boolean clr_hud; // colour hud check
boolean big_lap; // bigger lap counter
boolean big_lap_color; // bigger lap counter but colour
static void IdentifyVersion(void)
{
const char *srb2waddir = NULL;
found_extra_kart = false;
found_extra2_kart = false;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
// change to the directory where 'srb2.srb' is found
srb2waddir = I_LocateWad();
#endif
@@ -976,17 +940,11 @@ static void IdentifyVersion(void)
}
else
{
#if !defined(_WIN32_WCE) && !defined(_PS3)
if (getcwd(srb2path, 256) != NULL)
srb2waddir = srb2path;
else
#endif
{
#ifdef _arch_dreamcast
srb2waddir = "/cd";
#else
srb2waddir = srb2path;
#endif
}
}
@@ -1020,6 +978,12 @@ static void IdentifyVersion(void)
D_AddFile(va(pandf,srb2waddir,"extra.kart"), startupwadfiles);
found_extra_kart = true;
}
// completely optional 2: Back with a vengence
if (FIL_ReadFileOK(va(pandf,srb2waddir,"extra2.kart"))) {
D_AddFile(va(pandf,srb2waddir,"extra2.kart"), startupwadfiles);
found_extra2_kart = true;
}
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
#define MUSICTEST(str) \
@@ -1037,28 +1001,6 @@ static void IdentifyVersion(void)
#endif
}
/* ======================================================================== */
// Just print the nice red titlebar like the original SRB2 for DOS.
/* ======================================================================== */
#ifdef PC_DOS
static inline void D_Titlebar(char *title1, char *title2)
{
// SRB2 banner
clrscr();
textattr((BLUE<<4)+WHITE);
clreol();
cputs(title1);
// standard srb2 banner
textattr((RED<<4)+WHITE);
clreol();
gotoxy((80-strlen(title2))/2, 2);
cputs(title2);
normvideo();
gotoxy(1,3);
}
#endif
//
// Center the title string, then add the date and time of compilation.
//
@@ -1086,7 +1028,6 @@ static inline void D_MakeTitleString(char *s)
strcpy(s, temp);
}
//
// D_SRB2Main
//
@@ -1117,7 +1058,7 @@ void D_SRB2Main(void)
"in this program.\n\n");
// keep error messages until the final flush(stderr)
#if !defined (PC_DOS) && !defined (_WIN32_WCE) && !defined(NOTERMIOS)
#if !defined(NOTERMIOS)
if (setvbuf(stderr, NULL, _IOFBF, 1000))
I_OutputMsg("setvbuf didnt work\n");
#endif
@@ -1139,29 +1080,23 @@ void D_SRB2Main(void)
// identify the main IWAD file to use
IdentifyVersion();
#if !defined (_WIN32_WCE) && !defined(NOTERMIOS)
#if !defined(NOTERMIOS)
setbuf(stdout, NULL); // non-buffered output
#endif
#if defined (_WIN32_WCE) //|| defined (_DEBUG) || defined (GP2X)
#if 0 //defined (_DEBUG)
devparm = M_CheckParm("-nodebug") == 0;
#else
devparm = M_CheckParm("-debug") != 0;
#endif
// for dedicated server
#if !defined (_WINDOWS) //already check in win_main.c
dedicated = M_CheckParm("-dedicated") != 0;
#endif
strcpy(title, "SRB2Kart");
strcpy(srb2, "SRB2Kart");
D_MakeTitleString(srb2);
#ifdef PC_DOS
D_Titlebar(srb2, title);
#endif
#if defined (__OS2__) && !defined (HAVE_SDL)
// set PM window title
snprintf(pmData->title, sizeof (pmData->title),
@@ -1183,13 +1118,8 @@ void D_SRB2Main(void)
if (!userhome)
{
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (DC) && !defined (PSP) && !defined(GP2X)
#if (defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)
I_Error("Please set $HOME to your home directory\n");
#elif defined (_WIN32_WCE) && 0
if (dedicated)
snprintf(configfile, sizeof configfile, "/Storage Card/SRB2DEMO/d"CONFIGFILENAME);
else
snprintf(configfile, sizeof configfile, "/Storage Card/SRB2DEMO/"CONFIGFILENAME);
#else
if (dedicated)
snprintf(configfile, sizeof configfile, "d"CONFIGFILENAME);
@@ -1246,10 +1176,6 @@ void D_SRB2Main(void)
fclose(tmpfile);
remove(testfile);
}
#ifdef _arch_dreamcast
strcpy(downloaddir, "/ram"); // the dreamcast's TMP
#endif
}
D_SetupProtocol();
@@ -1345,8 +1271,31 @@ void D_SRB2Main(void)
#endif //ifndef DEVELOP
if (found_extra_kart) // found the funny, add it in!
mainwads++;
if (found_extra_kart || found_extra2_kart) // found the funny, add it in!
{
// HAYA: These are seperated for a reason lmao
if (found_extra_kart)
mainwads++;
if (found_extra2_kart)
mainwads++;
// now check for speedometer stuff
if (W_CheckMultipleLumps("SP_SMSTC", "K_TRNULL", "SP_MKMH", "SP_MMPH", "SP_MFRAC", "SP_MPERC", NULL))
snw_speedo = true;
// check for bigger lap count
if (W_CheckMultipleLumps("K_STLAPB", "K_STLA2B", NULL))
big_lap = true;
// now check for colour hud stuff
if (W_CheckMultipleLumps("K_SCTIME", "K_SCTIMW", "K_SCLAPS", "K_SCLAPW", \
"K_SCBALN", "K_SCBALW", "K_SCKARM", "K_SCTOUT", "K_ISMULC", "K_ITMULC", "K_ITBC","K_ITBCD", "K_ISBC", "K_ISBCD", NULL))
clr_hud = true;
// check for bigger lap count but color** its color bitch
if (W_CheckMultipleLumps("K_SCLAPB", "K_SCLA2B", NULL))
big_lap_color = true;
}
//
// search for maps
@@ -1416,6 +1365,13 @@ void D_SRB2Main(void)
CONS_Printf("I_StartupGraphics()...\n");
I_StartupGraphics();
#ifdef HWRENDER
// Lactozilla: Add every hardware mode CVAR and CCMD.
// Has to be done before the configuration file loads,
// but after the OpenGL library loads.
HWR_AddCommands();
#endif
#ifdef HWRENDER
if (rendermode == render_opengl)
{
@@ -1433,12 +1389,7 @@ void D_SRB2Main(void)
HU_Init();
COM_Init();
// libogc has a CON_Init function, we must rename SRB2's CON_Init in WII/libogc
#ifndef _WII
CON_Init();
#else
CON_InitWii();
#endif
D_RegisterServerCommands();
D_RegisterClientCommands(); // be sure that this is called before D_CheckNetGame
@@ -1452,7 +1403,7 @@ void D_SRB2Main(void)
G_LoadGameData();
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
#if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
#endif
@@ -1482,10 +1433,6 @@ void D_SRB2Main(void)
}
}
// Initialize CD-Audio
if (M_CheckParm("-usecd") && !dedicated)
I_InitCD();
if (M_CheckParm("-noupload"))
COM_BufAddText("downloading 0\n");
@@ -1772,26 +1719,19 @@ const char *D_Home(void)
#ifdef ANDROID
return "/data/data/org.srb2/";
#endif
#ifdef _arch_dreamcast
char VMUHOME[] = "HOME=/vmu/a1";
putenv(VMUHOME); //don't use I_PutEnv
#endif
if (M_CheckParm("-home") && M_IsNextParm())
userhome = M_GetNextParm();
else
{
#if defined (GP2X)
usehome = false; //let use the CWD
return NULL;
#elif !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__) && !defined(_WIN32_WCE)
#if !(defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON))
if (FIL_FileOK(CONFIGFILENAME))
usehome = false; // Let's NOT use home
else
#endif
userhome = I_GetEnv("HOME"); //Alam: my new HOME for srb2
}
#if defined (_WIN32) && !defined(_WIN32_WCE) //Alam: only Win32 have APPDATA and USERPROFILE
#ifdef _WIN32 //Alam: only Win32 have APPDATA and USERPROFILE
if (!userhome && usehome) //Alam: Still not?
{
char *testhome = NULL;
+6 -3
View File
@@ -26,6 +26,12 @@ extern const char *pandf; //Alam: how to path?
extern char srb2path[256]; //Alam: SRB2's Home
extern boolean found_extra_kart; // for use in k_kart.c
extern boolean found_extra2_kart; // for use in k_kart.c
extern boolean snw_speedo; // snowy speedometer check
extern boolean clr_hud; // colour hud check
extern boolean big_lap; // bigger lap counter
extern boolean big_lap_color; //bigger lap counter but colour
// the infinite loop of D_SRB2Loop() called from win_main for windows version
void D_SRB2Loop(void) FUNCNORETURN;
@@ -39,9 +45,6 @@ void D_SRB2Main(void);
// Called by IO functions when input is detected.
void D_PostEvent(const event_t *ev);
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void); // delimiter for locking memory
#endif
void D_ProcessEvents(void);
-6
View File
@@ -1352,11 +1352,6 @@ boolean D_CheckNetGame(void)
holepunchpacket = (holepunch_t *)(void *)&doomcom->data;
#ifdef DEBUGFILE
#ifdef _arch_dreamcast
//debugfile = stderr;
if (debugfile)
CONS_Printf(M_GetText("debug output to: %s\n"), "STDERR");
#else
if (M_CheckParm("-debugfile"))
{
char filename[21];
@@ -1374,7 +1369,6 @@ boolean D_CheckNetGame(void)
else
CONS_Alert(CONS_WARNING, M_GetText("cannot debug output to file %s!\n"), va("%s" PATHSEP "%s", srb2home, filename));
}
#endif
#endif
D_ClientServerInit();
+226 -94
View File
@@ -49,6 +49,7 @@
#include "m_anigif.h"
#include "k_kart.h" // SRB2kart
#include "y_inter.h"
#include "fastcmp.h"
#include "m_perfstats.h"
#ifdef NETGAME_DEVMODE
@@ -141,6 +142,8 @@ static void Command_SetViews_f(void);
static void Command_Addfilelocal(void);
static void Command_Addfile(void);
static void Command_Addskins(void);
static void Command_GLocalSkin(void);
static void Command_ListWADS_f(void);
#ifdef DELFILE
static void Command_Delfile(void);
@@ -210,7 +213,7 @@ void SendWeaponPref3(void);
void SendWeaponPref4(void);
static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}};
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
static CV_PossibleValue_t mouse2port_cons_t[] = {{0, "/dev/gpmdata"}, {1, "/dev/ttyS0"},
{2, "/dev/ttyS1"}, {3, "/dev/ttyS2"}, {4, "/dev/ttyS3"}, {0, NULL}};
#else
@@ -289,6 +292,8 @@ consvar_t cv_skin = {"skin", DEFAULTSKIN, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin_
consvar_t cv_skin2 = {"skin2", DEFAULTSKIN2, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin2_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_skin3 = {"skin3", DEFAULTSKIN3, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin3_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_skin4 = {"skin4", DEFAULTSKIN4, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin4_OnChange, 0, NULL, NULL, 0, 0, NULL};
// haha I've beaten you now, ONLINE
consvar_t cv_localskin = {"internal___localskin", "none", CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -297,7 +302,7 @@ INT32 cv_debug;
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) || defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
#if defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
@@ -321,7 +326,7 @@ consvar_t cv_joyscale4 = {"joyscale4", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale4,
consvar_t cv_joyscale = {"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; //Alam: Dummy for save
consvar_t cv_joyscale2 = {"joyscale2", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; //Alam: Dummy for save
#endif
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
consvar_t cv_mouse2port = {"mouse2port", "/dev/gpmdata", CV_SAVE, mouse2port_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mouse2opt = {"mouse2opt", "0", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
#else
@@ -370,6 +375,9 @@ consvar_t cv_tripleorbinaut = {"tripleorbinaut", "On", CV_NETVAR|CV_CHEAT, C
consvar_t cv_quadorbinaut = {"quadorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_dualjawz = {"dualjawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
//Save server ip
consvar_t cv_lastserver = {"lastserver", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
consvar_t cv_kartminimap = {"kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -447,6 +455,7 @@ static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "
consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_forceskin = {"forceskin", "Off", CV_NETVAR|CV_CALL|CV_CHEAT, Forceskin_cons_t, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_fakelocalskin = {"fakelocalskin", "None", CV_SAVE, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -468,6 +477,7 @@ consvar_t cv_showping = {"showping", "Always", CV_SAVE, showping_cons_t, NULL, 0
static CV_PossibleValue_t pingmeasurement_cons_t[] = {{0, "Frames"}, {1, "Milliseconds"}, {0, NULL}};
consvar_t cv_pingmeasurement = {"pingmeasurement", "Frames", CV_SAVE, pingmeasurement_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_luaimmersion = {"luaimmersion", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_minihead = {"smallminimapplayers", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -512,7 +522,7 @@ consvar_t cv_ps_descriptor = {"ps_descriptor", "Average", 0, ps_descriptor_cons_
consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scoll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {0, NULL}};
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scroll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {0, NULL}};
consvar_t cv_skinselectmenu = {"skinselectmenu", "Grid", CV_SAVE, skinselectmenu_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t skinselectgridsort_t[] ={
@@ -643,6 +653,8 @@ void D_RegisterServerCommands(void)
COM_AddCommand("addfilelocal", Command_Addfilelocal);
COM_AddCommand("addfile", Command_Addfile);
COM_AddCommand("addskins", Command_Addskins);
COM_AddCommand("localskin", Command_GLocalSkin);
COM_AddCommand("listwad", Command_ListWADS_f);
#ifdef DELFILE
@@ -709,8 +721,6 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_powerstones);
CV_RegisterVar(&cv_competitionboxes);
CV_RegisterVar(&cv_matchboxes);
CV_RegisterVar(&cv_slamsound);
/*CV_RegisterVar(&cv_recycler);
CV_RegisterVar(&cv_teleporters);
@@ -776,15 +786,6 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_pingtimeout);
CV_RegisterVar(&cv_showping);
CV_RegisterVar(&cv_pingmeasurement);
CV_RegisterVar(&cv_minihead);
CV_RegisterVar(&cv_showminimapnames);
CV_RegisterVar(&cv_showlapemblem);
CV_RegisterVar(&cv_showtrackaddon);
CV_RegisterVar(&cv_showviewpointtext);
#ifdef SEENAMES
CV_RegisterVar(&cv_allowseenames);
@@ -802,6 +803,8 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_recordmultiplayerdemos);
CV_RegisterVar(&cv_netdemosyncquality);
CV_RegisterVar(&cv_maxdemosize);
CV_RegisterVar(&cv_cechotoggle);
}
// =========================================================================
@@ -885,6 +888,7 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_playername);
CV_RegisterVar(&cv_playercolor);
CV_RegisterVar(&cv_skin); // r_things.c (skin NAME)
CV_RegisterVar(&cv_localskin);
// secondary player (splitscreen)
CV_RegisterVar(&cv_playername2);
CV_RegisterVar(&cv_playercolor2);
@@ -927,6 +931,8 @@ void D_RegisterClientCommands(void)
COM_AddCommand("displayplayer", Command_Displayplayer_f);
CV_RegisterVar(&cv_audbuffersize);
#ifdef HAVE_OPENMPT
CV_RegisterVar(&cv_modfilter);
CV_RegisterVar(&cv_stereosep);
@@ -949,33 +955,16 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_chatnotifications);
CV_RegisterVar(&cv_chatbacktint);
CV_RegisterVar(&cv_songcredits);
CV_RegisterVar(&cv_showfreeplay);
CV_RegisterVar(&cv_item_xoffset);
CV_RegisterVar(&cv_item_yoffset);
CV_RegisterVar(&cv_time_xoffset);
CV_RegisterVar(&cv_time_yoffset);
CV_RegisterVar(&cv_laps_xoffset);
CV_RegisterVar(&cv_laps_yoffset);
CV_RegisterVar(&cv_spdm_xoffset);
CV_RegisterVar(&cv_spdm_yoffset);
CV_RegisterVar(&cv_posi_xoffset);
CV_RegisterVar(&cv_posi_yoffset);
CV_RegisterVar(&cv_face_xoffset);
CV_RegisterVar(&cv_face_yoffset);
CV_RegisterVar(&cv_stcd_xoffset);
CV_RegisterVar(&cv_stcd_yoffset);
CV_RegisterVar(&cv_chek_yoffset);
CV_RegisterVar(&cv_mini_xoffset);
CV_RegisterVar(&cv_mini_yoffset);
CV_RegisterVar(&cv_want_xoffset);
CV_RegisterVar(&cv_want_yoffset);
CV_RegisterVar(&cv_showinput);
CV_RegisterVar(&cv_newspeedometer);
CV_RegisterVar(&cv_saltyhop);
CV_RegisterVar(&cv_saltyhopsfx);
CV_RegisterVar(&cv_saltysquish);
CV_RegisterVar(&cv_showfreeplay);
CV_RegisterVar(&cv_growmusic);
CV_RegisterVar(&cv_supermusic);
CV_RegisterVar(&cv_showtrackaddon);
CV_RegisterVar(&cv_showviewpointtext);
CV_RegisterVar(&cv_luaimmersion);
CV_RegisterVar(&cv_fakelocalskin);
//CV_RegisterVar(&cv_crosshair);
//CV_RegisterVar(&cv_crosshair2);
@@ -1041,7 +1030,7 @@ void D_RegisterClientCommands(void)
// WARNING: the order is important when initialising mouse2
// we need the mouse2port
CV_RegisterVar(&cv_mouse2port);
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
CV_RegisterVar(&cv_mouse2opt);
#endif
CV_RegisterVar(&cv_controlperkey);
@@ -1089,10 +1078,6 @@ void D_RegisterClientCommands(void)
#endif
CV_RegisterVar(&cv_numChannels);
// i_cdmus.c
CV_RegisterVar(&cd_volume);
CV_RegisterVar(&cdUpdate);
// screen.c
CV_RegisterVar(&cv_fullscreen);
CV_RegisterVar(&cv_renderview);
@@ -1121,6 +1106,11 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_resume);
CV_RegisterVar(&cv_fading);
//Value used to store last server player has joined
CV_RegisterVar(&cv_lastserver);
CV_RegisterVar(&cv_showallmaps);
// ingame object placing
COM_AddCommand("objectplace", Command_ObjectPlace_f);
@@ -1424,7 +1414,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
if (server && netgame)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -1508,7 +1498,7 @@ static INT32 snacpending = 0, snac2pending = 0, snac3pending = 0, snac4pending =
//
static void SendNameAndColor(void)
{
XBOXSTATIC char buf[MAXPLAYERNAME+2];
char buf[MAXPLAYERNAME+2];
char *p;
p = buf;
@@ -1630,7 +1620,7 @@ static void SendNameAndColor(void)
static void SendNameAndColor2(void)
{
INT32 secondplaya = -1;
XBOXSTATIC char buf[MAXPLAYERNAME+2];
char buf[MAXPLAYERNAME+2];
char *p;
if (splitscreen < 1 && !botingame)
@@ -1758,7 +1748,7 @@ static void SendNameAndColor2(void)
static void SendNameAndColor3(void)
{
INT32 thirdplaya = -1;
XBOXSTATIC char buf[MAXPLAYERNAME+2];
char buf[MAXPLAYERNAME+2];
char *p;
if (splitscreen < 2)
@@ -1878,7 +1868,7 @@ static void SendNameAndColor3(void)
static void SendNameAndColor4(void)
{
INT32 fourthplaya = -1;
XBOXSTATIC char buf[MAXPLAYERNAME+2];
char buf[MAXPLAYERNAME+2];
char *p;
if (splitscreen < 3)
@@ -2066,7 +2056,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
if (kick)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
buf[0] = (UINT8)playernum;
@@ -2102,7 +2092,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
void SendWeaponPref(void)
{
XBOXSTATIC UINT8 buf[1];
UINT8 buf[1];
buf[0] = 0;
if (cv_flipcam.value)
@@ -2114,7 +2104,7 @@ void SendWeaponPref(void)
void SendWeaponPref2(void)
{
XBOXSTATIC UINT8 buf[1];
UINT8 buf[1];
buf[0] = 0;
if (cv_flipcam2.value)
@@ -2126,7 +2116,7 @@ void SendWeaponPref2(void)
void SendWeaponPref3(void)
{
XBOXSTATIC UINT8 buf[1];
UINT8 buf[1];
buf[0] = 0;
if (cv_flipcam3.value)
@@ -2138,7 +2128,7 @@ void SendWeaponPref3(void)
void SendWeaponPref4(void)
{
XBOXSTATIC UINT8 buf[1];
UINT8 buf[1];
buf[0] = 0;
if (cv_flipcam4.value)
@@ -2933,7 +2923,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3016,7 +3006,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
static void Command_Pause(void)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
UINT8 *cp = buf;
if (COM_Argc() > 1)
@@ -3058,7 +3048,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3121,7 +3111,7 @@ static void Command_ReplayMarker(void)
// Command for stuck characters in netgames, griefing, etc.
static void Command_Respawn(void)
{
XBOXSTATIC UINT8 buf[4];
UINT8 buf[4];
UINT8 *cp = buf;
WRITEINT32(cp, consoleplayer);
@@ -3171,7 +3161,7 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3245,7 +3235,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3768,7 +3758,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3783,7 +3773,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3821,7 +3811,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -3874,7 +3864,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4055,7 +4045,7 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt,
(void)salt;
memset(dest, 0, 16);
#else
XBOXSTATIC char tmpbuf[256];
char tmpbuf[256];
const size_t sl = strlen(salt);
if (len > 256-sl)
@@ -4113,7 +4103,7 @@ static void Command_Login_f(void)
// If we have no MD5 support then completely disable XD_LOGIN responses for security.
CONS_Alert(CONS_NOTICE, "Remote administration commands are not supported in this build.\n");
#else
XBOXSTATIC UINT8 finalmd5[MD5_LEN];
UINT8 finalmd5[MD5_LEN];
const char *pw;
if (!netgame)
@@ -4220,7 +4210,7 @@ void RemoveAdminPlayer(INT32 playernum)
static void Command_Verify_f(void)
{
XBOXSTATIC char buf[8]; // Should be plenty
char buf[8]; // Should be plenty
char *temp;
INT32 playernum;
@@ -4263,7 +4253,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4282,7 +4272,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
static void Command_RemoveAdmin_f(void)
{
XBOXSTATIC char buf[8]; // Should be plenty
char buf[8]; // Should be plenty
char *temp;
INT32 playernum;
@@ -4319,7 +4309,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4399,7 +4389,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4420,7 +4410,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
static void Command_RunSOC(void)
{
const char *fn;
XBOXSTATIC char buf[255];
char buf[255];
size_t length = 0;
if (COM_Argc() != 2)
@@ -4462,7 +4452,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4530,7 +4520,7 @@ static void Command_Addfilelocal(void)
static void Command_Addfile(void)
{
const char *fn, *p;
XBOXSTATIC char buf[256];
char buf[256];
char *buf_p = buf;
INT32 i;
int musiconly; // W_VerifyNMUSlumps isn't boolean
@@ -4564,7 +4554,7 @@ static void Command_Addfile(void)
// Add file on your client directly if it is trivial, or you aren't in a netgame.
if (!(netgame || multiplayer) || musiconly)
{
P_AddWadFile(fn);
P_AddWadFile(fn, false);
return;
}
@@ -4613,6 +4603,156 @@ static void Command_Addfile(void)
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
}
// i hate myself
static boolean DumbStartsWith(const char *pre, const char *str)
{
size_t lenpre = strlen(pre),
lenstr = strlen(str);
return lenstr < lenpre ? false : memcmp(pre, str, lenpre) == 0;
}
/** Adds something at runtime.
*/
static void
Command_Addskins (void)
{
if (COM_Argc() > 3)
{
CONS_Printf(
"addskins <file>: Load a skin file.\n");
return;
}
// no forcing?
/*
if (fasticmp(COM_Argv(2), "-force") || fasticmp(COM_Argv(2), "-f")) {
CONS_Alert(CONS_NOTICE, M_GetText("Adding file %s. May or may not be a skin.\n"), COM_Argv(1));
P_AddWadFile(COM_Argv(1), 0, true);
} else {
if (DumbStartsWith("KC_", COM_Argv(1))) {
P_AddWadFile(COM_Argv(1), 0, true);
} else if (DumbStartsWith("KCL_", COM_Argv(1))) {
if (!demo.playback) {
CONS_Alert(CONS_ERROR, M_GetText("Cannot add file %s as it is a skin with lua. Include -force or -f to force it to load.\n"), COM_Argv(1));
return;
} else {
*/
P_AddWadFile(COM_Argv(1), true);
/*
}
} else {
CONS_Alert(CONS_ERROR, M_GetText("Cannot add file %s as it is not a skin.\n"), COM_Argv(1));
return;
}
}
*/
}
// args n stuff
#include "args.h"
static void Command_GLocalSkin (void)
{
size_t first_option;
size_t option_display;
size_t option_all;
size_t option_player;
option_player = COM_CheckPartialParm("-p");
option_display = COM_CheckPartialParm("-d");
option_all = COM_CheckPartialParm("-a");
char* fuck; // local skin name
if (!( first_option = COM_FirstOption() ))
first_option = COM_Argc();
if (first_option < 2)
{
/* holy fucking shit */
CONS_Printf("localskin <name> [-player <name>] [-display <number>] [-all]:\n");
CONS_Printf(M_GetText("Set a localskin via its internal name (usually printed on the console).\n\n\
* Using \"-player\" will set a localskin to a specified player.\n\
Defaults to yourself.\n\
* Using \"-display\" will set a localskin to the displayed player.\n\
Defaults to 0, which is the first player displayed.\n\
Can go up to 3 for splitscreen.\n\
* Using \"-all\" will set a localskin to ALL players.\n\
* \"localskin none\" removes the localskin, just like how\n\
\"forceskin none\" does.\n"));
return;
}
fuck = ConcatCommandArgv(1, first_option);
char* player_name = player_names[consoleplayer];
char* display_num = "0";
size_t dnum = 0;
if (option_display) // -display
{
// handle default: 0
if (COM_Argv(option_display + 1)[0] == "" || COM_Argv(option_display + 1)[0] != "-")
display_num = COM_Argv(option_display + 1);
if (isdigit(display_num[0]) || display_num == "0")
{
dnum = atoi(display_num);
if (dnum > 3 || dnum < 0) // nuh uh
dnum = 0;
SetLocalPlayerSkin(displayplayers[dnum], fuck, NULL);
CONS_Printf("Successfully applied localskin to displayed player.\n");
return;
}
CONS_Printf("Could not apply localskin.\n");
return;
}
else if (option_all) // -all
{
int i;
for (i = 0; i < MAXPLAYERS; ++i)
{
if (!playeringame[i])
continue;
SetLocalPlayerSkin(i, fuck, NULL);
}
CONS_Printf("Successfully applied localskin to all players.\n");
return;
}
else // -player or no other arguments
{
if (option_player)
{
int i;
player_name = COM_Argv(option_player + 1);
for (i = 0; i < MAXPLAYERS; ++i)
{
if (fasticmp(player_names[i], player_name))
SetLocalPlayerSkin(i, fuck, NULL);
}
CONS_Printf("Successfully applied localskin to specified player.\n");
return;
}
else
{
SetLocalPlayerSkin(consoleplayer, fuck, &cv_localskin);
CONS_Printf("Successfully applied localskin.\n");
return;
}
CONS_Printf("Could not apply localskin.\n");
return;
}
}
#ifdef DELFILE
/** removes the last added pwad at runtime.
* Searches for sounds, maps, music and images to remove
@@ -4676,7 +4816,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
@@ -4725,7 +4865,7 @@ static void Got_Delfilecmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal delfile command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4758,7 +4898,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -4769,7 +4909,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
ncs = findfile(filename,md5sum,true);
if (ncs != FS_FOUND || !P_AddWadFile(filename))
if (ncs != FS_FOUND || !P_AddWadFile(filename, false))
{
Command_ExitGame_f();
if (ncs == FS_FOUND)
@@ -4832,8 +4972,6 @@ static void Command_Version_f(void)
// Base library
#if defined( HAVE_SDL)
CONS_Printf("SDL ");
#elif defined(_WINDOWS)
CONS_Printf("DD ");
#endif
// OS
@@ -4858,11 +4996,6 @@ static void Command_Version_f(void)
else // 16-bit? 128-bit?
CONS_Printf("Bits Unknown ");
// No ASM?
#ifdef NOASM
CONS_Printf("\x85" "NOASM " "\x80");
#endif
// Debug build
#ifdef _DEBUG
CONS_Printf("\x85" "DEBUG " "\x80");
@@ -5450,7 +5583,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -5472,7 +5605,7 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal vote setup received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -5537,7 +5670,7 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal vote setup received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
@@ -5925,7 +6058,6 @@ static void Command_ListSkins(void)
}
}
/** Sends a color change for the console player, unless that player is moving.
* \sa cv_playercolor, Color2_OnChange, Skin_OnChange
* \author Graue <graue@oceanbase.org>
@@ -6162,7 +6294,7 @@ void Got_DiscordInfo(UINT8 **p, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal Discord info command received from %s\n"), player_names[playernum]);
if (server)
{
XBOXSTATIC UINT8 buf[2];
UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
+7 -1
View File
@@ -21,6 +21,7 @@
extern consvar_t cv_playername;
extern consvar_t cv_playercolor;
extern consvar_t cv_skin;
extern consvar_t cv_localskin;
// secondary splitscreen player
extern consvar_t cv_playername2;
extern consvar_t cv_playercolor2;
@@ -56,7 +57,7 @@ extern consvar_t cv_joyscale4;
// splitscreen with second mouse
extern consvar_t cv_mouse2port;
extern consvar_t cv_usemouse2;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
extern consvar_t cv_mouse2opt;
#endif
@@ -110,6 +111,9 @@ extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring, cv_kitchensink;
extern consvar_t cv_triplesneaker, cv_triplebanana, cv_decabanana;
extern consvar_t cv_tripleorbinaut, cv_quadorbinaut, cv_dualjawz;
//Lastserver
extern consvar_t cv_lastserver;
extern consvar_t cv_kartminimap;
extern consvar_t cv_kartcheck;
extern consvar_t cv_kartinvinsfx;
@@ -157,6 +161,8 @@ extern consvar_t cv_minihead;
extern consvar_t cv_showlapemblem;
extern consvar_t cv_showviewpointtext;
extern consvar_t cv_luaimmersion;
extern consvar_t cv_fakelocalskin;
extern consvar_t cv_skipmapcheck;
+32 -21
View File
@@ -11,21 +11,17 @@
/// \brief Transfer a file using HSendPacket.
#include <stdio.h>
#ifndef _WIN32_WCE
#ifdef __OS2__
#include <sys/types.h>
#endif // __OS2__
#include <sys/stat.h>
#endif
#if !defined (UNDER_CE)
#include <time.h>
#endif
#if ((defined (_WIN32) && !defined (_WIN32_WCE)) || defined (__DJGPP__)) && !defined (_XBOX)
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#elif !defined (_WIN32_WCE) && !(defined (_XBOX) && !defined (__GNUC__))
#else
#include <sys/types.h>
#include <dirent.h>
#include <utime.h>
@@ -34,13 +30,9 @@
#ifdef __GNUC__
#include <unistd.h>
#include <limits.h>
#elif defined (_WIN32) && !defined (_WIN32_WCE)
#elif defined (_WIN32)
#include <sys/utime.h>
#endif
#ifdef __DJGPP__
#include <dir.h>
#include <utime.h>
#endif
#ifdef HAVE_CURL
#include "curl/curl.h"
@@ -72,8 +64,13 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid);
#ifdef HAVE_CURL
size_t curlwrite_data(void *ptr, size_t size, size_t nmemb, FILE *stream);
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 35, 0)
int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
#define XFERINFOFUNCTION
#else
int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
#endif
#endif
// Sender structure
typedef struct filetx_s
@@ -489,7 +486,6 @@ INT32 CL_CheckFiles(void)
{
INT32 i, j;
char wadfilename[MAX_WADPATH];
size_t packetsize = 0;
size_t filestoload = 0;
boolean downloadrequired = false;
@@ -513,7 +509,7 @@ INT32 CL_CheckFiles(void)
for (i = 0, j = mainwads+1; i < fileneedednum || j < numwadfiles;)
{
if (j < numwadfiles && !wadfiles[j]->important)
if (j < numwadfiles && (!wadfiles[j]->important || wadfiles[j]->localfile))
{
// Unimportant on our side. still don't care.
++j;
@@ -562,7 +558,7 @@ INT32 CL_CheckFiles(void)
CONS_Debug(DBG_NETPLAY, "searching for '%s' ", fileneeded[i].filename);
// Check in already loaded files
for (j = mainwads+1; wadfiles[j]; j++)
for (j = mainwads+1; j < numwadfiles; j++)
{
nameonly(strcpy(wadfilename, wadfiles[j]->filename));
if (!stricmp(wadfilename, fileneeded[i].filename) &&
@@ -574,8 +570,6 @@ INT32 CL_CheckFiles(void)
}
}
packetsize += nameonlylength(fileneeded[i].filename) + 22;
fileneeded[i].status = findfile(fileneeded[i].filename, fileneeded[i].md5sum, true);
CONS_Debug(DBG_NETPLAY, "found %d\n", fileneeded[i].status);
return 4;
@@ -1142,7 +1136,7 @@ size_t nameonlylength(const char *s)
filestatus_t checkfilemd5(char *filename, const UINT8 *wantedmd5sum)
{
#if defined (NOMD5) || defined (_arch_dreamcast)
#if defined (NOMD5)
(void)wantedmd5sum;
(void)filename;
#else
@@ -1194,11 +1188,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
// if not found at all, just move on without doing anything
// finally check "." directory
#ifdef _arch_dreamcast
homecheck = filesearch(filename, "/cd", wantedmd5sum, completepath, 10);
#else
homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);
#endif
if (homecheck != FS_NOTFOUND) // if not found this time, fall back on the below return statement
return homecheck; // otherwise return the result we got
@@ -1214,6 +1204,18 @@ size_t curlwrite_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
return written;
}
#ifdef XFERINFOFUNCTION
int curlprogress_callbackx(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
{
(void)clientp;
(void)ultotal;
(void)ulnow; // Function prototype requires these but we won't use, so just discard
curl_dlnow = dlnow;
curl_dltotal = dltotal;
getbytes = curl_dlnow / (time(NULL) - curl_starttime); // To-do: Make this more accurate???
return 0;
}
#else
int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
{
(void)clientp;
@@ -1224,6 +1226,7 @@ int curlprogress_callback(void *clientp, double dltotal, double dlnow, double ul
getbytes = curl_dlnow / (time(NULL) - curl_starttime); // To-do: Make this more accurate???
return 0;
}
#endif
void CURLPrepareFile(const char* url, int dfilenum)
{
@@ -1253,7 +1256,11 @@ void CURLPrepareFile(const char* url, int dfilenum)
curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s", url, curl_realname));
// Only allow HTTP and HTTPS
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
#else
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
#endif
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("SRB2Kart/v%d.%d", VERSION, SUBVERSION)); // Set user agent as some servers won't accept invalid user agents.
@@ -1277,7 +1284,11 @@ void CURLPrepareFile(const char* url, int dfilenum)
curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
#ifdef XFERINFOFUNCTION
curl_easy_setopt(http_handle, CURLOPT_XFERINFOFUNCTION, curlprogress_callbackx);
#else
curl_easy_setopt(http_handle, CURLOPT_PROGRESSFUNCTION, curlprogress_callback);
#endif
curl_curfile->status = FS_DOWNLOADING;
lastfilenum = dfilenum;
+3
View File
@@ -371,6 +371,7 @@ typedef struct player_s
angle_t viewrollangle;
angle_t tilt;
angle_t tilt_sprite;
// Mouse aiming, where the guy is looking at!
// It is updated with cmd->aiming.
@@ -415,6 +416,8 @@ typedef struct player_s
UINT8 skincolor;
INT32 skin;
INT32 localskin;
boolean skinlocal;
UINT32 score; // player score
fixed_t dashspeed; // dashing speed
+3 -11
View File
@@ -43,12 +43,6 @@
#include "r_draw.h" // translation colormap consts (for lua)
#endif
#ifdef PC_DOS
#include <stdio.h> // for snprintf
//int snprintf(char *str, size_t n, const char *fmt, ...);
int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
#endif
// Free slot names
// The crazy word-reading stuff uses these.
static char *FREE_STATES[NUMSTATEFREESLOTS];
@@ -1888,7 +1882,7 @@ static void readframe(MYFILE *f, INT32 num)
{
size_t z;
boolean found = false;
XBOXSTATIC char actiontocompare[32];
char actiontocompare[32];
memset(actiontocompare, 0x00, sizeof(actiontocompare));
strlcpy(actiontocompare, word2, sizeof (actiontocompare));
@@ -3159,9 +3153,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
char *word2;
INT32 i;
// do a copy of this for cross references probleme
//XBOXSTATIC actionf_t saveactions[NUMSTATES];
//XBOXSTATIC const char *savesprnames[NUMSPRITES];
XBOXSTATIC const char *savesfxnames[NUMSFX];
const char *savesfxnames[NUMSFX];
if (!deh_loaded)
initfreeslots();
@@ -3181,7 +3173,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
dbg_line = -1; // start at -1 so the first line is 0.
while (!myfeof(f))
{
XBOXSTATIC char origpos[128];
char origpos[128];
INT32 size = 0;
char *traverse;
+39 -2
View File
@@ -37,7 +37,9 @@
// length of IP strings
#define IP_SIZE 21
consvar_t cv_discordrp = {"discordrp", "On", CV_SAVE|CV_CALL, CV_OnOff, DRPC_UpdatePresence, 0, NULL, NULL, 0, 0, NULL};
static void Discordrp_OnChange(void);
consvar_t cv_discordrp = {"discordrp", "On", CV_SAVE|CV_CALL, CV_OnOff, Discordrp_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_discordstreamer = {"discordstreamer", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_discordasks = {"discordasks", "Yes", CV_SAVE|CV_CALL, CV_YesNo, DRPC_UpdatePresence, 0, NULL, NULL, 0, 0, NULL};
@@ -47,6 +49,8 @@ discordRequest_t *discordRequestList = NULL;
static char self_ip[IP_SIZE];
boolean drpc_init = false;
/*--------------------------------------------------
static char *DRPC_XORIPString(const char *input)
@@ -315,6 +319,9 @@ void DRPC_RemoveRequest(discordRequest_t *removeRequest)
--------------------------------------------------*/
void DRPC_Init(void)
{
if (drpc_init || !cv_discordrp.value) return;
drpc_init = true;
DiscordEventHandlers handlers;
memset(&handlers, 0, sizeof(handlers));
@@ -325,10 +332,36 @@ void DRPC_Init(void)
handlers.joinRequest = DRPC_HandleJoinRequest;
Discord_Initialize(DISCORD_APPID, &handlers, 1, NULL);
I_AddExitFunc(Discord_Shutdown);
I_AddExitFunc(DRPC_Shutdown);
DRPC_UpdatePresence();
}
void DRPC_Shutdown(void)
{
if (!drpc_init)
{
CONS_Printf("DiscordRPC never started\n");
return;
}
CONS_Printf("Shutting down DiscordRPC\n");
Discord_Shutdown();
drpc_init = false;
}
static void Discordrp_OnChange(void)
{
if (cv_discordrp.value)
{
DRPC_UpdatePresence();
}
else
{
DRPC_Shutdown();
}
}
/*--------------------------------------------------
static void DRPC_GotServerIP(UINT32 address)
@@ -402,6 +435,10 @@ static void DRPC_EmptyRequests(void)
--------------------------------------------------*/
void DRPC_UpdatePresence(void)
{
if (!cv_discordrp.value) return;
if (!drpc_init) DRPC_Init();
char detailstr[48+1];
char mapimg[8+1];
+7
View File
@@ -64,6 +64,13 @@ void DRPC_RemoveRequest(discordRequest_t *removeRequest);
void DRPC_Init(void);
/*--------------------------------------------------
void DRPC_Shutdown(void);
Shutdown Discord Rich Presence if it was started at all.
--------------------------------------------------*/
void DRPC_Shutdown(void);
/*--------------------------------------------------
void DRPC_UpdatePresence(void);
-48
View File
@@ -1,48 +0,0 @@
#
# djgppdos/makefile.cfg for SRB2/DOS
#
#
#now for the DOS stuff, go DOS!
#
# options
OPTS=-DPC_DOS
WFLAGS+=-Wno-cast-qual
NOHW=1
NOHS=1
PNG_CFLAGS=
PNG_LDFLAGS=-lpng -lz
ifdef WATTCP
OPTS+=-DWATTCP
NOOBJDUMP=1
endif
#ifdef DEBUGMODE
LIBS=-lalld
#else
# LIBS=-lalleg
#endif
ifndef NONET
ifdef WATTCP
LIBS+=-lwatt
else
LIBS+=-lsocket
endif
endif
ifdef RDB
LIBS+=-lgdbst -ldzcom
OPTS+=-DREMOTE_DEBUGGING
endif
OBJS=$(OBJDIR)/i_video.o $(OBJDIR)/vid_vesa.o
# name of the exefile
ifdef WATTCP
EXENAME?=srb2dos.exe
else
EXENAME?=srb2w16.exe
endif
-755
View File
@@ -1,755 +0,0 @@
/* bcd.c -- Brennan's CD-ROM Audio Playing Library
by Brennan Underwood, http://brennan.home.ml.org/ */
#include <dos.h>
#include <dpmi.h>
#include <go32.h>
#include <fcntl.h>
#include <stdio.h>
#include <malloc.h>
#include <unistd.h>
#include <strings.h>
#ifdef STANDALONE
#include <conio.h> /* for getch() */
#endif
#include "bcd.h"
typedef struct {
int is_audio;
int start, end, len;
} Track;
static int mscdex_version;
static int first_drive;
static int num_tracks;
static int lowest_track, highest_track;
static int audio_length;
#ifdef STATIC_TRACKS
static Track tracks[99];
#else
static Track *tracks;
#endif
static int dos_mem_segment, dos_mem_selector = -1;
int _status, _error, _error_code;
const char *_bcd_error = NULL;
#define RESET_ERROR (_error = _error_code = 0)
#define ERROR_BIT (1 << 15)
#define BUSY_BIT (1 << 9)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#pragma pack(1)
/* I know 'typedef struct {} bleh' is a bad habit, but... */
typedef struct {
unsigned char len;
unsigned char unit;
unsigned char command;
unsigned short status;
unsigned char reserved[8];
} ATTRPACK RequestHeader;
typedef struct {
RequestHeader request_header;
unsigned char descriptor;
unsigned long address;
unsigned short len;
unsigned short secnum;
unsigned long ptr;
} ATTRPACK IOCTLI;
typedef struct {
unsigned char control;
unsigned char lowest;
unsigned char highest;
char total[4];
} ATTRPACK DiskInfo;
typedef struct {
unsigned char control;
unsigned char track_number;
char start[4];
unsigned char info;
} ATTRPACK TrackInfo;
typedef struct {
RequestHeader request;
unsigned char mode;
unsigned long start;
unsigned long len;
} ATTRPACK PlayRequest;
typedef struct {
RequestHeader request;
} ATTRPACK StopRequest;
typedef struct {
RequestHeader request;
} ATTRPACK ResumeRequest;
typedef struct {
unsigned char control;
unsigned char input0;
unsigned char volume0;
unsigned char input1;
unsigned char volume1;
unsigned char input2;
unsigned char volume2;
unsigned char input3;
unsigned char volume3;
} ATTRPACK VolumeRequest;
typedef struct {
unsigned char control;
unsigned char fn;
} ATTRPACK LockRequest;
typedef struct {
unsigned char control;
unsigned char mbyte;
} ATTRPACK MediaChangedRequest;
typedef struct {
unsigned char control;
unsigned long status;
} ATTRPACK StatusRequest;
typedef struct {
unsigned char control;
unsigned char mode;
unsigned long loc;
} ATTRPACK PositionRequest;
#pragma pack()
#ifdef __cplusplus
extern "C" {
#endif
const char *bcd_error(void) {
static char retstr[132];
const char *errorcodes[] = {
"Write-protect violation",
"Unknown unit",
"Drive not ready",
"Unknown command",
"CRC error",
"Bad drive request structure length",
"Seek error",
"Unknown media",
"Sector not found",
"Printer out of paper: world coming to an end",/* I mean really, on a CD? */
"Write fault",
"Read fault",
"General failure",
"Reserved",
"Reserved",
"Invalid disk change"
};
*retstr = 0;
if (_error != 0) {
strcat(retstr, "Device error: ");
if (_error_code < 0 || _error_code > 0xf)
strcat(retstr, "Invalid error");
else
strcat(retstr, errorcodes[_error_code]);
strcat(retstr, " ");
}
if (_bcd_error != NULL) {
if (*retstr) strcat(retstr, ", ");
strcat(retstr, "BCD error: ");
strcat(retstr, _bcd_error);
}
return retstr;
}
/* DOS IOCTL w/ command block */
static void bcd_ioctl(IOCTLI *ioctli, void *command, int len) {
int ioctli_len = sizeof (IOCTLI);
unsigned long command_address = dos_mem_segment << 4;
__dpmi_regs regs;
memset(&regs, 0, sizeof regs);
regs.x.es = (__tb >> 4) & 0xffff;
regs.x.ax = 0x1510;
regs.x.bx = __tb & 0xf;
regs.x.cx = first_drive;
ioctli->address = dos_mem_segment << 16;
ioctli->len = len;
dosmemput(ioctli, ioctli_len, __tb); /* put ioctl into dos area */
dosmemput(command, len, command_address); /* and command too */
if (__dpmi_int(0x2f, &regs) == -1) {
_bcd_error = "__dpmi_int() failed";
return;
}
dosmemget(__tb, ioctli_len, ioctli); /* retrieve results */
dosmemget(command_address, len, command);
_status = ioctli->request_header.status;
if (_status & ERROR_BIT) {
_error = TRUE;
_error_code = _status & 0xff;
} else {
_error = FALSE;
_error_code = 0;
}
}
/* no command block */
FUNCINLINE static ATTRINLINE void bcd_ioctl2(void *cmd, int len) {
__dpmi_regs regs;
memset(&regs, 0, sizeof regs);
regs.x.es = (__tb >> 4) & 0xffff;
regs.x.ax = 0x1510;
regs.x.bx = __tb & 0xf;
regs.x.cx = first_drive;
dosmemput(cmd, len, __tb); /* put ioctl block in dos arena */
if (__dpmi_int(0x2f, &regs) == -1) {
_bcd_error = "__dpmi_int() failed";
return;
}
/* I hate to have no error capability for ioctl2 but the command block
doesn't necessarily have a status field */
RESET_ERROR;
}
FUNCINLINE static ATTRINLINE int red2hsg(char *r) {
return r[0] + r[1]*75 + r[2]*4500 - 150;
}
int bcd_now_playing(void) {
int i, loc = bcd_audio_position();
_bcd_error = NULL;
if (!bcd_audio_busy()) {
_bcd_error = "Audio not playing";
return 0;
}
if (
#ifndef STATIC_TRACKS
tracks == NULL &&
#endif
!bcd_get_audio_info())
return 0;
for (i = lowest_track; i <= highest_track; i++) {
if (loc >= tracks[i].start && loc <= tracks[i].end) return i;
}
/* some bizarre location? */
_bcd_error = "Head outside of bounds";
return 0;
}
/* handles the setup for CD-ROM audio interface */
int bcd_open(void) {
__dpmi_regs regs;
_bcd_error = NULL;
/* disk I/O wouldn't work anyway if you set sizeof tb this low, but... */
if (_go32_info_block.size_of_transfer_buffer < 4096) {
_bcd_error = "Transfer buffer too small";
return 0;
}
memset(&regs, 0, sizeof regs);
regs.x.ax = 0x1500;
regs.x.bx = 0x0;
__dpmi_int(0x2f, &regs);
if (regs.x.bx == 0) { /* abba no longer lives */
_bcd_error = "MSCDEX not found";
return 0;
}
first_drive = regs.x.cx; /* use the first drive */
/* check for mscdex at least 2.0 */
memset(&regs, 0, sizeof regs);
regs.x.ax = 0x150C;
__dpmi_int(0x2f, &regs);
if (regs.x.bx == 0) {
_bcd_error = "MSCDEX version < 2.0";
return 0;
}
mscdex_version = regs.x.bx;
/* allocate 256 bytes of dos memory for the command blocks */
if ((dos_mem_segment = __dpmi_allocate_dos_memory(16, &dos_mem_selector))<0) {
_bcd_error = "Could not allocate 256 bytes of DOS memory";
return 0;
}
return mscdex_version;
}
/* Shuts down CD-ROM audio interface */
int bcd_close(void) {
_bcd_error = NULL;
if (dos_mem_selector != -1) {
__dpmi_free_dos_memory(dos_mem_selector);
dos_mem_selector = -1;
}
#ifndef STATIC_TRACKS
if (tracks) free(tracks);
tracks = NULL;
#endif
RESET_ERROR;
return 1;
}
int bcd_open_door(void) {
IOCTLI ioctli;
char eject = 0;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 12;
ioctli.len = 1;
bcd_ioctl(&ioctli, &eject, sizeof eject);
if (_error) return 0;
return 1;
}
int bcd_close_door(void) {
IOCTLI ioctli;
char closeit = 5;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 12;
ioctli.len = 1;
bcd_ioctl(&ioctli, &closeit, sizeof closeit);
if (_error) return 0;
return 1;
}
int bcd_lock(int fn) {
IOCTLI ioctli;
LockRequest req;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
memset(&req, 0, sizeof req);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 12;
ioctli.len = sizeof req;
req.control = 1;
req.fn = fn ? 1 : 0;
bcd_ioctl(&ioctli, &req, sizeof req);
if (_error) return 0;
return 1;
}
int bcd_disc_changed(void) {
IOCTLI ioctli;
MediaChangedRequest req;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
memset(&req, 0, sizeof req);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 3;
ioctli.len = sizeof req;
req.control = 9;
bcd_ioctl(&ioctli, &req, sizeof req);
return req.mbyte;
}
int bcd_reset(void) {
IOCTLI ioctli;
char reset = 2;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 12;
ioctli.len = 1;
bcd_ioctl(&ioctli, &reset, sizeof reset);
if (_error) return 0;
return 1;
}
int bcd_device_status(void) {
IOCTLI ioctli;
StatusRequest req;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
memset(&req, 0, sizeof req);
ioctli.request_header.len = sizeof ioctli; // ok
ioctli.request_header.command = 3;
ioctli.len = sizeof req;
req.control = 6;
bcd_ioctl(&ioctli, &req, sizeof req);
return req.status;
}
static inline int bcd_get_status_word(void) {
IOCTLI ioctli;
DiskInfo disk_info;
/* get cd info as an excuse to get a look at the status word */
memset(&disk_info, 0, sizeof disk_info);
memset(&ioctli, 0, sizeof ioctli);
ioctli.request_header.len = 26;
ioctli.request_header.command = 3;
ioctli.len = 7;
disk_info.control = 10;
bcd_ioctl(&ioctli, &disk_info, sizeof disk_info);
return _status;
}
int bcd_audio_busy(void) {
_bcd_error = NULL;
/* If the door is open, then the head is busy, and so the busy bit is
on. It is not, however, playing audio. */
if (bcd_device_status() & BCD_DOOR_OPEN)
return 0;
bcd_get_status_word();
if (_error) return -1;
return (_status & BUSY_BIT) ? 1 : 0;
}
int bcd_audio_position(void) {
IOCTLI ioctli;
PositionRequest req;
_bcd_error = NULL;
memset(&ioctli, 0, sizeof ioctli);
memset(&req, 0, sizeof req);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 3;
ioctli.len = sizeof req;
req.control = 1;
bcd_ioctl(&ioctli, &req, sizeof req);
return req.loc;
}
/* Internal function to get track info */
static inline void bcd_get_track_info(int n, Track *t) {
IOCTLI ioctli;
TrackInfo info;
memset(&ioctli, 0, sizeof ioctli);
memset(&info, 0, sizeof info);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 3;
info.control = 11;
info.track_number = n;
bcd_ioctl(&ioctli, &info, sizeof info);
t->start = red2hsg(info.start);
if (info.info & 64)
t->is_audio = 0;
else
t->is_audio = 1;
}
int bcd_get_audio_info(void) {
IOCTLI ioctli;
DiskInfo disk_info;
int i;
_bcd_error = NULL;
#ifndef STATIC_TRACKS
if (tracks) free(tracks);
tracks = NULL;
#endif
memset(&disk_info, 0, sizeof disk_info);
memset(&ioctli, 0, sizeof ioctli);
ioctli.request_header.len = 26;
ioctli.request_header.command = 3;
ioctli.len = 7;
disk_info.control = 10;
bcd_ioctl(&ioctli, &disk_info, sizeof disk_info);
if (_error) return 0;
lowest_track = disk_info.lowest;
highest_track = disk_info.highest;
num_tracks = disk_info.highest - disk_info.lowest + 1;
#ifndef STATIC_TRACKS
//tracks = calloc(num_tracks, sizeof (Track));
/* alloc max space in order to attempt to avoid possible overrun bug */
tracks = calloc(highest_track+1, sizeof (Track));
if (tracks == NULL) {
_bcd_error = "Out of memory allocating tracks\n";
return 0;
}
#endif
/* get track starts */
for (i = lowest_track; i <= highest_track; i++)
bcd_get_track_info(i, tracks+i);
/* figure out track ends */
for (i = lowest_track; i < highest_track; i++)
tracks[i].end = tracks[i+1].start-1;
audio_length = red2hsg(disk_info.total);
tracks[i].end = audio_length;
for (i = lowest_track; i <= highest_track; i++)
tracks[i].len = tracks[i].end - tracks[i].start;
return num_tracks;
}
int bcd_get_track_address(int trackno, int *start, int *len) {
_bcd_error = NULL;
//if (trackno >= num_tracks+1 || trackno <= 0) {
if (trackno < lowest_track || trackno > highest_track) {
_bcd_error = "Track out of range";
*start = *len = 0;
return 0;
}
*start = tracks[trackno].start;
*len = tracks[trackno].len;
return 1;
}
int bcd_track_is_audio(int trackno) {
//if (trackno >= num_tracks+1 || trackno <= 0) {
if (trackno < lowest_track || trackno > highest_track) {
_bcd_error = "Track out of range";
return 0;
}
return tracks[trackno].is_audio;
}
int bcd_set_volume(int volume) {
IOCTLI ioctli;
VolumeRequest v;
_bcd_error = NULL;
if (volume > 255) volume = 255;
else if (volume < 0) volume = 0;
memset(&ioctli, 0, sizeof ioctli);
ioctli.request_header.len = sizeof ioctli;
ioctli.request_header.command = 12;
ioctli.len = sizeof v;
v.control = 3;
v.volume0 = volume;
v.input0 = 0;
v.volume1 = volume;
v.input1 = 1;
v.volume2 = volume;
v.input2 = 2;
v.volume3 = volume;
v.input3 = 3;
bcd_ioctl(&ioctli, &v, sizeof v);
if (_error) return 0;
return 1;
}
int bcd_play(int location, int frames) {
PlayRequest cmd;
memset(&cmd, 0, sizeof cmd);
_bcd_error = NULL;
/* the following should be in user code, but it'll fail otherwise */
if (bcd_audio_busy())
bcd_stop();
cmd.request.len = sizeof cmd;
cmd.request.command = 132;
cmd.start = location;
cmd.len = frames;
bcd_ioctl2(&cmd, sizeof cmd);
if (_error) return 0;
return 1;
}
int bcd_play_track(int trackno) {
_bcd_error = NULL;
if (!bcd_get_audio_info()) return 0;
if (trackno < lowest_track || trackno > highest_track) {
_bcd_error = "Track out of range";
return 0;
}
if (! tracks[trackno].is_audio) {
_bcd_error = "Not an audio track";
return 0;
}
return bcd_play(tracks[trackno].start, tracks[trackno].len);
}
int bcd_stop(void) {
StopRequest cmd;
_bcd_error = NULL;
memset(&cmd, 0, sizeof cmd);
cmd.request.len = sizeof cmd;
cmd.request.command = 133;
bcd_ioctl2(&cmd, sizeof cmd);
if (_error) return 0;
return 1;
}
int bcd_resume(void) {
ResumeRequest cmd;
_bcd_error = NULL;
memset(&cmd, 0, sizeof cmd);
cmd.request.len = sizeof cmd;
cmd.request.command = 136;
bcd_ioctl2(&cmd, sizeof cmd);
if (_error) return 0;
return 1;
}
#ifdef __cplusplus
}
#endif
#ifdef STANDALONE
static char *card(int c) {
return c == 1 ? "" : "s";
}
static void print_hsg(int hsg) {
int hours, minutes, seconds;
seconds = hsg / 75;
minutes = seconds / 60;
seconds %= 60;
hours = minutes / 60;
minutes %= 60;
printf("%2d:%02d:%02d", hours, minutes, seconds);
}
static void print_binary(int v, int len) {
for (;len;len--)
printf("%d", (v & (1 << len)) ? 1 : 0);
}
int main(int argc, char *argv[]) {
int i, n1, n2, t;
if (!bcd_open()) {
fprintf(stderr, "Couldn't open CD-ROM drive. %s\n", bcd_error());
exit(0);
}
for (i = 1; i < argc; i++) {
if (*argv[i] == '-') strcpy(argv[i], argv[i]+1);
if (!strcmp(argv[i], "open") || !strcmp(argv[i], "eject")) {
bcd_open_door();
} else if (!strcmp(argv[i], "close")) {
bcd_close_door();
} else if (!strcmp(argv[i], "sleep")) {
if (++i >= argc) break;
sleep(atoi(argv[i]));
} else if (!strcmp(argv[i], "list")) {
int nd = 0, na = 0, audio_time = 0;
if (!bcd_get_audio_info()) {
printf("Error getting audio info\n");
} else if (lowest_track == 0) {
printf("No audio tracks\n");
} else {
for (t = lowest_track; t <= highest_track; t++) {
printf("Track %2d: ", t);
print_hsg(tracks[t].start);
printf(" -> ");
print_hsg(tracks[t].end);
printf(" (");
print_hsg(tracks[t].len);
if (tracks[t].is_audio) {
na++;
printf(") audio");
audio_time += tracks[t].len;
} else {
nd++;
printf(") data ");
}
printf(" (HSG: %06d->%06d)\n", tracks[t].start, tracks[t].end);
}
printf("%d audio track%s, %d data track%s\n", na, card(na), nd, card(nd));
if (audio_time) {
printf("Audio time: ");
print_hsg(audio_time);
printf("\n");
}
}
} else if (!strcmp(argv[i], "lock")) {
bcd_lock(1);
} else if (!strcmp(argv[i], "pladdr")) {
if (++i >= argc) break;
n1 = atoi(argv[i]);
if (++i >= argc) break;
n2 = atoi(argv[i]);
printf("Playing frame %d to frame %d\n", n1, n2);
bcd_play(n1, n2-n1);
} else if (!strcmp(argv[i], "play")) {
if (++i >= argc) break;
if (bcd_audio_busy()) {
bcd_stop();
delay(1000);
}
n1 = atoi(argv[i]);
printf("Playing track %d\n", n1);
bcd_play_track(n1);
} else if (!strcmp(argv[i], "reset")) {
bcd_reset();
} else if (!strcmp(argv[i], "resume")) {
bcd_resume();
} else if (!strcmp(argv[i], "status")) {
int s;
s = bcd_device_status();
printf("MSCDEX version %d.%d\n", mscdex_version >> 8,
mscdex_version & 0xff);
printf("Device status word '");
print_binary(s, 16);
printf("'\nDoor is %sopen\n", s & BCD_DOOR_OPEN ? "" : "not ");
printf("Door is %slocked\n", s & BCD_DOOR_UNLOCKED ? "not " : "");
printf("Audio is %sbusy\n", bcd_audio_busy() ? "" : "not ");
s = bcd_disc_changed();
if (s == BCD_DISC_UNKNOWN) printf("Media change status unknown\n");
else printf("Media has %schanged\n",
(s == BCD_DISC_CHANGED) ? "" : "not ");
} else if (!strcmp(argv[i], "stop")) {
bcd_stop();
} else if (!strcmp(argv[i], "unlock")) {
bcd_lock(0);
} else if (!strcmp(argv[i], "volume")) {
bcd_set_volume(atoi(argv[++i]));
} else if (!strcmp(argv[i], "wait")) {
while (bcd_audio_busy()) {
int n = bcd_now_playing();
if (n == 0) break;
printf("%2d: ", n);
print_hsg(bcd_audio_position() - tracks[n].start);
printf("\r");
fflush(stdout);
delay(100);
if (kbhit() && getch() == 27) break;
}
printf("\n");
} else if (!strcmp(argv[i], "help") || !strcmp(argv[i], "usage")) {
printf("BCD version %x.%x\n" \
"Usage: BCD {commands}\n" \
"Valid commands:\n" \
"\tclose - close door/tray\n" \
"\tdelay {n} - delay {n} seconds\n" \
"\tlist - list track info\n" \
"\tlock - lock door/tray\n" \
"\topen - open door/tray\n" \
"\tpladdr {n1} {n2}- play frame {n1} to {n2}\n" \
"\tplay {n} - play track {n}\n" \
"\treset - reset the drive\n" \
"\tresume - resume from last stop\n" \
"\tstatus - show drive status\n" \
"\tstop - stop audio playback\n" \
"\tunlock - unlock door/tray\n" \
"\tvolume {n} - set volume to {n} where 0 <= {n} <= 255\n",
BCD_VERSION >> 8, BCD_VERSION & 0xff);
} else
printf("Unknown command '%s'\n", argv[i]);
if (_error || _bcd_error) printf("%s\n", bcd_error());
}
bcd_close();
exit(0);
}
#endif
-90
View File
@@ -1,90 +0,0 @@
/* bcd.h -- header file for BCD, a CD-ROM audio playing library for DJGPP
by Brennan Underwood, http://brennan.home.ml.org/ */
#ifndef _BCD_H
#define _BCD_H
#define BCD_VERSION 0x0103
/* Installation and setup functions */
/* Call this first! */
int bcd_open(void);
/* Call before exit. */
int bcd_close(void);
/* open door, unlocking first if necessary */
int bcd_open_door(void);
/* close door */
int bcd_close_door(void);
/* pass 1 to lock door, 0 to unlock */
int bcd_lock(int);
/* returns one of the following 3 #defined symbols */
int bcd_disc_changed(void);
#define BCD_DISC_CHANGED 0xff
#define BCD_DISC_NOT_CHANGED 1
#define BCD_DISC_UNKNOWN 0
/* perform a device reset */
int bcd_reset(void);
/* compare the returned status int to the following bits */
int bcd_device_status(void);
#define BCD_DOOR_OPEN 1
#define BCD_DOOR_UNLOCKED 2
#define BCD_SUPPORT_COOKED 4
#define BCD_READ_ONLY 8
#define BCD_DATA_READ_ONLY 16
#define BCD_SUPPORT_INTERLEAVE 32
/* returns 1 if audio is currently playing, 0 otherwise. -1 on error */
int bcd_audio_busy(void);
/* current head position in frames */
int bcd_audio_position(void);
/* convenience function, if audio busy, returns track# playing now */
int bcd_now_playing(void);
/* query MSCDEX for track list when disc changed or just starting up */
int bcd_get_audio_info(void);
/* get a particular track's info */
int bcd_get_track_address(int trackno, int *start, int *len);
/* check for track's audio/data status */
int bcd_track_is_audio(int trackno);
/* play a particular track from beginning to end */
int bcd_play_track(int tracknum);
/* play an arbitrary section of audio for an arbitrary length of time */
int bcd_play(int start, int len);
/* set the output volume. pass a parameter from 0-255 */
int bcd_set_volume(int);
/* stop and pause are equivalent */
int bcd_stop(void);
#define bcd_pause bcd_stop
int bcd_resume(void);
/* Troubleshooting */
/* Returns a human readable description of the last error encountered */
const char *bcd_error(void);
extern int _error_code;
/* If you are mad enough play the Rach 3, I mean parse _error_code yourself */
#define BCD_DE_WRITE_PROTECT 0
#define BCD_DE_UNKNOWN_UNIT 1
#define BCD_DE_DRIVE_NOT_READY 2
#define BCD_DE_UNKNOWN_COMMAND 3
#define BCD_DE_CRC_ERROR 4
#define BCD_DE_STRUCT_LEN 5
#define BCD_DE_SEEK_ERROR 6
#define BCD_DE_UNKNOWN_MEDIA 7
#define BCD_DE_SECTOR_NOT_FOUND 8
#define BCD_DE_OUT_OF_PAPER 9
#define BCD_DE_WRITE_FAULT 10
#define BCD_DE_READ_FAULT 11
#define BCD_DE_GENERAL_FAILURE 12
#define BCD_DE_INVALID_DISK_CHANGE 15
/* set by BCD itself, for stuff like "Out of memory" */
extern const char *_bcd_error;
/* uncomment this line to force BCD to use a statically allocated
Track array instead of using malloc */
#define STATIC_TRACKS
#endif
-445
View File
@@ -1,445 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief cd music interface (uses bcd library)
// Alam_GBC: I hate you, Brennan Underwood :)
#include "../doomtype.h"
#include "bcd.c"
//#include "bcd.h" // CD-Audio library by Brennan Underwood
#include "../doomdef.h"
#include "../i_sound.h"
#include "../command.h"
#include "../i_system.h"
#include "../s_sound.h"
// ------
// protos
// ------
static void Command_Cd_f (void);
//======================================================================
// CD AUDIO MUSIC SUBSYSTEM
//======================================================================
UINT8 cdaudio_started=0; // for system startup/shutdown
#define MAX_CD_TRACKS 256
static boolean cdPlaying = false;
static int cdPlayTrack; // when cdPlaying is true
static boolean cdLooping = false;
static UINT8 cdRemap[MAX_CD_TRACKS];
static boolean cdEnabled=true; // cd info available
static boolean cdValid; // true when last cd audio info was ok
static boolean wasPlaying;
static int cdVolume=0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track
// some crap cd drivers take up to
// a second for a simple 'busy' check..
// (on those Update can be disabled)
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
// hour,minutes,seconds
FUNCINLINE static ATTRINLINE char *hms(int hsg)
{
int hours, minutes, seconds;
static char s[9];
seconds = hsg / 75;
minutes = seconds / 60;
seconds %= 60;
hours = minutes / 60;
minutes %= 60;
if (hours>0)
sprintf (s, "%d:%02d:%02d", hours, minutes, seconds);
else
sprintf (s, "%2d:%02d", minutes, seconds);
return s;
}
static void Command_Cd_f (void)
{
const char * s;
int i,j;
if (!cdaudio_started)
return;
if (COM_Argc()<2)
{
CONS_Printf ("cd [on] [off] [remap] [reset] [open]\n"
" [info] [play <track>] [loop <track>]\n"
" [stop] [resume]\n");
return;
}
s = COM_Argv(1);
// activate cd music
if (!strncmp(s,"on",2))
{
cdEnabled = true;
return;
}
// stop/deactivate cd music
if (!strncmp(s,"off",3))
{
if (cdPlaying)
I_StopCD ();
cdEnabled = false;
return;
}
// remap tracks
if (!strncmp(s,"remap",5))
{
i = COM_Argc() - 2;
if (i <= 0)
{
CONS_Printf ("CD tracks remapped in that order :\n");
for (j = 1; j < MAX_CD_TRACKS; j++)
if (cdRemap[j] != j)
CONS_Printf (" %2d -> %2d\n", j, cdRemap[j]);
return;
}
for (j = 1; j <= i; j++)
cdRemap[j] = atoi (COM_Argv (j+1));
return;
}
// reset the CD driver, useful on some odd cd's
if (!strncmp(s,"reset",5))
{
cdEnabled = true;
if (cdPlaying)
I_StopCD ();
for (i = 0; i < MAX_CD_TRACKS; i++)
cdRemap[i] = i;
bcd_reset ();
cdValid = bcd_get_audio_info ();
return;
}
// any other command is not allowed until we could retrieve cd information
if (!cdValid)
{
CONS_Printf ("CD is not ready.\n");
return;
}
if (!strncmp(s,"open",4))
{
if (cdPlaying)
I_StopCD ();
bcd_open_door();
cdValid = false;
return;
}
if (!strncmp(s,"info",4))
{
int totaltime = 0;
if (!bcd_get_audio_info())
{
CONS_Printf ("Error getting audio info: %s\n",bcd_error());
cdValid = false;
return;
}
cdValid = true;
if (lowest_track == 0)
CONS_Printf ("No audio tracks\n");
else
{
// display list of tracks
// highlight current playing track
for (i=lowest_track; i <= highest_track; i++)
{
CONS_Printf ("%s%2d. %s %s\n",
cdPlaying && (cdPlayTrack == i) ? "\2 " : " ",
i, tracks[i].is_audio ? "audio" : "data ",
hms(tracks[i].len));
if (tracks[i].is_audio)
totaltime += tracks[i].len;
}
if (totaltime)
CONS_Printf ("\2Total time : %s\n", hms(totaltime));
}
if (cdPlaying)
{
CONS_Printf ("%s track : %d\n", cdLooping ? "looping" : "playing",
cdPlayTrack);
}
return;
}
if (!strncmp(s,"play",4))
{
I_PlayCD ((UINT8)atoi (COM_Argv (2)), false);
return;
}
if (!strncmp(s,"stop",4))
{
I_StopCD ();
return;
}
if (!strncmp(s,"loop",4))
{
I_PlayCD ((UINT8)atoi (COM_Argv (2)), true);
return;
}
if (!strncmp(s,"resume",4))
{
I_ResumeCD ();
return;
}
CONS_Printf ("cd command '%s' unknown\n", s);
}
// pause cd music
void I_StopCD (void)
{
if (!cdaudio_started || !cdEnabled)
return;
bcd_stop();
wasPlaying = cdPlaying;
cdPlaying = false;
}
// continue after a pause
void I_ResumeCD (void)
{
if (!cdaudio_started || !cdEnabled)
return;
if (!cdValid)
return;
if (!wasPlaying)
return;
bcd_resume ();
cdPlaying = true;
}
void I_ShutdownCD (void)
{
int rc;
if (!cdaudio_started)
return;
I_StopCD ();
rc = bcd_close ();
if (!rc)
CONS_Printf ("Error shuting down cd\n");
}
void I_InitCD (void)
{
int rc;
int i;
rc = bcd_open ();
if (rc>=0x200)
{
CONS_Printf ("MSCDEX version %d.%d\n", rc>>8, rc&255);
I_AddExitFunc (I_ShutdownCD);
cdaudio_started = true;
}
else
{
if (!rc)
CONS_Printf ("%s\n", bcd_error() );
cdaudio_started = false;
return;
}
// last saved in config.cfg
i = cd_volume.value;
I_SetVolumeCD (0); // initialize to 0 for some odd cd drivers
I_SetVolumeCD (i); // now set the last saved volume
for (i = 0; i < MAX_CD_TRACKS; i++)
cdRemap[i] = i;
if (!bcd_get_audio_info())
{
CONS_Printf("\2CD Init: No CD in player.\n");
cdEnabled = false;
cdValid = false;
}
else
{
cdEnabled = true;
cdValid = true;
}
COM_AddCommand ("cd", Command_Cd_f);
}
// loop/go to next track when track is finished (if cd_update var is true)
// update the volume when it has changed (from console/menu)
/// \todo check for cd change and restart music ?
void I_UpdateCD (void)
{
int newVolume;
int now;
static int last; //game tics (35th of second)
if (!cdaudio_started)
return;
now = I_GetTime ();
if ((now - last) < 10) // about 1/4 second
return;
last = now;
// update cd volume changed at console/menu
newVolume = cd_volume.value & 31;
if (cdVolume != newVolume)
I_SetVolumeCD (newVolume);
// slow drivers exit here
if (!cdUpdate.value)
return;
if (cdPlaying)
{
if (!bcd_audio_busy())
{
cdPlaying = false;
if (cdLooping)
I_PlayCD (cdPlayTrack, true);
else
{
// play the next cd track, or restart the first
cdPlayTrack++;
if (cdPlayTrack > highest_track)
cdPlayTrack = lowest_track;
while (!tracks[cdPlayTrack].is_audio && cdPlayTrack<highest_track)
cdPlayTrack++;
I_PlayCD (cdPlayTrack, true);
}
}
}
}
//
void I_PlayCD (UINT8 track, UINT8 looping)
{
if (!cdaudio_started || !cdEnabled)
return;
if (!cdValid)
return;
track = cdRemap[track];
if (cdPlaying)
{
if (cdPlayTrack == track)
return;
I_StopCD ();
}
if (track < lowest_track || track > highest_track)
{
//CONS_Printf ("\2CD Audio: wrong track number %d\n", track);
// suppose there are not enough tracks for game levels..
// then do a modulo so we always get something to hear
track = (track % (highest_track-lowest_track+1)) + 1;
//return;
}
cdPlayTrack = track;
if (!tracks[track].is_audio)
{
CONS_Printf ("\2CD Play: not an audio track\n");
return;
}
cdLooping = looping;
if (!bcd_play_track (track))
{
CONS_Printf ("CD Play: could not play track %d\n", track);
cdValid = false;
cdPlaying = false;
return;
}
cdPlaying = true;
}
// volume : logical cd audio volume 0-31 (hardware is 0-255)
boolean I_SetVolumeCD (INT32 volume)
{
int hardvol;
if (!cdaudio_started || !cdEnabled)
return false;
// translate to hardware volume
volume &= 31;
hardvol = ((volume+1)<<3)-1; //highest volume is 255
if (hardvol<=8)
hardvol=0; //lowest volume is ZERO
cdVolume = volume;
if (bcd_set_volume (hardvol))
{
CV_SetValue (&cd_volume, volume);
return true;
}
else
return false;
}
-78
View File
@@ -1,78 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief Main program, simply calls D_SRB2Main high level loop.
#include "../doomdef.h"
#include "../m_argv.h"
#include "../d_main.h"
#include "../i_system.h"
#ifdef REMOTE_DEBUGGING
#include <i386-stub.h>
#include "rdb.h"
#endif
//### let's try with Allegro ###
#define alleg_mouse_unused
#define alleg_timer_unused
#define ALLEGRO_NO_KEY_DEFINES
#define alleg_keyboard_unused
#define alleg_joystick_unused
#define alleg_gfx_driver_unused
#define alleg_palette_unused
#define alleg_graphics_unused
#define alleg_vidmem_unused
#define alleg_flic_unused
#define alleg_sound_unused
#define alleg_file_unused
#define alleg_datafile_unused
#define alleg_math_unused
#define alleg_gui_unused
#include <allegro.h>
//### end of Allegro include ###
int main (int argc, char **argv)
{
myargc = argc;
myargv = argv;
{
//added:03-01-98:
// Setup signal handlers and other stuff BEFORE ANYTHING ELSE!
I_StartupSystem();
#ifdef REMOTE_DEBUGGING
/* Only setup if remote debugging is to be done, Muhahahaha!*/
gdb_serial_init(DEBUG_COM_PORT,DEBUG_COM_PORT_SPEED);
gdb_target_init();
breakpoint();
#endif
D_SRB2Main();
D_SRB2Loop();
}
//added:03-01-98:
// hmmm... it will never go here.
return 0;
}
#if ALLEGRO_VERSION == 4
END_OF_MAIN()
#endif
-113
View File
@@ -1,113 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief doomcom network interface
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#include <go32.h>
#include <pc.h>
#include <dpmi.h>
#include <dos.h>
#include <sys/nearptr.h>
#include "../doomdef.h"
#include "../i_system.h"
#include "../d_event.h"
#include "../d_net.h"
#include "../m_argv.h"
#include "../doomstat.h"
#include "../z_zone.h"
#include "../i_net.h"
#include "../i_tcp.h"
//
// NETWORKING
//
typedef enum
{
CMD_SEND = 1,
CMD_GET = 2,
} command_t;
static void External_Driver_Get(void);
static void External_Driver_Send(void);
static void External_Driver_FreeNode(INT32 nodenum);
static inline boolean External_Driver_OpenSocket(void)
{
I_NetGet = External_Driver_Get;
I_NetSend = External_Driver_Send;
I_NetCloseSocket = NULL;
I_NetFreeNodenum = External_Driver_FreeNode;
return true;
}
//
// I_InitNetwork
//
boolean I_InitNetwork (void)
{
int netgamepar;
netgamepar = M_CheckParm ("-net");
if (!netgamepar)
return false;
// externals drivers specific
__djgpp_nearptr_enable();
// set up for network
doomcom=(doomcom_t *)(__djgpp_conventional_base+atoi(myargv[netgamepar+1]));
CONS_Printf("I_DosNet : Using int 0x%x for communication\n",doomcom->intnum);
server = (doomcom->consoleplayer == 0);
if (!server)
COM_BufAddText("connect any\n");
// ipx + time + 4 (padding)
packetheaderlength=30+4+4;
hardware_MAXPACKETLENGTH = 512;
I_NetOpenSocket = External_Driver_OpenSocket;
return true;
}
FUNCNORETURN static ATTRNORETURN void External_Driver_Get(void)
{
I_Error("External_Driver_Get not supported at this time");
}
FUNCNORETURN static ATTRNORETURN void External_Driver_Send(void)
{
I_Error("External_Driver_Send not supported at this time");
}
FUNCNORETURN static ATTRNORETURN void External_Driver_FreeNode(INT32 nodenum)
{
nodenum = 0;
I_Error("External_Driver_FreeNode not supported at this time");
}
-619
View File
@@ -1,619 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief interface level code for sound
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include "../doomdef.h"
#include "../doomstat.h"
#include "../i_system.h"
#include "../i_sound.h"
#include "../z_zone.h"
#include "../m_argv.h"
#include "../m_misc.h"
#include "../w_wad.h"
#include "../s_sound.h"
#include "../console.h"
//### let's try with Allegro ###
#define alleg_mouse_unused
#define alleg_timer_unused
#define ALLEGRO_NO_KEY_DEFINES
#define alleg_keyboard_unused
#define alleg_joystick_unused
#define alleg_gfx_driver_unused
#define alleg_palette_unused
#define alleg_graphics_unused
#define alleg_vidmem_unused
#define alleg_flic_unused
//#define alleg_sound_unused we use it
#define alleg_file_unused
#define alleg_datafile_unused
#define alleg_math_unused
#define alleg_gui_unused
#include <allegro.h>
//### end of Allegro include ###
//allegro has 256 virtual voices
// warning should by a power of 2
#define VIRTUAL_VOICES 256
#define VOICESSHIFT 8
// Needed for calling the actual sound output.
#define SAMPLECOUNT 512
//
// this function converts raw 11khz, 8-bit data to a SAMPLE* that allegro uses
// it is need cuz allegro only loads samples from wavs and vocs
//added:11-01-98: now reads the frequency from the rawdata header.
// dsdata points a 4 UINT16 header:
// +0 : value 3 what does it mean?
// +2 : sample rate, either 11025 or 22050.
// +4 : number of samples, each sample is a single byte since it's 8bit
// +6 : value 0
static inline SAMPLE *raw2SAMPLE(UINT8 *dsdata, size_t len)
{
SAMPLE *spl;
spl=Z_Malloc(sizeof (SAMPLE),PU_SOUND,NULL);
if (spl==NULL)
I_Error("Raw2Sample : no more free mem");
spl->bits = 8;
spl->stereo = 0;
spl->freq = *((UINT16 *)dsdata+1); //mostly 11025, but some at 22050.
spl->len = len-8;
spl->priority = 255; //priority;
spl->loop_start = 0;
spl->loop_end = len-8;
spl->param = -1;
spl->data=(void *)(dsdata+8); //skip the 8bytes header
return spl;
}
// This function loads the sound data from the WAD lump,
// for single sound.
//
void *I_GetSfx (sfxinfo_t * sfx)
{
UINT8 *dssfx;
if (sfx->lumpnum == LUMPERROR)
sfx->lumpnum = S_GetSfxLumpNum (sfx);
sfx->length = W_LumpLength (sfx->lumpnum);
dssfx = (UINT8 *) W_CacheLumpNum (sfx->lumpnum, PU_SOUND);
//_go32_dpmi_lock_data(dssfx,size);
// convert raw data and header from Doom sfx to a SAMPLE for Allegro
return (void *)raw2SAMPLE (dssfx, sfx->length);
}
void I_FreeSfx (sfxinfo_t *sfx)
{
if (sfx->lumpnum == LUMPERROR)
return;
// free sample data
if ( sfx->data )
Z_Free((UINT8 *) ((SAMPLE *)sfx->data)->data - 8);
Z_Free(sfx->data); // Allegro SAMPLE structure
sfx->data = NULL;
sfx->lumpnum = LUMPERROR;
}
FUNCINLINE static ATTRINLINE int Volset(int vol)
{
return (vol*255/31);
}
void I_SetSfxVolume(INT32 volume)
{
if (sound_disabled)
return;
set_volume (Volset(volume),-1);
}
//
// Starting a sound means adding it
// to the current list of active sounds
// in the internal channels.
// As the SFX info struct contains
// e.g. a pointer to the raw data,
// it is ignored.
// As our sound handling does not handle
// priority, it is ignored.
// Pitching (that is, increased speed of playback)
// is set, but currently not used by mixing.
//
INT32 I_StartSound ( sfxenum_t id,
INT32 vol,
INT32 sep,
INT32 pitch,
INT32 priority,
INT32 channel)
{
int voice;
(void)channel;
if (sound_disabled)
return 0;
// UNUSED
priority = 0;
pitch = (pitch-128)/2+128;
voice = play_sample(S_sfx[id].data,vol,sep,(pitch*1000)/128,0);
// Returns a handle
return (id<<VOICESSHIFT)+voice;
}
void I_StopSound (INT32 handle)
{
// You need the handle returned by StartSound.
// Would be looping all channels,
// tracking down the handle,
// an setting the channel to zero.
int voice=handle & (VIRTUAL_VOICES-1);
if (sound_disabled)
return;
if (voice_check(voice)==S_sfx[handle>>VOICESSHIFT].data)
deallocate_voice(voice);
}
INT32 I_SoundIsPlaying(INT32 handle)
{
if (sound_disabled)
return FALSE;
if (voice_check(handle & (VIRTUAL_VOICES-1))==S_sfx[handle>>VOICESSHIFT].data)
return TRUE;
return FALSE;
}
// cut and past from ALLEGRO he don't share it :(
static inline int absolute_freq(int freq, SAMPLE *spl)
{
if (freq == 1000)
return spl->freq;
else
return (spl->freq * freq) / 1000;
}
void I_UpdateSoundParams( INT32 handle,
INT32 vol,
INT32 sep,
INT32 pitch)
{
// I fail too see that this is used.
// Would be using the handle to identify
// on which channel the sound might be active,
// and resetting the channel parameters.
int voice=handle & (VIRTUAL_VOICES-1);
int numsfx=handle>>VOICESSHIFT;
if (sound_disabled)
return;
if (voice_check(voice)==S_sfx[numsfx].data)
{
voice_set_volume(voice, vol);
voice_set_pan(voice, sep);
voice_set_frequency(voice, absolute_freq(pitch*1000/128,
S_sfx[numsfx].data));
}
}
void I_ShutdownSound(void)
{
// Wait till all pending sounds are finished.
//added:03-01-98:
if ( !sound_started )
return;
//added:08-01-98: remove_sound() explicitly because we don't use
// Allegro's allegro_exit();
remove_sound();
sound_started = false;
}
static char soundheader[] = "sound";
#if ALLEGRO_VERSION == 3
static char soundvar[] = "sb_freq";
#else
static char soundvar[] = "sound_freq";
#endif
void I_StartupSound(void)
{
int sfxcard,midicard;
#if ALLEGRO_VERSION == 3
char err[255];
#endif
if (sound_disabled)
sfxcard=DIGI_NONE;
else
sfxcard=DIGI_AUTODETECT;
if (midi_disabled)
midicard=MIDI_NONE;
else
midicard=MIDI_AUTODETECT; //DetectMusicCard();
digital_disabled=true; //Alam: No OGG/MP3/IT/MOD support
// Secure and configure sound device first.
CONS_Printf("I_StartupSound: ");
//Fab:25-04-98:note:install_sound will check for sound settings
// in the sound.cfg or allegro.cfg, in the current directory,
// or the directory pointed by 'ALLEGRO' env var.
#if ALLEGRO_VERSION == 3
if (install_sound(sfxcard,midicard,NULL)!=0)
{
sprintf (err,"Sound init error : %s\n",allegro_error);
CONS_Error (err);
sound_disabled=true;
midi_disabled=true;
}
else
{
CONS_Printf(" configured audio device\n" );
}
//added:08-01-98:we use a similar startup/shutdown scheme as Allegro.
I_AddExitFunc(I_ShutdownSound);
#endif
sound_started = true;
CV_SetValue(&cv_samplerate,get_config_int(soundheader,soundvar,cv_samplerate.value));
}
//
// MUSIC API.
// Still no music done.
// Remains. Dummies.
//
static MIDI* currsong; //im assuming only 1 song will be played at once
static int islooping=0;
static int musicdies=-1;
UINT8 music_started=0;
boolean songpaused=false;
/// ------------------------
// MUSIC SYSTEM
/// ------------------------
/* load_midi_mem:
* Loads a standard MIDI file from memory, returning a pointer to
* a MIDI structure, * or NULL on error.
* It is the load_midi from Allegro modified to load it from memory
*/
static MIDI *load_midi_mem(char *mempointer,int *e)
{
int c = *e;
long data=0;
unsigned char *fp;
MIDI *midi;
int num_tracks=0;
fp = (void *)mempointer;
if (!fp)
return NULL;
midi = malloc(sizeof (MIDI)); /* get some memory */
if (!midi)
return NULL;
for (c=0; c<MIDI_TRACKS; c++)
{
midi->track[c].data = NULL;
midi->track[c].len = 0;
}
fp+=4+4; // header size + 'chunk' size
swab(fp,&data,2); // convert to intel-endian
fp+=2; /* MIDI file type */
if ((data != 0) && (data != 1)) // only type 0 and 1 are suported
return NULL;
swab(fp,&num_tracks,2); /* number of tracks */
fp+=2;
if ((num_tracks < 1) || (num_tracks > MIDI_TRACKS))
return NULL;
swab(fp,&data,2); /* beat divisions */
fp+=2;
midi->divisions = ABS(data);
for (c=0; c<num_tracks; c++)
{ /* read each track */
if (memcmp(fp, "MTrk", 4))
return NULL;
fp+=4;
//swab(fp,&data,4); don't work !!!!??
((char *)&data)[0]=fp[3];
((char *)&data)[1]=fp[2];
((char *)&data)[2]=fp[1];
((char *)&data)[3]=fp[0];
fp+=4;
midi->track[c].len = data;
midi->track[c].data = fp;
fp+=data;
}
lock_midi(midi);
return midi;
}
void I_InitMusic(void)
{
if (midi_disabled)
return;
I_AddExitFunc(I_ShutdownMusic);
music_started = true;
songpaused = false;
}
void I_ShutdownMusic(void)
{
if ( !music_started )
return;
I_StopSong();
music_started=false;
}
/// ------------------------
// MUSIC PROPERTIES
/// ------------------------
musictype_t I_SongType(void)
{
if (currsong)
return MU_MID;
else
return MU_NONE;
}
boolean I_SongPlaying()
{
return (boolean)currsong;
}
boolean I_SongPaused()
{
return songpaused;
}
/// ------------------------
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
{
(void)speed;
return false;
}
/// ------------------------
// MUSIC SEEKING
/// ------------------------
UINT32 I_GetSongLength(void)
{
return 0;
}
boolean I_SetSongLoopPoint(UINT32 looppoint)
{
(void)looppoint;
return false;
}
UINT32 I_GetSongLoopPoint(void)
{
return 0;
}
boolean I_SetSongPosition(UINT32 position)
{
(void)position;
return false;
}
UINT32 I_GetSongPosition(void)
{
return 0;
}
/// ------------------------
// MUSIC PLAYBACK
/// ------------------------
boolean I_LoadSong(char *data, size_t len)
{
int e = len; //Alam: For error
if (midi_disabled)
return 0;
if (memcmp(data,"MThd",4)==0) // support mid file in WAD !!!
{
currsong=load_midi_mem(data,&e);
}
else
{
CONS_Printf("Music Lump is not a MIDI lump\n");
return 0;
}
if (currsong==NULL)
{
CONS_Printf("Not a valid mid file : %d\n",e);
return 0;
}
return 1;
}
void I_UnloadSong(void)
{
handle = 0;
if (midi_disabled)
return;
//destroy_midi(currsong);
}
boolean I_PlaySong(boolean looping)
{
handle = 0;
if (midi_disabled)
return false;
islooping = looping;
musicdies = gametic + NEWTICRATE*30;
if (play_midi(currsong,looping)==0)
return true;
return false;
}
void I_StopSong(void)
{
handle = 0;
if (midi_disabled)
return;
islooping = 0;
musicdies = 0;
stop_midi();
songpaused = false;
}
void I_PauseSong (INT32 handle)
{
handle = 0;
if (midi_disabled)
return;
midi_pause();
songpaused = true;
}
void I_ResumeSong (INT32 handle)
{
handle = 0;
if (midi_disabled)
return;
midi_resume();
songpaused = false;
}
void I_SetMusicVolume(INT32 volume)
{
if (midi_disabled)
return;
// Now set volume on output device.
set_volume (-1, Volset(volume));
}
boolean I_SetSongTrack(INT32 track)
{
(void)track;
return false;
}
// Is the song playing?
#if 0
int I_QrySongPlaying(int handle)
{
if (midi_disabled)
return 0;
//return islooping || musicdies > gametic;
return (midi_pos==-1);
}
#endif
/// ------------------------
// MUSIC FADING
/// ------------------------
void I_SetInternalMusicVolume(UINT8 volume)
{
(void)volume;
}
void I_StopFadingSong(void)
{
}
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void));
{
(void)target_volume;
(void)source_volume;
(void)ms;
return false;
}
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void));
{
(void)target_volume;
(void)ms;
return false;
}
boolean I_FadeOutStopSong(UINT32 ms)
{
(void)ms;
return false;
}
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
{
(void)ms;
(void)looping;
return false;
}
File diff suppressed because it is too large. Load diff
-336
View File
@@ -1,336 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief hardware and software level, screen and video i/o, refresh,
/// setup ... a big mess. Got to clean that up!
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#include <sys/time.h>
#include <sys/types.h>
//#include <sys/socket.h>
#include <netinet/in.h>
//#include <errnos.h>
#include <signal.h>
#include <go32.h>
#include <pc.h>
#include <dpmi.h>
#include <dos.h>
#include <sys/nearptr.h>
#include "../doomdef.h"
#include "../i_system.h"
#include "../v_video.h"
#include "../m_argv.h"
#include "vid_vesa.h"
#include "../i_video.h"
//dosstuff -newly added
static unsigned long dascreen;
static int gfx_use_vesa1;
boolean highcolor;
#define SCREENDEPTH 1 // bytes per pixel, do NOT change.
rendermode_t rendermode=render_soft;
//
// I_OsPolling
//
void I_OsPolling(void)
{
I_GetEvent();
//i dont think i have to do anything else here
}
//
// I_UpdateNoBlit
//
void I_UpdateNoBlit (void)
{
// what is this?
}
//profile stuff ---------------------------------------------------------
//added:16-01-98:wanted to profile the VID_BlitLinearScreen() asm code.
//#define TIMING //uncomment this to enable profiling
#ifdef TIMING
#include "../p5prof.h"
static INT64 mycount;
static INT64 mytotal = 0;
static unsigned long nombre = NEWTICRATE*10;
//static char runtest[10][80];
#endif
//profile stuff ---------------------------------------------------------
//
// I_FinishUpdate
//
static void I_BlitScreenVesa1(void); //see later
void I_FinishUpdate (void)
{
// draw FPS if enabled
if (cv_ticrate.value)
SCR_DisplayTicRate();
if (cv_showping.value && netgame && consoleplayer != serverplayer)
SCR_DisplayLocalPing();
//blast it to the screen
// this code sucks
//memcpy(dascreen,screens[0],screenwidth*screenheight);
//added:03-01-98: I tried to I_WaitVBL(1) here, but it slows down
// the game when the view becomes complicated, it looses ticks
if (cv_vidwait.value)
I_WaitVBL(1);
//added:16-01-98:profile screen blit.
#ifdef TIMING
ProfZeroTimer();
#endif
//added:08-01-98: support vesa1 bank change, without Allegro's BITMAP screen.
if ( gfx_use_vesa1 )
{
I_Error("Banked screen update not finished for dynamic res\n");
I_BlitScreenVesa1(); //blast virtual to physical screen.
}
else
{
//added:16-01-98:use quickie asm routine, last 2 args are
// src and dest rowbytes
// (memcpy is as fast as this one...)
VID_BlitLinearScreen(screens[0], vid.direct,
vid.width*vid.bpp, vid.height,
vid.width*vid.bpp, vid.rowbytes );
}
#ifdef TIMING
RDMSR(0x10,&mycount);
mytotal += mycount; //64bit add
if (nombre--==0)
I_Error("ScreenBlit CPU Spy reports: 0x%d %d\n", *((int *)&mytotal+1),
(int)mytotal );
#endif
}
//
// I_UpdateNoVsync
//
void I_UpdateNoVsync(void)
{
int real_vidwait = cv_vidwait.value;
cv_vidwait.value = 0;
I_FinishUpdate();
cv_vidwait.value = real_vidwait;
}
//
// I_ReadScreen
//
void I_ReadScreen (UINT8 *scr)
{
VID_BlitLinearScreen(screens[0], scr,
vid.width*vid.bpp, vid.height,
vid.width*vid.bpp, vid.rowbytes );
}
void I_SetPalette (RGBA_t *palette)
{
int i;
outportb(0x3c8,0);
for (i=0;i<256;i++,palette++)
{
outportb(0x3c9,palette->s.red>>2);
outportb(0x3c9,palette->s.green>>2);
outportb(0x3c9,palette->s.blue>>2);
}
}
//added 29-12-1997
/*==========================================================================*/
// I_BlastScreen : copy the virtual screen buffer to the physical screen mem
// using bank switching if needed.
/*==========================================================================*/
static void I_BlitScreenVesa1(void)
{
#define VIDBANKSIZE (1<<16)
#define VIDBANKSIZEMASK (VIDBANKSIZE-1) // defines ahoy!
__dpmi_regs r;
UINT8 *p_src;
long i;
long virtualsize;
// virtual screen buffer size
virtualsize = vid.rowbytes * vid.height * SCREENDEPTH;
p_src = screens[0];
for (i=0; virtualsize > 0; i++ )
{
r.x.ax = 0x4f05;
r.x.bx = 0x0;
r.x.cx = 0x0;
r.x.dx = i;
__dpmi_int(0x10,&r); //set bank
M_Memcpy((UINT8 *)dascreen,p_src,(virtualsize < VIDBANKSIZE) ? virtualsize : VIDBANKSIZE );
p_src += VIDBANKSIZE;
virtualsize -= VIDBANKSIZE;
}
}
//added:08-01-98: now we use Allegro's set_gfx_mode, but we want to
// restore the exact text mode that was before.
static INT16 myOldVideoMode;
static inline void I_SaveOldVideoMode(void)
{
__dpmi_regs r;
r.x.ax = 0x4f03; // Return current video mode
__dpmi_int(0x10,&r);
if ( r.x.ax != 0x4f )
myOldVideoMode = -1;
else
myOldVideoMode = r.x.bx;
}
//
// Close the screen, restore previous video mode.
//
void I_ShutdownGraphics (void)
{
__dpmi_regs r;
rendermode = render_none;
if ( !graphics_started )
return;
// free the last video mode screen buffers
if (vid.buffer)
free (vid.buffer);
/* Restore old video mode */
if (myOldVideoMode!=-1)
{
/* Restore old video mode */
r.x.ax = 0x4f02; // Set Super VGA video mode
r.x.bx = myOldVideoMode;
__dpmi_int(0x10,&r);
// Boris: my s3 don't do a cls because "win95" :<
clrscr();
}
else // no vesa put the normal video mode
{
r.x.ax = 0x03;
__dpmi_int(0x10,&r);
}
graphics_started = false;
}
//added:08-01-98:
// Set VESA1 video mode, coz Allegro set_gfx_mode a larger screenwidth...
//
#if 0
int set_vesa1_mode( int width, int height )
{
__dpmi_regs r;
// setup video mode.
r.x.ax = 0x4f02;
if ( ( width==320 )&&( height==200 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x13; // 320x 200x1 (256 colors)
else
if ( ( width==320 )&&( height==240 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x154; // 320x 240x1 (256 colors)
else
if ( ( width==320 )&&( height==400 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x155; // 320x 400x1 (256 colors)
else
if ( ( width==640 )&&( height==400 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x100; // 640x 400x1 (256 colors)
else
if ( ( width==640 )&&( height==480 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x101; // 640x 480x1 (256 colors)
else
if ( ( width==800 )&&( height==600 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x103; // 800x 600x1 (256 colors)
else
if ( ( width==1024)&&( height==768 ) && ( SCREENDEPTH==1 ) )
r.x.bx = 0x105; //1024x 768x1 (256 colors)
else
I_Error("I_SetVesa1Mode: video mode not supported.");
// enter graphics mode.
__dpmi_int(0x10,&r);
if ( r.x.ax != 0x4f )
I_Error("I_SetVesa1Mode: init video mode failed !");
return 0;
}
#endif
//added:08-01-98: now uses Allegro to setup Linear Frame Buffer video modes.
//
// Initialize video mode, setup dynamic screen size variables,
// and allocate screens.
//
void I_StartupGraphics(void)
{
//added:26-01-98: VID_Init() must be done only once,
// use VID_SetMode() to change vid mode while in the game.
if ( graphics_started )
return;
// remember the exact screen mode we were...
I_SaveOldVideoMode();
CONS_Printf("Vid_Init...");
// 0 for 256 color, else use highcolor modes
highcolor = M_CheckParm ("-highcolor");
VID_Init();
//gfx_use_vesa1 = false;
//added:03-01-98: register exit code for graphics
I_AddExitFunc(I_ShutdownGraphics);
graphics_started = true;
}
-773
View File
@@ -1,773 +0,0 @@
/* ______ ___ ___
* /\ _ \ /\_ \ /\_ \
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
* /\____/
* \_/__/
*
* Some definitions for internal use by the library code.
* This should not be included by user programs.
*
* By Shawn Hargreaves.
*
* See readme.txt for copyright information.
*/
#ifndef INTERNAL_H
#define INTERNAL_H
#include "allegro.h"
/* ______ ___ ___
* /\ _ \ /\_ \ /\_ \
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
* /\____/
* \_/__/
*
* Some definitions for internal use by the library code.
* This should not be included by user programs.
*
* By Shawn Hargreaves.
*
* See readme.txt for copyright information.
*/
#ifndef INTERNDJ_H
#define INTERNDJ_H
#ifndef DJGPP
#error This file should only be used by the djgpp version of Allegro
#endif
#include <dos.h>
/* file access macros */
#define FILE_OPEN(filename, handle) handle = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR)
#define FILE_CREATE(filename, handle) handle = open(filename, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)
#define FILE_CLOSE(handle) close(handle)
#define FILE_READ(handle, buf, size, sz) sz = read(handle, buf, size)
#define FILE_WRITE(handle, buf, size, sz) sz = write(handle, buf, size)
#define FILE_SEARCH_STRUCT struct ffblk
#define FILE_FINDFIRST(filename, attrib, dta) findfirst(filename, dta, attrib)
#define FILE_FINDNEXT(dta) findnext(dta)
#define FILE_ATTRIB ff_attrib
#define FILE_SIZE ff_fsize
#define FILE_NAME ff_name
#define FILE_TIME ff_ftime
#define FILE_DATE ff_fdate
/* macros to enable and disable interrupts */
#define DISABLE() asm volatile ("cli")
#define ENABLE() asm volatile ("sti")
__INLINE__ void enter_critical(void)
{
if (windows_version >= 3) {
__dpmi_regs r;
r.x.ax = 0x1681;
__dpmi_int(0x2F, &r);
}
DISABLE();
}
__INLINE__ void exit_critical(void)
{
if (windows_version >= 3) {
__dpmi_regs r;
r.x.ax = 0x1682;
__dpmi_int(0x2F, &r);
}
ENABLE();
}
/* interrupt hander stuff */
#define _map_irq(irq) (((irq)>7) ? ((irq)+104) : ((irq)+8))
int _install_irq(int num, int (*handler)(void));
void _remove_irq(int num);
void _restore_irq(int irq);
void _enable_irq(int irq);
void _disable_irq(int irq);
#define _eoi(irq) { outportb(0x20, 0x20); if ((irq)>7) outportb(0xA0, 0x20); }
typedef struct _IRQ_HANDLER
{
int (*handler)(void); /* our C handler */
int number; /* irq number */
__dpmi_paddr old_vector; /* original protected mode vector */
} _IRQ_HANDLER;
/* DPMI memory mapping routines */
int _create_physical_mapping(unsigned long *linear, int *segment, unsigned long physaddr, int size);
void _remove_physical_mapping(unsigned long *linear, int *segment);
int _create_linear_mapping(unsigned long *linear, unsigned long physaddr, int size);
void _remove_linear_mapping(unsigned long *linear);
int _create_selector(int *segment, unsigned long linear, int size);
void _remove_selector(int *segment);
void _unlock_dpmi_data(void *addr, int size);
/* bank switching routines */
void _accel_bank_stub(void);
void _accel_bank_stub_end(void);
void _accel_bank_switch (void);
void _accel_bank_switch_end(void);
void _vesa_window_1(void);
void _vesa_window_1_end(void);
void _vesa_window_2(void);
void _vesa_window_2_end(void);
void _vesa_pm_window_1(void);
void _vesa_pm_window_1_end(void);
void _vesa_pm_window_2(void);
void _vesa_pm_window_2_end(void);
void _vesa_pm_es_window_1(void);
void _vesa_pm_es_window_1_end(void);
void _vesa_pm_es_window_2(void);
void _vesa_pm_es_window_2_end(void);
/* stuff for the VESA and VBE/AF drivers */
extern __dpmi_regs _dpmi_reg;
extern int _window_2_offset;
extern void (*_pm_vesa_switcher)(void);
extern void (*_pm_vesa_scroller)(void);
extern void (*_pm_vesa_pallete)(void);
extern int _mmio_segment;
extern void *_accel_driver;
extern int _accel_active;
extern void *_accel_set_bank;
extern void *_accel_idle;
void _fill_vbeaf_libc_exports(void *ptr);
void _fill_vbeaf_pmode_exports(void *ptr);
/* sound lib stuff */
extern int _fm_port;
extern int _mpu_port;
extern int _mpu_irq;
extern int _sb_freq;
extern int _sb_port;
extern int _sb_dma;
extern int _sb_irq;
int _sb_read_dsp_version(void);
int _sb_reset_dsp(int data);
void _sb_voice(int state);
int _sb_set_mixer(int digi_volume, int midi_volume);
void _mpu_poll(void);
int _dma_allocate_mem(int bytes, int *sel, unsigned long *phys);
void _dma_start(int channel, unsigned long addr, int size, int auto_init, int input);
void _dma_stop(int channel);
unsigned long _dma_todo(int channel);
void _dma_lock_mem(void);
#endif /* ifndef INTERNDJ_H */
/* flag for how many times we have been initialised */
extern int _allegro_count;
/* some Allegro functions need a block of scratch memory */
extern void *_scratch_mem;
extern int _scratch_mem_size;
__INLINE__ void _grow_scratch_mem(int size)
{
if (size > _scratch_mem_size) {
size = (size+1023) & 0xFFFFFC00;
_scratch_mem = realloc(_scratch_mem, size);
_scratch_mem_size = size;
}
}
/* list of functions to call at program cleanup */
void _add_exit_func(void (*func)(void));
void _remove_exit_func(void (*func)(void));
/* reads a translation file into memory */
void _load_config_text(void);
/* various bits of mouse stuff */
void _set_mouse_range(void);
extern BITMAP *_mouse_screen;
extern BITMAP *_mouse_sprite, *_mouse_pointer;
extern int _mouse_x_focus, _mouse_y_focus;
extern int _mouse_width, _mouse_height;
/* various bits of timer stuff */
extern int _timer_use_retrace;
extern volatile int _retrace_hpp_value;
/* caches and tables for svga bank switching */
extern int _last_bank_1, _last_bank_2;
extern int *_gfx_bank;
/* bank switching routines */
void _stub_bank_switch (void);
void _stub_bank_switch_end(void);
/* stuff for setting up bitmaps */
void _check_gfx_virginity(void);
BITMAP *_make_bitmap(int w, int h, unsigned long addr, GFX_DRIVER *driver, int color_depth, int bpl);
void _sort_out_virtual_width(int *width, GFX_DRIVER *driver);
GFX_VTABLE *_get_vtable(int color_depth);
extern GFX_VTABLE _screen_vtable;
extern int _sub_bitmap_id_count;
extern int _textmode;
#define BYTES_PER_PIXEL(bpp) (((int)(bpp) + 7) / 8)
int _color_load_depth(int depth);
extern int _color_conv;
BITMAP *_fixup_loaded_bitmap(BITMAP *bmp, PALETTE pal, int bpp);
/* VGA register access routines */
void _vga_vsync(void);
void _vga_set_pallete_range(PALLETE p, int from, int to, int vsync);
extern int _crtc;
/* _read_vga_register:
* Reads the contents of a VGA register.
*/
__INLINE__ int _read_vga_register(int port, int index)
{
if (port==0x3C0)
inportb(_crtc+6);
outportb(port, index);
return inportb(port+1);
}
/* _write_vga_register:
* Writes a byte to a VGA register.
*/
__INLINE__ void _write_vga_register(int port, int index, int v)
{
if (port==0x3C0) {
inportb(_crtc+6);
outportb(port, index);
outportb(port, v);
}
else {
outportb(port, index);
outportb(port+1, v);
}
}
/* _alter_vga_register:
* Alters specific bits of a VGA register.
*/
__INLINE__ void _alter_vga_register(int port, int index, int mask, int v)
{
int temp;
temp = _read_vga_register(port, index);
temp &= (~mask);
temp |= (v & mask);
_write_vga_register(port, index, temp);
}
/* _vsync_out_h:
* Waits until the VGA is not in either a vertical or horizontal retrace.
*/
__INLINE__ void _vsync_out_h(void)
{
do {
} while (inportb(0x3DA) & 1);
}
/* _vsync_out_v:
* Waits until the VGA is not in a vertical retrace.
*/
__INLINE__ void _vsync_out_v(void)
{
do {
} while (inportb(0x3DA) & 8);
}
/* _vsync_in:
* Waits until the VGA is in the vertical retrace period.
*/
__INLINE__ void _vsync_in(void)
{
if (_timer_use_retrace) {
int t = retrace_count;
do {
} while (t == retrace_count);
}
else {
do {
} while (!(inportb(0x3DA) & 8));
}
}
/* _write_hpp:
* Writes to the VGA pelpan register.
*/
__INLINE__ void _write_hpp(int value)
{
if (_timer_use_retrace) {
_retrace_hpp_value = value;
do {
} while (_retrace_hpp_value == value);
}
else {
do {
} while (!(inportb(0x3DA) & 8));
_write_vga_register(0x3C0, 0x33, value);
}
}
void _set_vga_virtual_width(int old_width, int new_width);
/* current drawing mode */
extern int _drawing_mode;
extern BITMAP *_drawing_pattern;
extern int _drawing_x_anchor;
extern int _drawing_y_anchor;
extern unsigned int _drawing_x_mask;
extern unsigned int _drawing_y_mask;
/* graphics drawing routines */
void _normal_line(BITMAP *bmp, int x1, int y1, int x2, int y2, int color);
void _normal_rectfill(BITMAP *bmp, int x1, int y1, int x2, int y2, int color);
int _linear_getpixel8(struct BITMAP *bmp, int x, int y);
void _linear_putpixel8(struct BITMAP *bmp, int x, int y, int color);
void _linear_vline8(struct BITMAP *bmp, int x, int y1, int y2, int color);
void _linear_hline8(struct BITMAP *bmp, int x1, int y, int x2, int color);
void _linear_draw_sprite8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_v_flip8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_h_flip8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_vh_flip8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_trans_sprite8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_lit_sprite8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_draw_rle_sprite8(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_trans_rle_sprite8(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_lit_rle_sprite8(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y, int color);
void _linear_draw_character8(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_textout_fixed8(struct BITMAP *bmp, void *f, int h, unsigned char *str, int x, int y, int color);
void _linear_blit8(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_blit_backward8(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_masked_blit8(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_clear_to_color8(struct BITMAP *bitmap, int color);
#ifdef ALLEGRO_COLOR16
void _linear_putpixel15(struct BITMAP *bmp, int x, int y, int color);
void _linear_vline15(struct BITMAP *bmp, int x, int y1, int y2, int color);
void _linear_hline15(struct BITMAP *bmp, int x1, int y, int x2, int color);
void _linear_draw_trans_sprite15(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_lit_sprite15(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_draw_rle_sprite15(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_trans_rle_sprite15(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_lit_rle_sprite15(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y, int color);
int _linear_getpixel16(struct BITMAP *bmp, int x, int y);
void _linear_putpixel16(struct BITMAP *bmp, int x, int y, int color);
void _linear_vline16(struct BITMAP *bmp, int x, int y1, int y2, int color);
void _linear_hline16(struct BITMAP *bmp, int x1, int y, int x2, int color);
void _linear_draw_sprite16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_256_sprite16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_v_flip16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_h_flip16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_vh_flip16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_trans_sprite16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_lit_sprite16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_draw_rle_sprite16(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_trans_rle_sprite16(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_lit_rle_sprite16(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y, int color);
void _linear_draw_character16(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_textout_fixed16(struct BITMAP *bmp, void *f, int h, unsigned char *str, int x, int y, int color);
void _linear_blit16(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_blit_backward16(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_masked_blit16(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_clear_to_color16(struct BITMAP *bitmap, int color);
#endif
#ifdef ALLEGRO_COLOR24
int _linear_getpixel24(struct BITMAP *bmp, int x, int y);
void _linear_putpixel24(struct BITMAP *bmp, int x, int y, int color);
void _linear_vline24(struct BITMAP *bmp, int x, int y1, int y2, int color);
void _linear_hline24(struct BITMAP *bmp, int x1, int y, int x2, int color);
void _linear_draw_sprite24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_256_sprite24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_v_flip24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_h_flip24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_vh_flip24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_trans_sprite24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_lit_sprite24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_draw_rle_sprite24(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_trans_rle_sprite24(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_lit_rle_sprite24(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y, int color);
void _linear_draw_character24(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_textout_fixed24(struct BITMAP *bmp, void *f, int h, unsigned char *str, int x, int y, int color);
void _linear_blit24(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_blit_backward24(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_masked_blit24(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_clear_to_color24(struct BITMAP *bitmap, int color);
#endif
#ifdef ALLEGRO_COLOR32
int _linear_getpixel32(struct BITMAP *bmp, int x, int y);
void _linear_putpixel32(struct BITMAP *bmp, int x, int y, int color);
void _linear_vline32(struct BITMAP *bmp, int x, int y1, int y2, int color);
void _linear_hline32(struct BITMAP *bmp, int x1, int y, int x2, int color);
void _linear_draw_sprite32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_256_sprite32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_v_flip32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_h_flip32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_sprite_vh_flip32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_trans_sprite32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _linear_draw_lit_sprite32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_draw_rle_sprite32(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_trans_rle_sprite32(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _linear_draw_lit_rle_sprite32(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y, int color);
void _linear_draw_character32(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _linear_textout_fixed32(struct BITMAP *bmp, void *f, int h, unsigned char *str, int x, int y, int color);
void _linear_blit32(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_blit_backward32(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_masked_blit32(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _linear_clear_to_color32(struct BITMAP *bitmap, int color);
#endif
int _x_getpixel(struct BITMAP *bmp, int x, int y);
void _x_putpixel(struct BITMAP *bmp, int x, int y, int color);
void _x_vline(struct BITMAP *bmp, int x, int y1, int y2, int color);
void _x_hline(struct BITMAP *bmp, int x1, int y, int x2, int color);
void _x_draw_sprite(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _x_draw_sprite_v_flip(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _x_draw_sprite_h_flip(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _x_draw_sprite_vh_flip(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _x_draw_trans_sprite(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y);
void _x_draw_lit_sprite(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _x_draw_rle_sprite(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _x_draw_trans_rle_sprite(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y);
void _x_draw_lit_rle_sprite(struct BITMAP *bmp, struct RLE_SPRITE *sprite, int x, int y, int color);
void _x_draw_character(struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int color);
void _x_textout_fixed(struct BITMAP *bmp, void *f, int h, unsigned char *str, int x, int y, int color);
void _x_blit_from_memory(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _x_blit_to_memory(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _x_blit(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _x_blit_forward(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _x_blit_backward(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _x_masked_blit(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
void _x_clear_to_color(struct BITMAP *bitmap, int color);
/* asm helper for stretch_blit() */
void _do_stretch(BITMAP *source, BITMAP *dest, void *drawer, int sx, fixed sy, fixed syd, int dx, int dy, int dh, int color_depth);
/* number of fractional bits used by the polygon rasteriser */
#define POLYGON_FIX_SHIFT 18
/* bitfield specifying which polygon attributes need interpolating */
#define INTERP_FLAT 1
#define INTERP_1COL 2
#define INTERP_3COL 4
#define INTERP_FIX_UV 8
#define INTERP_Z 16
#define INTERP_FLOAT_UV 32
#define OPT_FLOAT_UV_TO_FIX 64
#define COLOR_TO_RGB 128
/* information for polygon scanline fillers */
typedef struct POLYGON_SEGMENT
{
fixed u, v, du, dv; /* fixed point u/v coordinates */
fixed c, dc; /* single color gouraud shade values */
fixed r, g, b, dr, dg, db; /* RGB gouraud shade values */
float z, dz; /* polygon depth (1/z) */
float fu, fv, dfu, dfv; /* floating point u/v coordinates */
unsigned char *texture; /* the texture map */
int umask, vmask, vshift; /* texture map size information */
int seg; /* destination bitmap selector */
} POLYGON_SEGMENT;
/* an active polygon edge */
typedef struct POLYGON_EDGE
{
int top; /* top y position */
int bottom; /* bottom y position */
fixed x, dx; /* fixed point x position and gradient */
fixed w; /* width of line segment */
POLYGON_SEGMENT dat; /* texture/gouraud information */
struct POLYGON_EDGE *prev; /* doubly linked list */
struct POLYGON_EDGE *next;
} POLYGON_EDGE;
/* prototype for the scanline filler functions */
typedef void (*SCANLINE_FILLER)(unsigned long addr, int w, POLYGON_SEGMENT *info);
/* polygon helper functions */
extern SCANLINE_FILLER _optim_alternative_drawer;
POLYGON_EDGE *_add_edge(POLYGON_EDGE *list, POLYGON_EDGE *edge, int sort_by_x);
POLYGON_EDGE *_remove_edge(POLYGON_EDGE *list, POLYGON_EDGE *edge);
void _fill_3d_edge_structure(POLYGON_EDGE *edge, V3D *v1, V3D *v2, int flags, BITMAP *bmp);
void _fill_3d_edge_structure_f(POLYGON_EDGE *edge, V3D_f *v1, V3D_f *v2, int flags, BITMAP *bmp);
SCANLINE_FILLER _get_scanline_filler(int type, int *flags, POLYGON_SEGMENT *info, BITMAP *texture, BITMAP *bmp);
void _clip_polygon_segment(POLYGON_SEGMENT *info, int gap, int flags);
/* polygon scanline filler functions */
void _poly_scanline_gcol8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit8(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb8x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit15(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb15x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit15x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit15x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit15x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit15x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit15d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit15d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit16(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb16x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit16x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit16x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit16x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit16x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit16d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit16d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit24(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb24x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit24x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit24x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit24x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit24x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit24d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit24d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit32(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_grgb32x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_lit32x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit32x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_atex_mask_lit32x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit32x(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_lit32d(unsigned long addr, int w, POLYGON_SEGMENT *info);
void _poly_scanline_ptex_mask_lit32d(unsigned long addr, int w, POLYGON_SEGMENT *info);
/* sound lib stuff */
extern int _digi_volume;
extern int _midi_volume;
extern int _flip_pan;
extern int _sound_hq;
extern int (*_midi_init)(void);
extern void (*_midi_exit)(void);
int _midi_allocate_voice(int min, int max);
extern volatile long _midi_tick;
int _digmid_find_patches(char *dir, char *file);
#define VIRTUAL_VOICES 256
typedef struct /* a virtual (as seen by the user) soundcard voice */
{
SAMPLE *sample; /* which sample are we playing? (NULL = free) */
int num; /* physical voice number (-1 = been killed off) */
int autokill; /* set to free the voice when the sample finishes */
long time; /* when we were started (for voice allocation) */
int priority; /* how important are we? */
} VOICE;
extern VOICE _voice[VIRTUAL_VOICES];
typedef struct /* a physical (as used by hardware) soundcard voice */
{
int num; /* the virtual voice currently using me (-1 = free) */
int playmode; /* are we looping? */
int vol; /* current volume (fixed point .12) */
int dvol; /* volume delta, for ramping */
int target_vol; /* target volume, for ramping */
int pan; /* current pan (fixed point .12) */
int dpan; /* pan delta, for sweeps */
int target_pan; /* target pan, for sweeps */
int freq; /* current frequency (fixed point .12) */
int dfreq; /* frequency delta, for sweeps */
int target_freq; /* target frequency, for sweeps */
} PHYS_VOICE;
extern PHYS_VOICE _phys_voice[DIGI_VOICES];
#define MIXER_DEF_SFX 8
#define MIXER_MAX_SFX 64
int _mixer_init(int bufsize, int freq, int stereo, int is16bit, int *voices);
void _mixer_exit(void);
void _mix_some_samples(unsigned long buf, unsigned short seg, int issigned);
void _mixer_init_voice(int voice, SAMPLE *sample);
void _mixer_release_voice(int voice);
void _mixer_start_voice(int voice);
void _mixer_stop_voice(int voice);
void _mixer_loop_voice(int voice, int loopmode);
int _mixer_get_position(int voice);
void _mixer_set_position(int voice, int position);
int _mixer_get_volume(int voice);
void _mixer_set_volume(int voice, int volume);
void _mixer_ramp_volume(int voice, int time, int endvol);
void _mixer_stop_volume_ramp(int voice);
int _mixer_get_frequency(int voice);
void _mixer_set_frequency(int voice, int frequency);
void _mixer_sweep_frequency(int voice, int time, int endfreq);
void _mixer_stop_frequency_sweep(int voice);
int _mixer_get_pan(int voice);
void _mixer_set_pan(int voice, int pan);
void _mixer_sweep_pan(int voice, int time, int endpan);
void _mixer_stop_pan_sweep(int voice);
void _mixer_set_echo(int voice, int strength, int delay);
void _mixer_set_tremolo(int voice, int rate, int depth);
void _mixer_set_vibrato(int voice, int rate, int depth);
/* dummy functions for the NoSound drivers */
int _dummy_detect(int input);
int _dummy_init(int input, int voices);
void _dummy_exit(int input);
int _dummy_mixer_volume(int volume);
void _dummy_init_voice(int voice, SAMPLE *sample);
void _dummy_noop1(int p);
void _dummy_noop2(int p1, int p2);
void _dummy_noop3(int p1, int p2, int p3);
int _dummy_get_position(int voice);
int _dummy_get(int voice);
void _dummy_raw_midi(unsigned char data);
int _dummy_load_patches(char *patches, char *drums);
void _dummy_adjust_patches(char *patches, char *drums);
void _dummy_key_on(int inst, int note, int bend, int vol, int pan);
/* from djgpp's libc, needed to find which directory we were run from */
extern int __crt0_argc;
extern char **__crt0_argv;
#endif /* ifndef INTERNAL_H */
-22
View File
@@ -1,22 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 2005-2018 by Sonic Team Jr.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief Set Com port and speed for GDBStubs for DJGGP
///
/// copy and rename as rdb.h and set the defines below as needed
#define DEBUG_COM_PORT 2
#define DEBUG_COM_PORT_SPEED 9600
-900
View File
@@ -1,900 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief extended vesa VESA2.0 video modes i/o
#include <stdlib.h>
#include "../i_system.h" //I_Error()
#include "vid_vesa.h"
#include "../doomdef.h" //MAXVIDWIDTH, MAXVIDHEIGHT
#include "../screen.h"
#include <dpmi.h>
#include <go32.h>
#include <sys/farptr.h>
#include <sys/movedata.h>
#include <sys/segments.h>
#include <sys/nearptr.h>
#include "../console.h"
#include "../command.h" //added:21-03-98: vid_xxx commands
#include "../i_video.h"
// PROTOS
static vmode_t *VID_GetModePtr (int modenum);
static int VID_VesaGetModeInfo (int modenum);
static void VID_VesaGetExtraModes (void);
static INT32 VID_VesaInitMode (viddef_t *lvid, vmode_t *pcurrentmode);
static void VID_Command_NumModes_f (void);
static void VID_Command_ModeInfo_f (void);
static void VID_Command_ModeList_f (void);
static void VID_Command_Mode_f (void);
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#define VBEVERSION 2 // we need vesa2 or higher
// -----------------------------------------------------
#define MASK_LINEAR(addr) (addr & 0x000FFFFF)
#define RM_TO_LINEAR(addr) (((addr & 0xFFFF0000) >> 12) + (addr & 0xFFFF))
#define RM_OFFSET(addr) (addr & 0xF)
#define RM_SEGMENT(addr) ((addr >> 4) & 0xFFFF)
// -----------------------------------------------------
static int totalvidmem;
static vmode_t vesa_modes[MAX_VESA_MODES] = {{NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, 0}};
static vesa_extra_t vesa_extra[MAX_VESA_MODES];
//this is the only supported non-vesa mode : standard 320x200x256c.
#define NUMVGAVIDMODES 1
static INT32 VGA_InitMode (viddef_t *lvid, vmode_t *pcurrentmode);
static char vgamode1[] ="320x200";
static vmode_t vgavidmodes[NUMVGAVIDMODES] = {
{
NULL,
vgamode1,
320, 200, //(200.0/320.0)*(320.0/240.0),
320, 1, // rowbytes, bytes per pixel
0, 1,
NULL,
VGA_InitMode, 0
}
};
static char names[MAX_VESA_MODES][10];
//----------------------------i_video.c------------------------------------
// these ones should go to i_video.c, but I prefer keep them away from the
// doom sources until the vesa stuff is ok.
static int numvidmodes; //total number of video modes, vga, vesa1, vesa2.
static vmode_t *pvidmodes; //start of videomodes list.
static vmode_t *pcurrentmode; // the current active videomode.
//----------------------------i_video.c------------------------------------
// table des modes videos.
// seul le mode 320x200x256c standard VGA est support� sans le VESA.
// ce mode est le mode num�ro 0 dans la liste.
typedef struct
{
int modenum; // vesa vbe2.0 modenum
int mode_attributes;
int winasegment;
int winbsegment;
int bytes_per_scanline; // bytes per logical scanline (+16)
int win; // window number (A=0, B=1)
int win_size; // window size (+6)
int granularity; // how finely i can set the window in vid mem (+4)
int width, height; // displayed width and height (+18, +20)
int bits_per_pixel; // er, better be 8, 15, 16, 24, or 32 (+25)
int bytes_per_pixel; // er, better be 1, 2, or 4
int memory_model; // and better be 4 or 6, packed or direct color (+27)
int num_pages; // number of complete frame buffer pages (+29)
int red_width; // the # of bits in the red component (+31)
int red_pos; // the bit position of the red component (+32)
int green_width; // etc.. (+33)
int green_pos; // (+34)
int blue_width; // (+35)
int blue_pos; // (+36)
int pptr;
int pagesize;
int numpages;
} modeinfo_t;
static vbeinfoblock_t vesainfo;
static vesamodeinfo_t vesamodeinfo;
// ------------------------------------------------------------------------
// DOS stuff
// ------------------------------------------------------------------------
static unsigned long conventional_memory = (unsigned long)-1;
FUNCINLINE static ATTRINLINE void map_in_conventional_memory(void)
{
if (conventional_memory == (unsigned long)-1)
{
if (__djgpp_nearptr_enable())
{
conventional_memory = __djgpp_conventional_base;
}
}
}
// Converts a flat 32 bit ptr to a realmode 0x12345 type ptr (seg<<4 + offs)
#if 0
unsigned int ptr2real(void *ptr)
{
map_in_conventional_memory();
return (int)ptr - conventional_memory;
}
#endif
// Converts 0x12345 (seg<<4+offs) realmode ptr to a flat 32bit ptr
FUNCINLINE static ATTRINLINE void *real2ptr(unsigned int real)
{
map_in_conventional_memory();
return (void *) (real + conventional_memory);
}
// ------------------------------------------------------------------------
/* ======================================================================== */
// Add the standard VGA video modes (only one now) to the video modes list.
/* ======================================================================== */
static inline void VGA_Init(void)
{
vgavidmodes[NUMVGAVIDMODES-1].pnext = pvidmodes;
pvidmodes = &vgavidmodes[0];
numvidmodes += NUMVGAVIDMODES;
}
//added:30-01-98: return number of video modes in pvidmodes list
INT32 VID_NumModes(void)
{
return numvidmodes;
}
//added:21-03-98: return info on video mode
FUNCINLINE static ATTRINLINE const char *VID_ModeInfo (int modenum, char **ppheader)
{
static const char *badmodestr = "Bad video mode number\n";
vmode_t *pv;
pv = VID_GetModePtr (modenum);
if (!pv)
{
if (ppheader)
*ppheader = NULL;
return badmodestr;
}
else
{
//if (ppheader)
// *ppheader = pv->header;
return pv->name;
}
}
//added:03-02-98: return a video mode number from the dimensions
INT32 VID_GetModeForSize( INT32 w, INT32 h)
{
vmode_t *pv;
int modenum;
pv = pvidmodes;
for (modenum=0; pv!=NULL; pv=pv->pnext,modenum++ )
{
if ( pv->width==(unsigned)w && pv->height==(unsigned)h )
return modenum;
}
return 0;
}
/* ======================================================================== */
//
/* ======================================================================== */
void VID_Init (void)
{
COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f);
COM_AddCommand ("vid_modeinfo", VID_Command_ModeInfo_f);
COM_AddCommand ("vid_modelist", VID_Command_ModeList_f);
COM_AddCommand ("vid_mode", VID_Command_Mode_f);
CV_RegisterVar (&cv_vidwait);
CV_RegisterVar (&cv_stretch);
//setup the videmodes list,
// note that mode 0 must always be VGA mode 0x13
pvidmodes = NULL;
pcurrentmode = NULL;
numvidmodes = 0;
// setup the vesa_modes list
VID_VesaGetExtraModes ();
// the game boots in 320x200 standard VGA, but
// we need a highcolor mode to run the game in highcolor
if (highcolor && numvidmodes==0)
I_Error ("No 15bit highcolor VESA2 video mode found, cannot run in highcolor.\n");
// add the vga modes at the start of the modes list
VGA_Init();
#ifdef DEBUG
CONS_Printf("VID_SetMode(%d)\n",vid.modenum);
#endif
VID_SetMode (0); //vid.modenum);
#ifdef DEBUG
CONS_Printf("after VID_SetMode\n");
CONS_Printf("vid.width %d\n",vid.width);
CONS_Printf("vid.height %d\n",vid.height);
CONS_Printf("vid.buffer %x\n",vid.buffer);
CONS_Printf("vid.rowbytes %d\n",vid.rowbytes);
CONS_Printf("vid.numpages %d\n",vid.numpages);
CONS_Printf("vid.recalc %d\n",vid.recalc);
CONS_Printf("vid.direct %x\n",vid.direct);
#endif
}
// ========================================================================
// Returns a vmode_t from the video modes list, given a video mode number.
// ========================================================================
vmode_t *VID_GetModePtr (int modenum)
{
vmode_t *pv;
pv = pvidmodes;
if (!pv)
I_Error ("VID_error 1\n");
while (modenum--)
{
pv = pv->pnext;
if (!pv)
I_Error ("VID_error 2\n");
}
return pv;
}
//added:30-01-98:return the name of a video mode
const char *VID_GetModeName (INT32 modenum)
{
return (VID_GetModePtr(modenum))->name;
}
// ========================================================================
// Sets a video mode
// ========================================================================
INT32 VID_SetMode (INT32 modenum) //, UINT8 *palette)
{
int vstat;
vmode_t *pnewmode, *poldmode;
if ((modenum >= numvidmodes) || (modenum < 0))
{
if (pcurrentmode == NULL)
{
modenum = 0; // mode hasn't been set yet, so initialize to base
// mode since they gave us an invalid initial mode
}
else
{
//nomodecheck = true;
I_Error ("Unknown video mode: %d\n", modenum);
//nomodecheck = false;
return 0;
}
}
pnewmode = VID_GetModePtr (modenum);
if (pnewmode == pcurrentmode)
return 1; // already in the desired mode
// initialize the new mode
poldmode = pcurrentmode;
pcurrentmode = pnewmode;
// initialize vidbuffer size for setmode
vid.width = pcurrentmode->width;
vid.height = pcurrentmode->height;
//vid.aspect = pcurrentmode->aspect;
vid.rowbytes = pcurrentmode->rowbytes;
vid.bpp = pcurrentmode->bytesperpixel;
//debug
//if (vid.rowbytes != vid.width)
// I_Error("vidrowbytes (%d) <> vidwidth(%d)\n",vid.rowbytes,vid.width);
vstat = (*pcurrentmode->setmode) (&vid, pcurrentmode);
if (vstat < 1)
{
if (vstat == 0)
{
// harware could not setup mode
//if (!VID_SetMode (vid.modenum))
// I_Error ("VID_SetMode: couldn't set video mode (hard failure)");
I_Error("Couldn't set video mode %d\n", modenum);
}
else
if (vstat == -1)
{
CONS_Printf ("Not enough mem for VID_SetMode...\n");
// not enough memory; just put things back the way they were
pcurrentmode = poldmode;
vid.width = pcurrentmode->width;
vid.height = pcurrentmode->height;
vid.rowbytes = pcurrentmode->rowbytes;
vid.bpp = pcurrentmode->bytesperpixel;
return 0;
}
}
vid.modenum = modenum;
//printf ("%s\n", VID_ModeInfo (vid.modenum, NULL));
//added:20-01-98: recalc all tables and realloc buffers based on
// vid values.
vid.recalc = 1;
if (!cv_stretch.value && (float)vid.width/vid.height != ((float)BASEVIDWIDTH/BASEVIDHEIGHT))
vid.height = (int)(vid.width * ((float)BASEVIDHEIGHT/BASEVIDWIDTH));// Adjust the height to match
return 1;
}
// converts a segm:offs 32bit pair to a 32bit flat ptr
#if 0
void *VID_ExtraFarToLinear (void *ptr)
{
int temp;
temp = (int)ptr;
return real2ptr (((temp & 0xFFFF0000) >> 12) + (temp & 0xFFFF));
}
#endif
// ========================================================================
// Helper function for VID_VesaGetExtraModes
// In: vesa mode number, from the vesa videomodenumbers list
// Out: false, if no info for given modenum
// ========================================================================
int VID_VesaGetModeInfo (int modenum)
{
int bytes_per_pixel;
unsigned int i;
__dpmi_regs regs;
for (i=0; i<sizeof (vesamodeinfo_t); i++)
_farpokeb(_dos_ds, MASK_LINEAR(__tb)+i, 0);
regs.x.ax = 0x4f01;
regs.x.di = RM_OFFSET(__tb);
regs.x.es = RM_SEGMENT(__tb);
regs.x.cx = modenum;
__dpmi_int(0x10, &regs);
if (regs.h.ah)
return false;
else
{
dosmemget (MASK_LINEAR(__tb), sizeof (vesamodeinfo_t), &vesamodeinfo);
bytes_per_pixel = (vesamodeinfo.BitsPerPixel+1)/8;
// we add either highcolor or lowcolor video modes, not the two
if (highcolor && (vesamodeinfo.BitsPerPixel != 15))
return false;
if (!highcolor && (vesamodeinfo.BitsPerPixel != 8))
return false;
if ((bytes_per_pixel > 2) ||
(vesamodeinfo.XResolution > MAXVIDWIDTH) ||
(vesamodeinfo.YResolution > MAXVIDHEIGHT))
{
return false;
}
// we only want color graphics modes that are supported by the hardware
if ((vesamodeinfo.ModeAttributes &
(MODE_SUPPORTED_IN_HW | COLOR_MODE | GRAPHICS_MODE) ) !=
(MODE_SUPPORTED_IN_HW | COLOR_MODE | GRAPHICS_MODE))
{
return false;
}
// we only work with linear frame buffers, except for 320x200,
// which is linear when banked at 0xA000
if (!(vesamodeinfo.ModeAttributes & LINEAR_FRAME_BUFFER))
{
if ((vesamodeinfo.XResolution != 320) ||
(vesamodeinfo.YResolution != 200))
{
return false;
}
}
// pagesize
if ((vesamodeinfo.BytesPerScanLine * vesamodeinfo.YResolution)
> totalvidmem)
{
return false;
}
vesamodeinfo.NumberOfImagePages = 1;
#ifdef DEBUG
CONS_Printf("VID: (VESA) info for mode 0x%x\n", modeinfo.modenum);
CONS_Printf(" mode attrib = 0x%0x\n", modeinfo.mode_attributes);
CONS_Printf(" win a attrib = 0x%0x\n", *(UINT8 *)(infobuf+2));
CONS_Printf(" win b attrib = 0x%0x\n", *(UINT8 *)(infobuf+3));
CONS_Printf(" win a seg 0x%0x\n", (int) modeinfo.winasegment);
CONS_Printf(" win b seg 0x%0x\n", (int) modeinfo.winbsegment);
CONS_Printf(" bytes per scanline = %d\n",
modeinfo.bytes_per_scanline);
CONS_Printf(" width = %d, height = %d\n", modeinfo.width,
modeinfo.height);
CONS_Printf(" win = %c\n", 'A' + modeinfo.win);
CONS_Printf(" win granularity = %d\n", modeinfo.granularity);
CONS_Printf(" win size = %d\n", modeinfo.win_size);
CONS_Printf(" bits per pixel = %d\n", modeinfo.bits_per_pixel);
CONS_Printf(" bytes per pixel = %d\n", modeinfo.bytes_per_pixel);
CONS_Printf(" memory model = 0x%x\n", modeinfo.memory_model);
CONS_Printf(" num pages = %d\n", modeinfo.num_pages);
CONS_Printf(" red width = %d\n", modeinfo.red_width);
CONS_Printf(" red pos = %d\n", modeinfo.red_pos);
CONS_Printf(" green width = %d\n", modeinfo.green_width);
CONS_Printf(" green pos = %d\n", modeinfo.green_pos);
CONS_Printf(" blue width = %d\n", modeinfo.blue_width);
CONS_Printf(" blue pos = %d\n", modeinfo.blue_pos);
CONS_Printf(" phys mem = %x\n", modeinfo.pptr);
#endif
}
return true;
}
// ========================================================================
// Get extended VESA modes information, keep the ones that we support,
// so they'll be available in the game Video menu.
// ========================================================================
#define MAXVESADESC 100
static char vesadesc[MAXVESADESC] = "";
void VID_VesaGetExtraModes (void)
{
unsigned int i;
unsigned long addr;
int nummodes;
__dpmi_meminfo phys_mem_info;
unsigned long mode_ptr;
__dpmi_regs regs;
// make a copy of the video modes list! else trash in __tb
UINT16 vmode[MAX_VESA_MODES+1];
int numvmodes;
UINT16 vesamode;
// new ugly stuff...
for (i=0; i<sizeof (vbeinfoblock_t); i++)
_farpokeb(_dos_ds, MASK_LINEAR(__tb)+i, 0);
dosmemput("VBE2", 4, MASK_LINEAR(__tb));
// see if VESA support is available
regs.x.ax = 0x4f00;
regs.x.di = RM_OFFSET(__tb);
regs.x.es = RM_SEGMENT(__tb);
__dpmi_int(0x10, &regs);
if (regs.h.ah)
goto no_vesa;
dosmemget(MASK_LINEAR(__tb), sizeof (vbeinfoblock_t), &vesainfo);
if (strncmp((void *)vesainfo.VESASignature, "VESA", 4) != 0)
{
no_vesa:
CONS_Printf ("No VESA driver\n");
return;
}
if (vesainfo.VESAVersion < (VBEVERSION<<8))
{
CONS_Printf ("VESA VBE %d.0 not available\n", VBEVERSION);
return;
}
//
// vesa version number
//
CONS_Printf ("%4.4s %d.%d (", vesainfo.VESASignature,
vesainfo.VESAVersion>>8,
vesainfo.VESAVersion&0xFF);
//
// vesa description string
//
i = 0;
addr = RM_TO_LINEAR(vesainfo.OemStringPtr);
_farsetsel(_dos_ds);
while (_farnspeekb(addr) != 0)
{
vesadesc[i++] = _farnspeekb(addr++);
if (i == MAXVESADESC-1)
break;
}
vesadesc[i]=0;
CONS_Printf ("%s)\n",vesadesc);
totalvidmem = vesainfo.TotalMemory << 16;
//
// find 8 bit modes
//
numvmodes = 0;
mode_ptr = RM_TO_LINEAR(vesainfo.VideoModePtr);
while ((vmode[numvmodes] = _farpeekw(_dos_ds, mode_ptr)) != 0xFFFF)
{
numvmodes++;
if ( numvmodes == MAX_VESA_MODES )
break;
mode_ptr += 2;
}
vmode[numvmodes] = 0xffff;
nummodes = 0; // number of video modes accepted for the game
numvmodes=0; // go again through vmodes table
while ( ((vesamode=vmode[numvmodes++]) != 0xFFFF) && (nummodes < MAX_VESA_MODES) )
{
//fill the modeinfo struct.
if (VID_VesaGetModeInfo (vesamode))
{
vesa_modes[nummodes].pnext = &vesa_modes[nummodes+1];
if (vesamodeinfo.XResolution > 999)
{
if (vesamodeinfo.YResolution > 999)
{
sprintf (&names[nummodes][0], "%4dx%4d", vesamodeinfo.XResolution,
vesamodeinfo.YResolution);
names[nummodes][9] = 0;
}
else
{
sprintf (&names[nummodes][0], "%4dx%3d", vesamodeinfo.XResolution,
vesamodeinfo.YResolution);
names[nummodes][8] = 0;
}
}
else
{
if (vesamodeinfo.YResolution > 999)
{
sprintf (&names[nummodes][0], "%3dx%4d", vesamodeinfo.XResolution,
vesamodeinfo.YResolution);
names[nummodes][8] = 0;
}
else
{
sprintf (&names[nummodes][0], "%3dx%3d", vesamodeinfo.XResolution,
vesamodeinfo.YResolution);
names[nummodes][7] = 0;
}
}
vesa_modes[nummodes].name = &names[nummodes][0];
vesa_modes[nummodes].width = vesamodeinfo.XResolution;
vesa_modes[nummodes].height = vesamodeinfo.YResolution;
//added:20-01-98:aspect ratio to be implemented...
vesa_modes[nummodes].rowbytes = vesamodeinfo.BytesPerScanLine;
vesa_modes[nummodes].windowed = 0;
vesa_modes[nummodes].pextradata = &vesa_extra[nummodes];
vesa_modes[nummodes].setmode = VID_VesaInitMode;
if (vesamodeinfo.ModeAttributes & LINEAR_FRAME_BUFFER)
{
// add linear bit to mode for linear modes
vesa_extra[nummodes].vesamode = vesamode | LINEAR_MODE;
vesa_modes[nummodes].numpages = 1; //vesamodeinfo.NumberOfImagePages;
phys_mem_info.address = (int)vesamodeinfo.PhysBasePtr;
phys_mem_info.size = 0x400000;
// returns -1 on error
if (__dpmi_physical_address_mapping(&phys_mem_info))
{
//skip this mode, it doesnt work
continue;
}
// if physical mapping was ok... convert the selector:offset
vesa_extra[nummodes].plinearmem =
real2ptr (phys_mem_info.address);
// lock the region
__dpmi_lock_linear_region (&phys_mem_info);
}
else
{
// banked at 0xA0000
vesa_extra[nummodes].vesamode = vesamode;
//vesa_extra[nummodes].pages[0] = 0;
vesa_extra[nummodes].plinearmem =
real2ptr (vesamodeinfo.WinASegment<<4);
vesa_modes[nummodes].numpages = 1; //modeinfo.numpages;
}
vesa_modes[nummodes].bytesperpixel = (vesamodeinfo.BitsPerPixel+1)/8;
nummodes++;
}
}
// add the VESA modes at the start of the mode list (if there are any)
if (nummodes)
{
vesa_modes[nummodes-1].pnext = NULL; //pvidmodes;
pvidmodes = &vesa_modes[0];
numvidmodes += nummodes;
}
}
// ========================================================================
// Free the video buffer of the last video mode,
// allocate a new buffer for the video mode to set.
// ========================================================================
static boolean VID_FreeAndAllocVidbuffer (viddef_t *lvid)
{
int vidbuffersize;
vidbuffersize = (lvid->width * lvid->height * lvid->bpp * NUMSCREENS); //status bar
// free allocated buffer for previous video mode
if (lvid->buffer!=NULL)
{
free(lvid->buffer);
}
// allocate the new screen buffer
if ( (lvid->buffer = (UINT8 *) malloc(vidbuffersize))==NULL )
return false;
// initially clear the video buffer
memset (lvid->buffer, 0x00, vidbuffersize);
#ifdef DEBUG
CONS_Printf("VID_FreeAndAllocVidbuffer done, vidbuffersize: %x\n",vidbuffersize);
#endif
return true;
}
// ========================================================================
// Set video mode routine for STANDARD VGA MODES (NO HIGHCOLOR)
// Out: 1 ok,
// 0 hardware could not set mode,
// -1 no mem
// ========================================================================
static INT32 VGA_InitMode (viddef_t *lvid, vmode_t *currentmodep)
{
__dpmi_regs regs;
if (!VID_FreeAndAllocVidbuffer (lvid))
return -1; //no mem
//added:26-01-98: should clear video mem here
//set mode 0x13
regs.h.ah = 0;
regs.h.al = 0x13;
__dpmi_int(0x10, &regs);
// here it is the standard VGA 64k window, not an LFB
// (you could have 320x200x256c with LFB in the vesa modes)
lvid->direct = (UINT8 *) real2ptr (0xa0000);
lvid->u.numpages = 1;
lvid->bpp = currentmodep->bytesperpixel;
return 1;
}
// ========================================================================
// Set video mode routine for VESA video modes, see VID_SetMode()
// Out: 1 ok,
// 0 hardware could not set mode,
// -1 no mem
// ========================================================================
INT32 VID_VesaInitMode (viddef_t *lvid, vmode_t *currentmodep)
{
vesa_extra_t *pextra;
__dpmi_regs regs;
pextra = currentmodep->pextradata;
#ifdef DEBUG
CONS_Printf("VID_VesaInitMode...\n");
CONS_Printf(" currentmodep->name %s\n",currentmodep->name);
CONS_Printf(" width %d\n",currentmodep->width);
CONS_Printf(" height %d\n",currentmodep->height);
CONS_Printf(" rowbytes %d\n",currentmodep->rowbytes);
CONS_Printf(" windowed %d\n",currentmodep->windowed);
CONS_Printf(" numpages %d\n",currentmodep->numpages);
CONS_Printf(" currentmodep->pextradata :\n");
CONS_Printf(" ->vesamode %x\n",pextra->vesamode);
CONS_Printf(" ->plinearmem %x\n\n",pextra->plinearmem);
#endif
//added:20-01-98:no page flipping now... TO DO!!!
lvid->u.numpages = 1;
// clean up any old vid buffer lying around, alloc new if needed
if (!VID_FreeAndAllocVidbuffer (lvid))
return -1; //no mem
//added:20-01-98: should clear video mem here
// set the mode
regs.x.ax = 0x4f02;
regs.x.bx = pextra->vesamode;
__dpmi_int (0x10, &regs);
if (regs.x.ax != 0x4f)
return 0; // could not set mode
//added:20-01-98: should setup wait_vsync flag, currentpage here...
// plus check for display_enable bit
//added:20-01-98: here we should set the page if page flipping...
// points to LFB, or the start of VGA mem.
lvid->direct = pextra->plinearmem;
lvid->bpp = currentmodep->bytesperpixel;
return 1;
}
// ========================================================================
// VIDEO MODE CONSOLE COMMANDS
// ========================================================================
// vid_nummodes
//
//added:21-03-98:
void VID_Command_NumModes_f (void)
{
int nummodes;
nummodes = VID_NumModes ();
CONS_Printf ("%d video mode(s) available(s)\n", nummodes);
}
// vid_modeinfo <modenum>
//
void VID_Command_ModeInfo_f (void)
{
vmode_t *pv;
int modenum;
if (COM_Argc()!=2)
modenum = vid.modenum; // describe the current mode
else
modenum = atoi (COM_Argv(1)); // .. the given mode number
if (modenum >= VID_NumModes())
{
CONS_Printf ("No such video mode\n");
return;
}
pv = VID_GetModePtr (modenum);
CONS_Printf ("%s\n", VID_ModeInfo (modenum, NULL));
CONS_Printf ("width : %d\n"
"height: %d\n"
"bytes per scanline: %d\n"
"bytes per pixel: %d\n"
"numpages: %d\n",
pv->width,
pv->height,
pv->rowbytes,
pv->bytesperpixel,
pv->numpages );
}
// vid_modelist
//
void VID_Command_ModeList_f (void)
{
int i, nummodes;
const char *pinfo;
char *pheader;
vmode_t *pv;
boolean na;
na = false;
nummodes = VID_NumModes ();
for (i=0 ; i<nummodes ; i++)
{
pv = VID_GetModePtr (i);
pinfo = VID_ModeInfo (i, &pheader);
if (i==0 || pv->bytesperpixel==1)
CONS_Printf ("%d: %s\n", i, pinfo);
else
CONS_Printf ("%d: %s (hicolor)\n", i, pinfo);
}
}
// vid_mode <modenum>
//
void VID_Command_Mode_f (void)
{
int modenum;
if (COM_Argc()!=2)
{
CONS_Printf ("vid_mode <modenum> : set video mode\n");
return;
}
modenum = atoi(COM_Argv(1));
if (modenum >= VID_NumModes())
CONS_Printf ("No such video mode\n");
else
// request vid mode change
setmodeneeded = modenum+1;
}
-109
View File
@@ -1,109 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// 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.
//-----------------------------------------------------------------------------
/// \file
/// \brief VESA extra modes.
#include "../doomdef.h"
#include "../screen.h"
#define MODE_SUPPORTED_IN_HW 0x0001
#define COLOR_MODE 0x0008
#define GRAPHICS_MODE 0x0010
#define VGA_INCOMPATIBLE 0x0020
#define LINEAR_FRAME_BUFFER 0x0080
#define LINEAR_MODE 0x4000
#define MAX_VESA_MODES 30 // we'll just take the first 30 if there
// VESA information block structure
typedef struct vbeinfoblock_s
{
UINT8 VESASignature[4];
UINT16 VESAVersion;
unsigned long OemStringPtr;
UINT8 Capabilities[4];
unsigned long VideoModePtr;
UINT16 TotalMemory;
UINT8 OemSoftwareRev[2];
UINT8 OemVendorNamePtr[4];
UINT8 OemProductNamePtr[4];
UINT8 OemProductRevPtr[4];
UINT8 Reserved[222];
UINT8 OemData[256];
} ATTRPACK vbeinfoblock_t;
// VESA information for a specific mode
typedef struct vesamodeinfo_s
{
UINT16 ModeAttributes;
UINT8 WinAAttributes;
UINT8 WinBAttributes;
UINT16 WinGranularity;
UINT16 WinSize;
UINT16 WinASegment;
UINT16 WinBSegment;
unsigned long WinFuncPtr;
UINT16 BytesPerScanLine;
UINT16 XResolution;
UINT16 YResolution;
UINT8 XCharSize;
UINT8 YCharSize;
UINT8 NumberOfPlanes;
UINT8 BitsPerPixel;
UINT8 NumberOfBanks;
UINT8 MemoryModel;
UINT8 BankSize;
UINT8 NumberOfImagePages;
UINT8 Reserved_page;
UINT8 RedMaskSize;
UINT8 RedMaskPos;
UINT8 GreenMaskSize;
UINT8 GreenMaskPos;
UINT8 BlueMaskSize;
UINT8 BlueMaskPos;
UINT8 ReservedMaskSize;
UINT8 ReservedMaskPos;
UINT8 DirectColorModeInfo;
/* VBE 2.0 extensions */
unsigned long PhysBasePtr;
unsigned long OffScreenMemOffset;
UINT16 OffScreenMemSize;
/* VBE 3.0 extensions */
UINT16 LinBytesPerScanLine;
UINT8 BnkNumberOfPages;
UINT8 LinNumberOfPages;
UINT8 LinRedMaskSize;
UINT8 LinRedFieldPos;
UINT8 LinGreenMaskSize;
UINT8 LinGreenFieldPos;
UINT8 LinBlueMaskSize;
UINT8 LinBlueFieldPos;
UINT8 LinRsvdMaskSize;
UINT8 LinRsvdFieldPos;
unsigned long MaxPixelClock;
UINT8 Reserved[190];
} ATTRPACK vesamodeinfo_t;
// setup standard VGA + VESA modes list, activate the default video mode.
void VID_Init (void);
Loaded 100 of 327 files, more files were not shown because too many files have changed in this diff. Show more