Compare commits

..

1109 Commits

Author SHA1 Message Date
B1ackDaemon 2d862da540 Merge pull request #375 from raven02/patch-2
Fix CELL_GCM_TEXTURE_DEPTH24_D8 and detail trace for GLTexture::Init()
2014-06-28 03:03:51 +03:00
raven02 a1db96d70d Fix CELL_GCM_TEXTURE_DEPTH24_D8 and detail trace for GLTexture::Init() 2014-06-28 07:30:12 +08:00
Alexandro Sánchez Bach f8a0225b33 Merge pull request #372 from Bigpet/logsimpler
Don't use two sets of logging functions
2014-06-27 17:22:15 +02:00
Peter Tissen 95f1a0e645 use only one set of logging macros instead of two and don't use free() as a function name 2014-06-27 15:28:17 +02:00
Alexandro Sánchez Bach afad6daa7d Merge pull request #371 from Bigpet/newlogtemp
Logging system rework
2014-06-27 12:09:44 +02:00
Peter Tissen ae472e9e67 use a more compact method to add and remove listeners t o all channels 2014-06-27 09:22:00 +02:00
Peter Tissen 1ad4380fab rename conlog gui file and set the logbuffer-consumed flag sooner 2014-06-27 06:01:40 +02:00
Peter Tissen 21da317453 Logging system rework
* use one central unified log with channels/priorities ad-hoc listener registration and de-registration
* disable buffering by default
* add multi-threaded ringbuffer implementation
* use buffered listener for the gui (using the ringbuffer)
2014-06-26 17:34:28 +02:00
B1ackDaemon 394b698e92 Merge pull request #370 from Nekotekina/master
Fixed some samples freeze
2014-06-26 01:37:21 +03:00
Nekotekina eca7339a67 Some freezing fixed 2014-06-26 01:59:23 +04:00
B1ackDaemon 4cbbbec8b3 Merge pull request #369 from raven02/patch-8
Log error when flag 0x3c/0x3d EDAT files detected
2014-06-25 22:07:41 +03:00
raven02 0ed518a85d Add EDAT_FLAG_0x3C/0x3D 2014-06-26 00:11:10 +08:00
raven02 eb7128bcc1 Log error when flag 0x3c/0x3d EDAT files detected 2014-06-26 00:10:17 +08:00
Nekotekina 2200e6f4d9 Small fixes 2014-06-25 02:16:44 +04:00
B1ackDaemon 336442eeba Merge pull request #368 from raven02/patch-7
Gameviewer : fix wrong category
2014-06-24 19:23:27 +03:00
raven02 6f3b3f11c8 Gameviewer : fix wrong category 2014-06-24 23:03:27 +08:00
Alexandro Sánchez Bach eb3e18ac7e Added some lv2 syscalls for sys_prx 2014-06-23 19:41:22 +02:00
B1ackDaemon d0fd6eedf6 Merge pull request #366 from raven02/patch-6
RSX: Use blit for MRT as well
2014-06-23 20:05:40 +03:00
raven02 677bc4c553 RSX: Use blit for MRT as well 2014-06-24 00:42:57 +08:00
Hykem 2e668cd2b6 Merge pull request #364 from raven02/patch-5
RSX : delete PBOs when exit thread
2014-06-23 03:41:26 +01:00
Hykem 35b57fc78e Merge pull request #365 from Nekotekina/master
Work on RawSPU: interrupt mailbox
2014-06-23 03:41:11 +01:00
Nekotekina f9c592098f Work on RawSPU: interrupt mailbox
Achievement unlocked: run spu_test!
2014-06-23 05:03:16 +04:00
raven02 fe74f97d44 RSX : delete PBO when exit thread 2014-06-23 03:45:32 +08:00
B1ackDaemon 77e11d670a Merge pull request #361 from raven02/patch-4
RSX: asynchronous glReadPixels with PBO for writing color/depth buffers
2014-06-22 19:27:59 +03:00
Alexandro Sánchez Bach 5a1d702e3d Merge pull request #362 from Nekotekina/master
rCriticalSection & rSemaphore removed
2014-06-22 13:23:37 +02:00
Nekotekina 30b8e51234 rCriticalSection & rSemaphore removed
SC_Semaphore errors fixed
Room for interrupt threads
2014-06-22 14:59:28 +04:00
raven02 a99061127f RSX: asynchronous glReadPixels with PBO for writing color/depth buffers 2014-06-22 18:44:22 +08:00
B1ackDaemon 69cb8349e6 Merge pull request #360 from raven02/patch-3
Paritally revert #359
2014-06-22 02:04:18 +03:00
raven02 f5813bf2cd Paritally revert #359 2014-06-22 06:55:02 +08:00
B1ackDaemon 6bf4695721 Merge pull request #359 from raven02/patch-2
FP: flush m_code_level & check emptyness of m_end_offsets
2014-06-22 00:41:51 +03:00
raven02 2f2a0c8fbc FP: flush m_code_level & check emptyness of m_end_offsets 2014-06-22 05:23:24 +08:00
B1ackDaemon 5912953152 Merge pull request #357 from Nekotekina/master
SC_Semaphore improved and detached from (r)wxSemaphore
2014-06-21 21:57:05 +03:00
Nekotekina 2fad8039f5 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-06-21 18:40:35 +04:00
B1ackDaemon b9bfd7af80 Merge pull request #356 from raven02/patch-1
Set rendering width/height to buffer width/height
2014-06-21 17:27:54 +03:00
Nekotekina 54cdc41ac8 Small workaround 2014-06-21 18:26:37 +04:00
Nekotekina 5da33c6243 SC_Semaphore rewritten 2014-06-21 18:24:27 +04:00
raven02 4e55e6abbd Set rendering width/height to buffer width/height 2014-06-21 18:04:59 +08:00
B1ackDaemon 283c1f64e7 Merge pull request #354 from raven02/patch-34
RSX: matrix offset fix and use original buffer width/height for writing color/depth
2014-06-21 07:58:11 +03:00
raven02 c3960b7f43 Misc thread started/ended/aborted aligment 2014-06-21 12:29:17 +08:00
raven02 12f217aba9 RSX: matrix offset fix and use original buffer width for writing color/depth 2014-06-21 12:02:11 +08:00
B1ackDaemon dc8b0b09c6 Merge pull request #353 from Nekotekina/master
Tried to replace semaphore
2014-06-21 01:03:46 +03:00
Nekotekina e79236a97f SQueue little improvement 2014-06-20 23:57:28 +04:00
Nekotekina 1c4ae999d6 SSemaphore basic implementation
Set for RSX
2014-06-20 23:56:19 +04:00
Nekotekina 7fca980887 sys_ppu_thread_create threadname workaround 2014-06-20 23:54:04 +04:00
B1ackDaemon 52eaf10d93 Merge pull request #352 from raven02/patch-33
Downscale small bug fix
2014-06-20 22:04:09 +03:00
raven02 fda97f25a0 Downscale small bug fix 2014-06-21 02:25:32 +08:00
Hykem 9048bab305 Merge pull request #350 from Nekotekina/master
Some crash avoidance
2014-06-20 14:47:59 +01:00
Hykem 6e3289f392 Merge pull request #351 from raven02/patch-32
Option allow downscaling 720p/1080p to 480p
2014-06-20 14:47:49 +01:00
Nekotekina 568e99d4d3 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-06-20 17:13:51 +04:00
Nekotekina 90b9861043 SMutex partially replaced with std::mutex
SPURecompiler.h: SETcc bug fixed
2014-06-20 15:00:36 +04:00
raven02 efffc7e6bc Option allow downscaling 720p/1080p to 480p 2014-06-20 17:49:22 +08:00
Nekotekina 237e7989b4 Tried to avoid glDeleteShader crash 2014-06-20 00:34:09 +04:00
Alexandro Sánchez Bach f131f134a5 Minor changes
* Removed old lv2Process* functions
* Function name is displayed again in unimplemented syscalls
* Minor changes that won't affect the emulator.
2014-06-19 20:15:53 +02:00
Nekotekina ccfaabd1d7 Defined thread_local for MSVC
Updated asmjit project
Tried to fix crash on exit
Fixed hypothetical issue when pausing already stopped emulator
2014-06-19 17:50:18 +04:00
B1ackDaemon bf6507e9be Merge pull request #348 from raven02/patch-31
Fix 1024x768 resolution not being saved
2014-06-19 00:39:04 +03:00
raven02 07006fd093 Add comment 2014-06-19 05:20:27 +08:00
raven02 4f4ab4c81a Fix 1024x768 resolution not being saved 2014-06-19 05:02:04 +08:00
B1ackDaemon 4930d8785b Merge pull request #346 from raven02/patch-29
Remove glDetachShader for vp and fp
2014-06-17 19:52:41 +03:00
raven02 79d34afb96 Remove glDetachShader for vp and fp 2014-06-18 00:21:40 +08:00
B1ackDaemon ba08d25517 Merge pull request #345 from raven02/patch-28
Drop off  scissor test enable on OnInitThread()
2014-06-16 07:35:56 +03:00
raven02 0541482ee4 Drop off glEnable(GL_SCISSOR_TEST) 2014-06-16 06:32:11 +08:00
B1ackDaemon 95cc6fb3bc Merge pull request #342 from raven02/patch-28
Paritally fix depth read elf
2014-06-15 22:22:20 +03:00
raven02 ee58ba9fd9 Paritally fix depth read elf 2014-06-16 03:05:28 +08:00
Alexandro Sánchez Bach a6bca0ecc5 Merge pull request #340 from raven02/patch-26
RSX: set default m_line_stipple_pattern as 0xffff
2014-06-15 12:27:37 +02:00
raven02 64044173c6 set default m_line_stipple_pattern as 0xffff 2014-06-15 12:25:09 +08:00
B1ackDaemon aafa3351da Merge pull request #339 from raven02/patch-25
RSX : implement line stipple [NV4097_SET_LINE_STIPPLE/PATTERN]
2014-06-15 01:06:34 +03:00
raven02 76c8eedb25 RSX : implement line stipple 2014-06-15 05:53:26 +08:00
Alexandro Sánchez Bach a4c5c4d5f9 Merge pull request #338 from raven02/patch-24
RSX: fix line width
2014-06-14 20:31:16 +02:00
raven02 44dd770cec RSX: fix line width 2014-06-15 02:29:27 +08:00
B1ackDaemon aaf60a1869 Merge pull request #337 from raven02/patch-23
Regression fix : restore point size functionality
2014-06-14 20:18:36 +03:00
raven02 5007d62e27 Regresion fix : restore point size functionality 2014-06-15 00:59:16 +08:00
B1ackDaemon f7c0c6fd34 Merge pull request #336 from raven02/patch-22
Gameviewer : name category HG as HDD game and DG as Disc game
2014-06-14 16:40:06 +03:00
raven02 f471857a25 Gameviewer : name category HG as HDD game and DG as Disc game 2014-06-14 14:16:23 +08:00
B1ackDaemon 49c9e0f3e2 Merge pull request #335 from raven02/patch-21
Fix line width conversion and comment out point size which already done ...
2014-06-14 00:11:34 +03:00
raven02 bf456d5d16 Build fix 2014-06-14 04:44:53 +08:00
raven02 469faf43aa Fix line width conversion and comment out point size which already done in vertex shader 2014-06-14 04:14:04 +08:00
B1ackDaemon c5a244c669 Merge pull request #334 from raven02/patch-20
Fix point size/line_width/poly_offset
2014-06-12 21:35:55 +03:00
raven02 8112440a27 Fix point size/line_width/poly_offset_scale_factor/bias 2014-06-13 02:18:12 +08:00
B1ackDaemon ada0b31295 Merge pull request #332 from raven02/patch-18
Fix vertex program decompile function
2014-06-12 17:27:23 +03:00
B1ackDaemon 49e2d0528c Merge pull request #333 from raven02/patch-19
Gameviewer : read PARAM.SFO for blu-ray disc copy
2014-06-12 17:27:06 +03:00
raven02 9b951d5d3f Gameviewer : read PARAM.SFO for blue-ray disc 2014-06-12 09:27:27 +08:00
raven02 70f6871363 Fix vertex program decompile function 2014-06-12 04:22:32 +08:00
B1ackDaemon 52a1860f0a Merge pull request #327 from raven02/patch-17
cellSysUtil : stub remaining BGM playback functions
2014-06-09 20:01:12 +03:00
raven02 a28ad25221 cellSysUtil : stub remaining BGM playback functions 2014-06-10 00:28:52 +08:00
B1ackDaemon c9dec7b118 Merge pull request #326 from Nekotekina/master
cellSysmoduleLoadModule modified
2014-06-09 17:42:58 +03:00
Nekotekina 4fedf5749e cellSysmoduleLoadModule modified
cellSysutilEnableBgmPlayback draft
cellSurMixerGetCurrentBlockTag
cellSurMixerGetTimestamp
Interval.h draft
2014-06-09 17:35:35 +04:00
Bigpet 0d42fcf536 Merge pull request #325 from Bigpet/master
add dependency on asmjit to rpcs3 project
2014-06-09 05:39:12 +02:00
Peter Tissen 779117d129 fix machine specific path, sorry about that one 2014-06-09 05:37:12 +02:00
Peter Tissen 2382f3b69e add dependency on asmjit to rpcs3 project, might fix the buildbot 2014-06-09 03:36:26 +02:00
Alexandro Sánchez Bach e050b7fd1e Merge pull request #324 from Bigpet/splitfixups
remove unexplained commented out code that I added myself with the last PR
2014-06-09 03:08:22 +02:00
Peter Tissen e85abdeb2c remove unexplained commented out code that I added myself with the last PR
* remove unexplained commented out code that I added myself
* revert asmjit settings change that was meant to only be local for me
2014-06-09 02:55:16 +02:00
Hykem bd6837f2f9 Merge pull request #216 from UnconventionalT/binary-dir-fix
Set build independent binary output dir
2014-06-09 01:36:15 +01:00
Hykem 93481fe27d Merge pull request #239 from Bigpet/splitproj
Split gui and emulation core into seperate projects
2014-06-09 01:22:04 +01:00
Peter Tissen 33d82e0d6e reset debug output directory 2014-06-08 23:23:36 +02:00
Peter Tissen ed10ea7544 add back fused gui log classes, this needs to be redone another way
also, add back wx requirement for strfmt
2014-06-08 23:16:08 +02:00
Peter Tissen 10e10de98d add xinput pad handler to the windows emucore 2014-06-08 23:16:07 +02:00
Peter Tissen 314307b840 Fix building with precompiled headers
add the unimplemented modules to the emucore project

fix a bug in the rXml wrapper that didn't consider the possiblity of functions returning null pointers
2014-06-08 23:16:06 +02:00
Peter Tissen c37905e465 initial start to eliminate static func init, not compilable atm
move module initialization into a module manager, still has some issues like stopping not working and debug crashing

add #idef 0 to modules that aren't in the windows project

don't double initialize and don't de-initialize for now, since many modules don't expect it and it leads to many errors

remove duplicate module lists for empty modules and implemented ones, make Module non-copyable but movable

add secondary project, no real use for it now

add some memleak config to the emucore and add asmjit path to rpcs3

small rebase error fixed to get it to compile again

add filters for emucore

re-add the module manager and static file

WIP commit, linker errors abound

some more abstraction layer stuff

fix the remaining linker errors, re-enable platform specific mouse, pad and keyboard handlers

rebasing

fix memset undefined and re() usage of se_t before declaration

Add wxGUI define by default for cmake builds

fix copy constructors of Datetime header

fix copy constructors of other wx interface classes

remove static declarations of global variables

make wxGLCanvas constructor non-ambiguous even with wx2.8. compat mode, fix wrong std::exception constructor calls

remove duplicate definition for FromUTF8 and ToUTF8

temp changes
2014-06-08 23:16:06 +02:00
B1ackDaemon c4e3ec825e Merge pull request #322 from raven02/patch-16
cellSpurs : create new taskset using attr
2014-06-08 19:36:58 +03:00
raven02 f051011fd1 cellSpurs: create new taskset using attr 2014-06-08 23:29:16 +08:00
Alexandro Sánchez Bach d6f71ee2b3 Merge pull request #323 from Bigpet/master
enable full precompiled headers for non-Windows Platforms
2014-06-08 17:26:01 +02:00
Peter Tissen 4d84507c96 try include guards to circumvent a weird error with gcc and unity builds 2014-06-08 16:58:40 +02:00
DH 3c8815cc06 Improved Vertex Shader Decompiler
- Fixed condition register selection
- Implemented LIT
- Fixed RCP
2014-06-08 17:52:35 +03:00
Peter Tissen 982ea35d44 enable full precompiled headers for non-Windows Platforms for now to make people not guess all the time what to include 2014-06-08 16:43:53 +02:00
DH 7bb966ba82 Improved PPU Interpreter
- Fixed UpdateCR0
- Fixed XER.CA updating
2014-06-08 08:27:57 +03:00
DH 03d2798dba Fragment Shader Decompiler: fixed condition registers. 2014-06-07 19:20:39 +03:00
DH e0046671f1 Improved Fragment Shader Decompiler
- Fixed KIL
- Added all regs to reg_table
2014-06-07 18:52:25 +03:00
DH afcbeb3713 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-06-07 18:32:42 +03:00
DH 1b1ce85b32 Fixed small error in Fragment Shader Decompiler 2014-06-07 18:32:15 +03:00
Alexandro Sánchez Bach 125b71d2c5 Reverted remaining .ToBE() deletions & small fix
And fixed wrong comparison on: `_cellSpursEventFlagInitialize`.
2014-06-07 17:18:40 +02:00
DH a4740d5f09 Improved unknown HLE functions logging
Fixed Fragment Shader Decompiler
2014-06-07 18:08:14 +03:00
DH f8e8e2f624 Improved Fragment Shader Decompiler
- Implemented LIT, RFL, LIF, BRK, IF, LOOP, REP
- Fixed KIL, RCP, RSQ, DP2A

Implemented fmt::replace_first & fmt::replace_all
2014-06-07 17:15:49 +03:00
Alexandro Sánchez Bach 30a1516d19 Merge pull request #318 from raven02/patch-14
Centre the game list panel
2014-06-07 15:40:34 +02:00
Alexandro Sánchez Bach 4f5f600ef6 Merge pull request #319 from raven02/patch-15
cellSpurs : initialize eventFlag
2014-06-07 15:23:12 +02:00
raven02 7855ebcd9f cellSpurs : initialize eventFlag 2014-06-07 20:31:07 +08:00
raven02 219e048922 Centre the game list panel 2014-06-07 16:08:02 +08:00
Alexandro Sánchez Bach 5ed77a3ca9 Reverted BE <-> LE comp. changes in some lv2 SCs 2014-06-07 09:08:16 +02:00
Alexandro Sánchez Bach 2534216971 Improvements in SC_Process and other lv2 syscalls
* Splitted the file in SC_Process.h and SC_Process.cpp.
* Some argument data types modified on sys_process_* functions.
* Implemented sys_process_get_number_of_object and sys_process_get_id.
* Added dummy versions of other sys_process_* functions based on the old
SysCalls::lv2Process* code (which I deleted).
* Improved BE <-> LE comparisons on SC_Mutex, SC_Lwmutex and SC_Lwcond.
* Updated some SC_Memory functions to use mem_ptr_t<T>.

NOTE: There are probably better ways to get the active objects that
don't imply creating a new data type filled with std::set<u32>'s.

TODO: For some types, the corresponding std::set<u32> isn't being
updated when an object is created/destroyed. I'll take care of this
soon.
2014-06-07 08:34:36 +02:00
Alexandro Sánchez Bach 5e00dfb5c3 GcmZcullInfo::Pack and removed 32-bit OAL dll 2014-06-07 04:22:29 +02:00
Alexandro Sánchez Bach 4ac8061240 Merge pull request #315 from Bigpet/simplestdafx
Reduce stdafx.h under Linux for better build-times
2014-06-06 04:17:15 +02:00
Peter Tissen 8da681eab2 enable cotire for better build-times 2014-06-06 03:33:24 +02:00
Peter Tissen 40add8f9a2 Seperate ConLog.h and ConLogFrame.h (for now only seperate headers)
make precompiled header slimmer under Linux to increase CI and dev-machine build-times

make sure unused modules don't compile
add unused modules to the VS project to easier keep track of them
2014-06-06 02:50:22 +02:00
B1ackDaemon 283f290f47 Merge pull request #314 from raven02/patch-11
cellGcmSys: fill out some stuffs for zCulling
2014-06-05 23:19:45 +03:00
Alexandro Sánchez Bach 4f36ecc681 Merge pull request #312 from raven02/patch-10
cellResc : add those unimplemented and error logging
2014-06-05 19:56:41 +02:00
raven02 b9a055f1c8 cellGcmSys: fill out some stuffs for zCulling 2014-06-06 01:50:48 +08:00
raven02 26fc29c1a9 cellResc : add those unimplemented and error logging 2014-06-06 00:19:23 +08:00
Alexandro Sánchez Bach af219bb415 cellGcmSys: Report retrieval functions 2014-06-05 00:04:11 +02:00
Alexandro Sánchez Bach 53b650e88f Merge pull request #311 from raven02/patch-9
cellGcmSys : add those unimplemented and error logging
2014-06-04 23:01:30 +02:00
raven02 44d762fc60 cellGcmSys : add those unimplemented and error logging 2014-06-05 04:51:17 +08:00
Alexandro Sánchez Bach a61c4f6bb0 Merge pull request #310 from raven02/patch-8
enum for vertex data type/antialias & cellSpurs error code fixes
2014-06-04 21:57:17 +02:00
raven02 1827b91882 Check 8-byte and 128-byte alignment for spurs 2014-06-05 02:52:30 +08:00
raven02 7c137cc482 Build fix 2014-06-05 00:53:37 +08:00
raven02 c7b26f1372 cellSpurs task error code fixes and plus bunch of new functions add 2014-06-05 00:03:31 +08:00
raven02 ba91345984 enum for vertex data type 2014-06-04 23:59:46 +08:00
Alexandro Sánchez Bach 585ac5a748 Fixed cellSaveDataAutoLoad2
Probably that's closer to what a real PS3 does. Anyway, tests are
required to be sure about that.

Issue #304 fixed.
2014-06-03 22:42:15 +02:00
B1ackDaemon 77f818fa23 Merge pull request #309 from raven02/patch-7
Fix opcodes STR/SFL for both VP and FP
2014-06-03 23:08:44 +03:00
raven02 1a37723a05 Add missing case 0x0d 2014-06-04 03:02:12 +08:00
raven02 59628960b6 Fix opcodes STR/SFL for both VP and FP 2014-06-04 02:53:06 +08:00
B1ackDaemon 650c5155df Merge pull request #303 from raven02/patch-4
Set default log level to Error
2014-06-03 16:13:52 +03:00
B1ackDaemon 4faa4d6ed9 Merge pull request #307 from raven02/patch-5
RSX: Reorganize and group revelant NV4097 functions
2014-06-03 16:13:36 +03:00
Alexandro Sánchez Bach 664d2502ca Merge pull request #308 from raven02/patch-6
Speedup write color buffers
2014-06-03 14:11:38 +02:00
raven02 8bb5da3b06 Speedup write color buffers 2014-06-03 18:32:27 +08:00
Alexandro Sánchez Bach a382b81d56 Merge pull request #305 from DHrpcs3/remove-32bit
Remove 32-bit configuration from the project
2014-06-03 00:24:33 +02:00
raven02 aac846ff74 Add NV4097_SET_FLIP
It is custom naming
2014-06-03 06:18:33 +08:00
raven02 c4075f1592 RSX: Reorganize and group revelant NV4097 functions 2014-06-03 06:17:33 +08:00
Peter Tissen e8efb8f9fb move inline definitions in header, wtf am I doing, Travis pls. 2014-06-02 22:00:05 +02:00
Peter Tissen 1bb140780b include cstdint type
add mulh like function for gcc

avoid multiple definitions of msvc intrinsic replacements
2014-06-02 21:12:35 +02:00
Peter Tissen 96e229abfa add primitive InterlockedOr64 implementation
use non msvc specific type for int64_t

add umul for gcc
2014-06-02 19:29:22 +02:00
Alexandro Sánchez Bach b05bd51216 Fixed GameViewer issue
Double-clicking an entry in the sorted list caused the corresponding
element of the unsorted list to be run. This is now fixed.
2014-06-02 16:59:50 +02:00
Alexandro Sánchez Bach 82c6d8d68b Removed 32-bit related #if(n)def's 2014-06-02 14:08:32 +02:00
Alexandro Sánchez Bach 111da4d0fd Removed 32-bit config. from .SLN and CMakeLists 2014-06-02 13:59:45 +02:00
Alexandro Sánchez Bach ab65b38d9a Merge pull request #301 from raven02/patch-2
Stub bunch of cellSpurs functions & error log null pointer
2014-06-02 10:36:28 +02:00
raven02 f7d21596a5 Set default log level to Error 2014-06-02 16:34:31 +08:00
raven02 54ede6c4e3 Fix wrong identation 2014-06-02 16:09:36 +08:00
raven02 c4522922f2 Silly typo fix 2014-06-02 15:57:34 +08:00
Alexandro Sánchez Bach a09984d210 Merge pull request #302 from raven02/patch-3
Fix 'always start after boot' not saving
2014-06-02 09:50:42 +02:00
raven02 96bcfdac7e Fix 'always start after boot' not saving 2014-06-02 15:18:01 +08:00
raven02 05d80e4994 EventFlag_add should be always present and checked 2014-06-02 14:53:13 +08:00
raven02 5597f95aba Log as error for null pointer 2014-06-02 13:42:30 +08:00
raven02 3662c4e9bf Stub cellSpurs functions 2014-06-02 12:14:00 +08:00
Alexandro Sánchez Bach cb3622176a Merge pull request #300 from Bigpet/iniReplace
use non wxIni implementation
2014-06-02 00:02:53 +02:00
Peter Tissen c216c0f2e8 revert argument order again, doesn't really need to be reversed, will just cause confusion 2014-06-01 23:07:35 +02:00
Peter Tissen 2d77415cc3 use non-wx header only Ini library in preparation of the core/gui devide 2014-06-01 22:57:50 +02:00
Alexandro Sánchez Bach a9768739eb Merge pull request #298 from Bigpet/twophasefix
help out compilers that use two phase lookup as dictated by the standard
2014-06-01 21:56:49 +02:00
Bigpet 924f117ba0 help out compilers that use two phase lookup as dictated by the standard 2014-06-01 21:28:29 +02:00
Alexandro Sánchez Bach fe0e34cbe1 Merge pull request #290 from Blaypeg/master
Add options for autoboot
2014-06-01 21:03:01 +02:00
Blaypeg dab71d01c1 Add Remove Game option to Gameviewer
Can right click game to remove from list and installation
2014-06-01 19:36:08 +01:00
B1ackDaemon c6c87b66f9 Merge pull request #297 from raven02/patch-1
Change to Error logging for null cmd
2014-06-01 21:34:50 +03:00
raven02 16d909834f Change to Error logging for null cmd 2014-06-02 02:32:00 +08:00
B1ackDaemon c231bec736 Merge pull request #296 from raven02/master
Add /dev_flash and sub-directories
2014-06-01 16:16:18 +03:00
B1ackDaemon fea95d264f Merge pull request #295 from raven02/patch-32
Fragment decompiler changes to async mode
2014-06-01 16:16:08 +03:00
Blaypeg 934856c350 Moved autostart to HLE Section 2014-06-01 14:10:26 +01:00
DH c00f4b6022 Improved mem_ptr_t.
Implemented mem_func_ptr_t.
2014-06-01 12:38:37 +03:00
raven02 d7d4cd4434 Add /dev_flash and sub-directories 2014-06-01 16:21:14 +08:00
raven02 ceeff8ae81 Fragment decompiler change to async mode 2014-06-01 14:54:56 +08:00
B1ackDaemon da2c5bbda0 Merge pull request #294 from raven02/patch-31
Opcode : Add DP2A and temporarily disable KIL instruction
2014-06-01 04:52:57 +03:00
raven02 1bff3ad6ff Opcodo : Add DP2A and temporarily disable KIL 2014-06-01 07:12:31 +08:00
Alexandro Sánchez Bach c01b5fb0db Added cellSaveDataAuto* functions
Implemented:
- cellSaveDataAutoSave2
- cellSaveDataAutoLoad2
2014-05-31 23:41:12 +02:00
Alexandro Sánchez Bach 1efa137f8f Merge pull request #291 from O1L/master
Fixed issue #276.
2014-05-31 18:03:11 +02:00
Oil 1705c5afb6 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-05-31 19:19:54 +04:00
Hykem d300a50630 Merge pull request #278 from Dante38490/master
Correct name soft_oal.dll and fix sln
2014-05-31 16:12:56 +01:00
Hykem ecd87aa2b5 Merge pull request #279 from Dante38490/patch-1
Update README.md
2014-05-31 16:12:29 +01:00
Hykem 1affafe5ea Merge pull request #277 from aniruddh22/patch-1
Add 1024x768 native resolution support
2014-05-31 16:11:15 +01:00
Oil 14fae9a401 Add a option for converting audio to 16 bit. Issue #276 fixed with using this option? 2014-05-31 18:21:47 +04:00
Blaypeg 0d3b8c0808 Add Menu and INI option to autostart emulation 2014-05-31 11:40:37 +01:00
Alexandro Sánchez Bach 834f5dc9a9 Merge pull request #288 from raven02/patch-29
Implement cellSpursAttributeSetMemoryContainerForSpuThread
2014-05-31 10:53:39 +02:00
Alexandro Sánchez Bach 802a1fee7c Merge pull request #289 from raven02/patch-30
Compact duplicate draw objects routine
2014-05-31 10:52:02 +02:00
raven02 08c7ae64e3 Compact duplicate draw objects routine 2014-05-31 15:48:23 +08:00
raven02 41d0163781 cellSpursAttributeSetMemoryContainerForSpuThread() 2014-05-31 10:31:43 +08:00
Alexandro Sánchez Bach d3cb97d4e9 Merge pull request #287 from raven02/patch-28
Use be_t<u32>/<64> in struct
2014-05-31 01:40:51 +02:00
raven02 97561ff52b Use be_t<u32>/<64> 2014-05-31 06:49:19 +08:00
Alexandro Sánchez Bach a0cc3a0fb0 Merge pull request #286 from Nekotekina/master
Some bugs fixed
2014-05-31 00:20:39 +02:00
B1ackDaemon 46e61efefb Merge pull request #284 from raven02/patch-27
Fix typo for #283
2014-05-30 22:36:00 +03:00
raven02 57d4d72f60 Fix typo for #283 2014-05-31 03:28:16 +08:00
B1ackDaemon f09a358ea5 Merge pull request #283 from raven02/patch-26
Implement cellPngDecCreate/Destroy()
2014-05-30 21:17:33 +03:00
Blaypeg d455c21db5 Merge pull request #2 from DHrpcs3/master
update
2014-05-30 18:56:31 +01:00
raven02 eb61c2a960 Add struct CellPngDecMainHandle 2014-05-31 01:45:45 +08:00
raven02 141d8e20ec Implement cellPngDecCreate/Destroy() 2014-05-31 01:44:38 +08:00
Nekotekina d5d4f88c17 Small RSX fix 2014-05-30 21:16:20 +04:00
B1ackDaemon f545ba08cb Merge pull request #282 from raven02/patch-25
Cleanup and add point size/specular/point sprite
2014-05-30 17:36:39 +03:00
Nekotekina 940d71ecdb Another cellPamf issue fixed
event_flag messages changed
2014-05-30 18:13:49 +04:00
raven02 bb64684be9 Fix spacing 2014-05-30 19:25:48 +08:00
raven02 323a48d14b Cleanup and add point size/point sprite/specular 2014-05-30 19:19:26 +08:00
B1ackDaemon 69ec7a041e Merge pull request #281 from raven02/patch-24
Add few more opcode(STR/SFL) and fix KIL (discard)
2014-05-28 16:00:30 +03:00
raven02 13d68cbeeb Opcode : add STR/SFL and fix KIL (discard) 2014-05-28 11:32:56 +08:00
Alexandro Sánchez Bach c1594255a7 Merge pull request #280 from raven02/patch-23
Opcode: add KIL & LRP
2014-05-28 02:29:13 +02:00
raven02 872cbec8ba Opcode : add KIL & LRP 2014-05-28 08:03:57 +08:00
Dante38490 4f1b7bf69a Update README.md 2014-05-26 14:34:07 +02:00
Zangetsu 3de9202533 Correct name soft_oal.dll and fix sln 2014-05-26 14:30:27 +02:00
aniruddh da77ed1de3 Update sysutil_video.h 2014-05-26 17:31:07 +05:30
Alexandro Sánchez Bach b953e06622 Merge pull request #275 from Blaypeg/master
GUI Update, Game panel column headings now sortable
2014-05-25 23:30:15 +02:00
Blaypeg 42e5000c2d Remove Unused varible 2014-05-25 22:01:00 +01:00
Blaypeg f060f9e047 Set Game List columns as sortable 2014-05-25 21:59:26 +01:00
Blaypeg f1257f9e3f Change types to stop compiler warnings 2014-05-25 21:36:55 +01:00
Alexandro Sánchez Bach 40f0f80f5d Minor changes
Irrelevant modifications. None of this affects RPCS3 directly.
2014-05-25 22:31:40 +02:00
B1ackDaemon 948d4ef3a2 Merge pull request #274 from raven02/patch-22
GLGSRender: re-enable glPrimitiveRestartIndex
2014-05-25 22:39:33 +03:00
B1ackDaemon 5fda90abc6 Merge pull request #273 from raven02/patch-21
RSXDebugger : add scissor test & primitive restart
2014-05-25 22:39:28 +03:00
B1ackDaemon 6b66f77590 Merge pull request #272 from raven02/patch-20
RSXThread: add few more logging and comments
2014-05-25 22:39:22 +03:00
B1ackDaemon ddd485fdad Merge pull request #271 from raven02/patch-19
DbgConsole: hide debug console
2014-05-25 22:39:17 +03:00
B1ackDaemon 9c1ec3569f Merge pull request #268 from O1L/master
Switch to OpenAL Soft.
2014-05-25 22:39:09 +03:00
Blaypeg 95f67080f8 Attempt to make columns sortable for game list 2014-05-25 19:45:44 +01:00
raven02 29d0b1443e Add Primitve restart & scissor test 2014-05-26 01:07:16 +08:00
raven02 fe31f1be61 Re-enable glPrimitiveRestartIndex 2014-05-26 00:50:43 +08:00
raven02 c096bfce7a Add case_16(NV4097_SET_TEXTURE_FORMAT, 0x20) 2014-05-25 22:21:38 +08:00
raven02 5109065425 RSXThread: Add few more logging and comments 2014-05-25 22:08:45 +08:00
Alexandro Sánchez Bach 5d88ca2287 Merge pull request #270 from mputters/xinput
Inverted XInput Y-axis for sticks
2014-05-25 13:01:42 +02:00
raven02 2b8998af91 Hide debug console option 2014-05-25 16:05:21 +08:00
Michael Putters 6780a2f0bf Inverted XInput Y-axis for sticks 2014-05-25 09:34:06 +02:00
Oil 8a1227eaa2 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-05-25 01:46:25 +04:00
Oil 6072fd2fbb Switch to OpenAL Soft (see issue #166). Use native FLOAT32 data now. Add small check in OpenALThread. 2014-05-25 01:38:29 +04:00
B1ackDaemon 33584b6668 Merge pull request #267 from mputters/xinput
Basic XInput support
2014-05-24 22:14:41 +03:00
Michael Putters 03914d60d3 Basic XInput support 2014-05-24 21:05:00 +02:00
Hykem 490d1059ac Merge pull request #250 from ItzWarty/cellPngDecDecodeData_optimizations
Optimize cellPngDecDecodeData's CELL_PNGDEC_ARGB case
2014-05-24 17:23:17 +01:00
B1ackDaemon b09560cc1c Merge pull request #266 from raven02/patch-18
Add option to skip PAMF movie
2014-05-24 18:13:53 +03:00
raven02 8a068e7fca Add option to skip PAMF 2014-05-24 21:48:54 +08:00
B1ackDaemon 59f08f9bdd Merge pull request #265 from unknownbrackets/ppu-minor
Fix the DCBZ instruction
2014-05-23 20:32:15 +03:00
Unknown W. Brackets f49d3d6a28 Fix the DCBZ instruction.
Needs to zero memory.
2014-05-23 09:57:13 -07:00
Blaypeg 360070bddb Merge pull request #1 from DHrpcs3/master
test
2014-05-23 17:31:59 +01:00
B1ackDaemon a186efded2 Merge pull request #264 from unknownbrackets/ppu-minor
Clean up LR updates in branches, remove CA update in ADD
2014-05-23 19:24:32 +03:00
Unknown W. Brackets 82d60ee48d Do not set the CA bit in ADD().
Thanks Ashe`.
2014-05-23 09:20:58 -07:00
Unknown W. Brackets 493bf93a5a Update LR only when cond passes.
It should not be updated otherwise.  In most cases, won't matter.

Also, reorder slightly so SetBranch() can safely set PC directly.
2014-05-23 09:20:57 -07:00
B1ackDaemon 0ec78e0d5e Merge pull request #263 from raven02/patch-16
Add 960x540 natvie resolution support
2014-05-23 19:02:40 +03:00
B1ackDaemon 9e4c2c1030 Merge pull request #262 from raven02/patch-15
Replace slow glReadpixels routine with glBlitframebuffer
2014-05-23 19:02:26 +03:00
raven02 6520b8f06d Add 960x540 natvie resolution support 2014-05-23 23:51:55 +08:00
raven02 a2af749e71 Replace slow glReadpixels routine with glBlitframebuffer for non-MRT 2014-05-23 22:22:32 +08:00
B1ackDaemon e2ebb09d6c Merge pull request #259 from raven02/patch-14
Code cleanup and added glPolygonOffset
2014-05-21 20:42:23 +03:00
raven02 94393ff4ea Re-enable glFrontFace with sanity check 2014-05-22 01:08:46 +08:00
raven02 3445f8a49f There is no glEnable(GL_FRONT_FACE) 2014-05-22 00:48:49 +08:00
raven02 b95667563f Code cleanup and added glPolygonOffset 2014-05-22 00:31:40 +08:00
B1ackDaemon e569de73d6 Merge pull request #248 from ItzWarty/master
virtual memory block reads/writes properly fail if address is out of bounds
2014-05-21 18:22:01 +03:00
Alexandro Sánchez Bach 38e0c62e99 Merge pull request #258 from raven02/patch-13
Enable GL_SCISSOR_TEST and add glLogicOp
2014-05-21 15:43:33 +02:00
Oil 60514cc48d Completed. 2014-05-21 17:06:02 +04:00
Oil e3a56e39d7 Restored. 2014-05-21 16:57:57 +04:00
Oil 3475912233 Some changes from previous commit restored. 2014-05-21 16:14:33 +04:00
Oil 570efab05f asmjit project moved in asmjitsrc directory. 2014-05-21 14:45:36 +04:00
raven02 967935d389 Enable GL_SCISSOR_TEST and add glLogicOp 2014-05-21 18:14:51 +08:00
Alexandro Sánchez Bach ec53f2557a Merge pull request #257 from jarveson/cellpad_fixes2
Cellpad fixes
2014-05-21 03:38:27 +02:00
Jake afc5294016 cellPad: Changes to report 0 length if theres no changes 2014-05-20 19:56:36 -05:00
Jake 233b179f65 cellPad: Fix logic error in setPressMode and setSensorMode 2014-05-20 19:54:08 -05:00
Alexandro Sánchez Bach 840e9d8ed8 Merge pull request #255 from raven02/patch-12
Set default polygon_mode as GL_FILL
2014-05-20 21:21:31 +02:00
raven02 e0f89beb7d Set default polygon_mode as GL_FILL 2014-05-21 02:08:49 +08:00
B1ackDaemon 6bb812f283 Merge pull request #254 from raven02/patch-12
Implement NV4097_SET_BACK_POLYGON_MODE
2014-05-20 17:12:02 +03:00
raven02 f67d30571b Add NV4097_SET_BACK_POLYGON_MODE 2014-05-20 22:10:14 +08:00
Alexandro Sánchez Bach 9209edc15c Merge pull request #253 from ItzWarty/memoryviewer_fixes
Improve Memory Viewer: There are bugs in text representation.
2014-05-20 00:29:03 +02:00
Michael Yu 85785b471e MEMORY: Fixed IsMyAddress bound error (GetEndAddr returns an inclusive value) 2014-05-19 14:58:01 -07:00
Michael Yu 4c02c20d84 Improve Memory Viewer: There are bugs in text representation.
Char display now only displays printable ascii characters. Anything non-printable is printed as '.' as is standard.
Additionally, displayed lines are properly delineated with newlines so that we don't wrap on spaces.
2014-05-19 14:56:58 -07:00
Alexandro Sánchez Bach 9ce9c3ce21 Merge pull request #252 from raven02/patch-11
Regression fix cellPamf
2014-05-19 19:13:18 +02:00
raven02 0ba5bb4e7a Regress fix cellPamf 2014-05-19 22:48:59 +08:00
Alexandro Sánchez Bach c312bc1b70 Merge pull request #249 from raven02/patch-9
Add support for m_surface_depth_format 0
2014-05-19 15:16:17 +02:00
raven02 4f961c9e0b Add comment for depth format 0 2014-05-19 21:14:30 +08:00
Alexandro Sánchez Bach e280d54f3f Fix pointers issue in cellUserInfoGetList
Solves GetMemFromAddr(0x0) on NPEB01894.
2014-05-19 15:05:53 +02:00
Michael Yu 3aeb0b0f95 cellPngDecDecodeData handles CELL_PNGDEC_ARGB case much faster.
Profiling done with two samples on Solar v2.1 from rpcs3 init to first frame.
Before optimization, profiler found rpcs3 in cellPngDecDecodeData 15.3% of the time.
Post-optimization, profiler finds rpcs3 in cellPngDecDecodeData 0.33% of the time for ~50x improvement.
2014-05-19 02:23:23 -07:00
Michael Yu 9bdb12e3da MEMORY: Added AppendRawBytes, which also advances the memory pointer unlike Memory.CopyFromReal 2014-05-19 02:23:23 -07:00
Michael Yu 2834697f1f MEMORY: Copy from real's destination parameter should be immutable 2014-05-19 02:23:22 -07:00
Michael Yu 346614b0da gitignore now ignores files generated by visual studio profiler, solution configured for profiling. 2014-05-19 02:23:22 -07:00
raven02 c2f3f04808 Add support for m_surface_depth_format 0 2014-05-19 15:43:41 +08:00
Michael Yu 9e791da7bd virtual memory block reads/writes properly fail if address is out of bounds.
Fixes Solar v2.1 http://puu.sh/8ScXK.jpg
2014-05-18 23:12:28 -07:00
Alexandro Sánchez Bach 0d0df4b491 Merge pull request #247 from unknownbrackets/texformats
Implement more texture formats per the test
2014-05-19 00:52:20 +02:00
Unknown W. Brackets 7948f376fb GL: Fix the compressed R8B8 / B8R8 type formats.
The not-swizzled bit is always set for them.
2014-05-18 15:24:12 -07:00
Unknown W. Brackets 612e515317 GL: Fix X16 / Y16_X16 texture formats.
Per the rsx/texture_formats test.  Not sure about pitch, may need to deal
with UNPACK_ROW_LENGTH...
2014-05-18 14:39:04 -07:00
Unknown W. Brackets 06c4c45200 GL: Fix half-float texture formats.
This matches the ps3 output/channels for these textures per the
rsx/texture_formats test.
2014-05-18 14:22:05 -07:00
Alexandro Sánchez Bach 4f63f57d26 Merge pull request #246 from Blaypeg/master
Explicit conversion to avoid compiler warning (2)
2014-05-18 15:05:06 +02:00
Blaypeg 5e36362a4c int ->size_t 2014-05-18 13:28:11 +01:00
Alexandro Sánchez Bach b4a7684344 Check pointers in cellPamf 2014-05-18 12:46:01 +02:00
B1ackDaemon 9e7f8564b6 Merge pull request #244 from raven02/patch-6
Fix wrong color effect in Disgaea 3
2014-05-18 11:08:17 +03:00
B1ackDaemon 1a6fa4aedc Merge pull request #243 from unknownbrackets/texformats
Swap R/B in a few other texture formats
2014-05-18 11:08:12 +03:00
B1ackDaemon be11bd85f6 Merge pull request #242 from unknownbrackets/pngdec
cellPngDec: Ignore bytesPerLine < width * bpp
2014-05-18 11:08:05 +03:00
raven02 c8e52a78f9 Fix wrong color effect in Disgaea 3 2014-05-18 14:57:56 +08:00
Unknown W. Brackets 07505aa9e2 GL: Fix D1R5G5B5 texture R/B components as well. 2014-05-17 23:14:42 -07:00
Unknown W. Brackets 7992115f6c GL: Swap R/B in A1R5G5B5 correctly.
Fixes Terraria, thanks @raven02.  How did I miss this, it was not passing
the test after all...
2014-05-17 23:06:26 -07:00
Unknown W. Brackets fed2998d48 cellPngDec: Ignore bytesPerLine < width * bpp.
It seems strange, but Sonic CD passes bytesPerLine = w * 3 for a 4 channel
image.  Either this is a bug elsewhere, or it ignores likely incorrect
strides.

Untested except in Sonic CD.
2014-05-17 22:32:11 -07:00
B1ackDaemon c0f55ae1e7 Merge pull request #241 from unknownbrackets/texformats
Add a few more texformats, fix cellPngDec
2014-05-18 02:19:30 +03:00
Unknown W. Brackets c8dea6b931 Typo. 2014-05-17 15:38:13 -07:00
Unknown W. Brackets 28b10157ad GL: Add Y16_X16 tex format (untested.) 2014-05-17 14:49:23 -07:00
Unknown W. Brackets 439dd9d8a3 GL: Add Y16_X16_FLOAT tex format (untested.) 2014-05-17 14:49:22 -07:00
Unknown W. Brackets cf0e116a56 GL: Add R8B8_R8G8 / B8R8_G8R8 formats, tweak G8B8.
Based on how the first two swizzle, most likely G8B8 works that way too.
2014-05-17 14:49:22 -07:00
Alexandro Sánchez Bach 0e3e4c7553 Merge pull request #236 from unknownbrackets/pngdec
cellPngDec: fix outputMode, outputBytesPerLine
2014-05-17 21:48:16 +02:00
Alexandro Sánchez Bach 921de12d93 Merge pull request #238 from unknownbrackets/texformats
Correct various texture formats in OpenGL
2014-05-17 20:56:29 +02:00
Unknown W. Brackets dbcee43567 Typo. 2014-05-17 11:32:18 -07:00
Unknown W. Brackets b58320d7dc GL: Small simplification. 2014-05-17 11:29:49 -07:00
Unknown W. Brackets 0978a1348e GL: Correct byteswapping for 565 type textures. 2014-05-17 11:15:26 -07:00
Unknown W. Brackets 86d35d58df GL: Add support for R6G5B5. 2014-05-17 11:15:26 -07:00
Unknown W. Brackets 2f8e31cddd GL: support the G8B8 tex format. 2014-05-17 11:15:25 -07:00
Unknown W. Brackets 68bc41b436 GL: Correct texture reswizzling, fix A4R4G4B4. 2014-05-17 11:15:25 -07:00
Alexandro Sánchez Bach ac65af7b62 Merge pull request #237 from raven02/patch-5
Fix wrong type for DEPTH24_D8/DEPTH16
2014-05-17 19:19:55 +02:00
raven02 ccc35176f6 Fix wrong type for DEPTH24_D8/DEPTH16 2014-05-18 00:52:48 +08:00
Unknown W. Brackets f7114cc620 cellPngDec: fix outputMode, outputBytesPerLine.
This handles CELL_PNGDEC_BOTTOM_TO_TOP and also handles reduced
outputBytesPerLine more correctly-looking.  Not actually tested against
actual behavior.
2014-05-17 09:21:25 -07:00
Alexandro Sánchez Bach d745a7bb4e Implemented CELL_GCM_TEXTURE_D1R5G5B5
Same color issue as A1R5G5B5 though.
2014-05-17 17:17:41 +02:00
B1ackDaemon 1f465bc7d8 Merge pull request #235 from raven02/patch-4
Implement CELL_GCM_TEXTURE_A1R5G5B5 & CELL_GCM_TEXTURE_A4R4G4B4
2014-05-17 12:22:58 +03:00
B1ackDaemon 389e3bbd91 Merge pull request #233 from raven02/patch-3
Fix CELL_GCM_TEXTURE_B8 opengl error 0x0500
2014-05-17 12:22:45 +03:00
B1ackDaemon a3a6a8a9e0 Merge pull request #232 from raven02/patch-2
Fix ternary operator
2014-05-17 12:22:35 +03:00
B1ackDaemon 36d5cf1a7f Merge pull request #231 from raven02/patch-1
Set default off for WriteColorBuffers / DepthBuffers
2014-05-17 12:22:27 +03:00
B1ackDaemon a33e4c7346 Merge pull request #230 from raven02/master
Use GL_BGRA for glReadPixels()
2014-05-17 12:22:12 +03:00
raven02 0d9de89a26 Implement CELL_GCM_TEXTURE_A1R5G5B5 & CELL_GCM_TEXTURE_A4R4G4B4 2014-05-17 17:00:25 +08:00
raven02 ddfdaa270e Set default on for Ignore RW errors
This seems to be making couples of games at least not booting without the option ticking.
2014-05-17 10:03:21 +08:00
raven02 e7a4eac676 Typo fix 2014-05-17 01:44:13 +08:00
raven02 ca7c4e119e Fix CELL_GCM_TEXTURE_B8 opengl error 0x0500 2014-05-17 01:27:55 +08:00
raven02 86ca4819ee Fix ternary operator 2014-05-16 22:43:32 +08:00
raven02 8278c8f5c4 Set default off for WriteColorBuffers / DepthBuffers 2014-05-16 21:29:34 +08:00
raven02 20af7c4981 Log lvl -> Log Level 2014-05-16 21:27:14 +08:00
raven02 f5e1d9eab1 Use GL_BGRA for glReadPixels() 2014-05-16 15:13:34 +08:00
Alexandro Sánchez Bach 68b0f800ff Merge pull request #228 from raven02/patch-1
Add few more texture formats and comments
2014-05-15 18:15:37 +02:00
raven02 42434adfaf Add few more texture formats and comments 2014-05-15 22:29:55 +08:00
Alexandro Sánchez Bach 315f1e62ad Merge pull request #227 from raven02/master
Implement CELL_GCM_TEXTURE_R5G5B5A1/R5G6B5
2014-05-15 11:01:41 +02:00
raven02 f3c3bebd6e Implement CELL_GCM_TEXTURE_R5G5B5A1/R5G6B5 2014-05-15 16:11:29 +08:00
Alexandro Sánchez Bach 5b252a8bad Merge pull request #226 from O1L/master
Fixed issue #221.
2014-05-14 14:49:49 +02:00
Oil 5833d22fe0 Fixed issue #221, and other minor changes. 2014-05-13 22:45:24 +04:00
Alexandro Sánchez Bach 38bd40891d Fixed issue with RSX Reports
Reports consist of 16 bytes (64-bit timestamp, 32-bit value and 32-bit
zero padding). This was found by @nohbdy some time ago.
2014-05-12 21:31:01 +02:00
Alexandro Sánchez Bach 4aefd5cbc4 Merge pull request #225 from Bigpet/master
Some light formatting and hotkeys for main frame restored.
2014-05-11 00:54:42 +02:00
Peter Tissen ca64054505 some light formatting and hotkeys for main frame restored 2014-05-10 16:00:34 +02:00
Peter Tissen 4c5b5f709f match project dependencies for wxStuff from their *.sln 2014-05-09 11:16:31 +02:00
Alexandro Sánchez Bach 8d5599d3dc Merge pull request #220 from unknownbrackets/opcodes
Add a few missing opcodes, fix SRAWI
2014-05-09 06:23:20 +02:00
Alexandro Sánchez Bach 93cb2a0af9 Merge pull request #219 from jarveson/cellPad_fixes
Cell pad fixes
2014-05-09 06:20:36 +02:00
Jake 6045c9a890 Removed unneccessary commented analog stick code 2014-05-08 17:20:16 -05:00
Unknown W. Brackets ff89e06fd6 Add missing ICBI instruction. 2014-05-07 23:53:19 -07:00
Unknown W. Brackets 9290453d2e Add missing STFSUX/STFDUX instructions. 2014-05-07 23:48:27 -07:00
Unknown W. Brackets 592e13b6a0 Add missing LSWX and STSWX instructions. 2014-05-07 23:39:45 -07:00
Unknown W. Brackets a5c18b2a09 Add missing TD instruction. 2014-05-07 23:36:13 -07:00
Unknown W. Brackets d54237b0a3 Fix SRAWI instruction decoding.
It's SH, not sh.  Lowercase combines bits from two fields.
2014-05-07 23:23:23 -07:00
Unknown W. Brackets 134e891068 Fix operand order in DSTST instruction.
No functional change.  Also, switch SC to use a u32 for more typesafe
opcode decoding - also no functional change.
2014-05-07 23:22:03 -07:00
Unknown W. Brackets cf86056ba9 Update wxWidgets to fix recompile thing in MSVC. 2014-05-07 23:21:45 -07:00
Jake 5deedb1524 Fix pad handler for digital buttons 2014-05-07 18:08:16 -05:00
Jake 4d28d2e75d Revert comment out of cellPadGetCapabilityInfo in funcList 2014-05-07 01:45:18 -05:00
Jake 0e933439dc Initial cellPadClearBuf functionality 2014-05-06 23:09:10 -05:00
Jake 387eac4d08 Added pressure support for keys, redid analog 'key' stick support 2014-05-06 23:04:47 -05:00
Jake 0d4e950769 Implemented more cellPad functions, fixed some cellpad error returns 2014-05-06 22:54:41 -05:00
Jake 604eecf5d4 Add in cellPadGetCapabilityInfo function 2014-05-06 22:48:55 -05:00
Jake 199845a9d1 Fixed 'Assign_changes' usage for cellpad / padhandler 2014-05-05 21:58:49 -05:00
Jake 29cd11ad06 Added in some more error codes to Cellpad functions 2014-05-05 20:49:20 -05:00
Alexandro Sánchez Bach 5b0ebacc40 Merge pull request #217 from Bigpet/master
fix msvc opengl includes
2014-05-01 21:07:40 +02:00
Peter Tissen 4de24cb436 more compact precompiler checking 2014-05-01 19:32:16 +02:00
Peter Tissen 0aa8a9f372 fix OpenGL includes for Win32 2014-05-01 19:29:28 +02:00
Alexandro Sánchez Bach 4c9444b958 Merge pull request #214 from kaazoo/master
Add compilation support for Mac OSX
2014-05-01 16:50:43 +02:00
Andreas Schroeder 11ca131607 detect Mac OSX and Windows, fall back to Linux 2014-04-30 00:58:57 +02:00
Andreas Schroeder ebe20a0825 move clock_gettime() into GNU.cpp 2014-04-29 22:46:43 +02:00
Andreas Schroeder 22a90a0907 add info for Mac OSX 2014-04-29 22:46:43 +02:00
Andreas Schroeder e7f0efa56d Mac OSX: use __thread for thread-local storage 2014-04-29 22:46:42 +02:00
Andreas Schroeder 64cfab5b46 Mac OSX: fix includes & add missing functionality 2014-04-29 22:46:42 +02:00
Clayton Walker 4db97eae7c Set build independent binary output dir
Useful for using multimple compilers (gcc/clang) with different compile-time (debug/release)
2014-04-29 01:17:41 -06:00
Alexandro Sánchez Bach f908a3ca78 Merge pull request #213 from Bigpet/master
Compile fix for VS (doesn't like implicit `u64 *` to `unsigned long*`)
2014-04-28 23:15:52 +02:00
Peter Tissen 3220e9bbc4 format warning disable for clang, typo correction 2014-04-28 21:50:07 +02:00
Peter Tissen baaa2ae45a format warning disable for clang, it clutters up the build messages too much 2014-04-28 21:36:31 +02:00
Peter Tissen 92d556524b well let's hope Clang doesn't mind implicit unsigned int to u64 2014-04-28 21:18:11 +02:00
Hykem 90896560bb Merge pull request #209 from unknownbrackets/warnings
Fix a bunch of warnings
2014-04-28 17:15:12 +01:00
Hykem 82e47a5c53 Merge pull request #212 from unknownbrackets/perf
Improve memory access performance a little
2014-04-28 16:31:11 +01:00
Unknown W. Brackets 8ff354a4ea Switch a bunch of loops to range fors. 2014-04-28 07:57:49 -07:00
Hykem 7b28d9d7ba Merge pull request #185 from lioncash/gui-cleanup
Clean up UI code.
2014-04-28 15:54:54 +01:00
Unknown W. Brackets d6baac6fbe Fix reseved -> reserved typo. 2014-04-28 07:43:12 -07:00
Unknown W. Brackets fce0a1efa1 Add AboutDialog.h header to msvc. 2014-04-28 07:43:12 -07:00
Unknown W. Brackets fb03214f0a Clarify if/else precedence in a macro. 2014-04-28 07:43:11 -07:00
Unknown W. Brackets bdb08c58d3 Clarify a no-content loop. 2014-04-28 07:43:11 -07:00
Unknown W. Brackets 1fb8060263 Clarify precedence in macro. 2014-04-28 07:43:10 -07:00
Unknown W. Brackets 75fe77115d Avoid a trigraph. 2014-04-28 07:43:10 -07:00
Unknown W. Brackets 763fb2719f Don't try to delete [] things that weren't new'd. 2014-04-28 07:43:09 -07:00
Unknown W. Brackets bcf63a0fae Correct some non-const string literals.
Should not be treated as non-const char *.
2014-04-28 07:43:09 -07:00
Unknown W. Brackets 80eb12a9d6 Always return a value in get_time().
Although, clock_gettime() should never fail here.
2014-04-28 07:43:08 -07:00
Unknown W. Brackets f2d6bf73ca Clarify an assignment is not a comparison. 2014-04-28 07:43:07 -07:00
Unknown W. Brackets 563aa2d2ca Log unhandled case in FPSCR::checkSliceRounding(). 2014-04-28 07:43:07 -07:00
Unknown W. Brackets 2fdefc4fb5 Fix some int/ptr comparisons. 2014-04-28 07:43:06 -07:00
Unknown W. Brackets b550ccfc73 Make MemoryBase::Unmap() return a value. 2014-04-28 07:43:06 -07:00
Alexandro Sánchez Bach dea8bed140 Merge pull request #207 from UnconventionalT/master
Gui: Replace sscanf with ToULong
2014-04-28 10:12:10 +02:00
Unknown W. Brackets 32554b7023 Use templates in FastRead/FastWrite to simplify.
DRY.
2014-04-28 00:42:02 -07:00
Alexandro Sánchez Bach c8d93d0da4 Merge pull request #208 from darkf/patch-1
README: Use OpenAL Soft and add a Travis CI badge
2014-04-28 09:36:20 +02:00
Unknown W. Brackets e4c0b0310c Don't ask twice if MemoryBlocks can read mem.
They already check on Read32(), so just use that to iterate.
2014-04-28 00:15:37 -07:00
Unknown W. Brackets 2f7fbf01cf Avoid pointless strdup(). 2014-04-27 21:31:42 -07:00
Unknown W. Brackets 42d5da633a Fix an unused variable warning. 2014-04-27 21:31:42 -07:00
Unknown W. Brackets 5f6a2e498a Fix some type comparion warnings. 2014-04-27 21:31:41 -07:00
Lioncash 8feabb00d6 Correct event handlers to trigger in all instnces
Some events don't propagate correctly to the right sub-window
and some things like the pad handler don't even necessarily have
windows. So, just register some events with the top-level app.

Also add a virtual destructor to the PadHandlerBase to be able to
deal with multiple inheritance in the derived classes.
2014-04-27 20:05:01 -04:00
darkf 708662da39 README: Use OpenAL Soft and add a Travis CI badge 2014-04-27 16:55:18 -07:00
Lioncash b877879db6 Clean up UI code.
- Use Bind instead of connect. It's recommended for anyone using wx 2.9+
- Remove AppConnector. All this did was destroy objects used in the UI. However, wxWidgets handles this. So it's redundant.
- Misc other unimportant changes.
2014-04-27 19:53:13 -04:00
Clayton Walker 0c5526f2fd Gui: Replace sscanf with ToULong 2014-04-27 17:11:03 -06:00
B1ackDaemon db1ca2f89f Merge pull request #206 from Bigpet/linspurec
enable SPU recompiler on linux
2014-04-28 00:12:35 +03:00
Peter Tissen fad6c7cecb add asmjit path hack, we'll get rid of it sooner or later 2014-04-27 21:32:12 +02:00
Peter Tissen 870fa5a153 explicit cast from void(*)() to void * 2014-04-27 20:23:32 +02:00
Peter Tissen 0bcadaf155 explicitER casting, why you heff to be mad Clang 2014-04-27 20:13:47 +02:00
Peter Tissen 95ca5315e7 fix path to the asmjit lib 2014-04-27 19:59:12 +02:00
Peter Tissen 9d3d7b09b3 explicit casting 2014-04-27 19:55:31 +02:00
Peter Tissen 7169972434 disable cotire for now 2014-04-27 19:34:09 +02:00
Peter Tissen 4981c576d2 rename all the non-standard include file extensions to *.h 2014-04-27 19:28:03 +02:00
Peter Tissen 6a24d2bbac fix typo in cmakelists.txt, again 2014-04-27 19:23:11 +02:00
Peter Tissen 07841fc9e3 fix typo in cmakelists.txt 2014-04-27 19:17:41 +02:00
Peter Tissen 85be97e6a2 add explicit casts for the ptrdiffs 2014-04-27 19:15:35 +02:00
Peter Tissen a766f5951d add precompiled header build to cmake to speed up building 2014-04-27 19:07:20 +02:00
Peter Tissen 60a7fe17b5 remove .m128i_uxx subscripts because they're non standard 2014-04-27 18:51:24 +02:00
Peter Tissen f906d031fa remove more offsetof calls on linux and add asmjit linkage 2014-04-27 18:37:21 +02:00
Peter Tissen 1ba5cafc5f enable SPU recompiler on linux 2014-04-27 18:18:04 +02:00
Alexandro Sánchez Bach d085301af3 Merge pull request #204 from darkf/padfix
pad: Send all button states so release events fire
2014-04-27 16:06:03 +02:00
darkf d47dbf4f32 pad: Send all button states so release events fire 2014-04-27 05:33:31 -07:00
Alexandro Sánchez Bach b0699f38e7 Merge pull request #202 from Bigpet/linub
Add travis CI config file and all the changes to make it compile there under both gcc and llvm clang
2014-04-27 01:13:54 +02:00
Bigpet eea3aa9729 This is squashed commit from the follwing commits:
* various changes to make it compile with clang

* don't compile recompiler on linux yet but make the CMake build include asmjit already

* add experimental travis bot

* modify yml to match

* try to build and install wxWidgets, since it's not in the travis repo

* use newer cmake version for travis

* add keys with sudo

* use sudo for all apt- commands

* Add additional dependencies

* use version approriate gcc flags for c++11

* try clang, gcc too old

* set c++0x flag for clang

* use gcc 4.8

* use gcc 4.8 and add the repo for it

* use gcc 4.8 even for clang to get newer headers

* fix ambiguous conversions

* add lz from hykem and more explicit conversions from be for x86

* more switch disambiguation

* more switch disambiguation

* add additional unigned int casts to deal with be_t conversion ambiguity

* remove unnecessary clang flag

* add lz.cpp to vcxproj and cast to u32 instead of unsigned int

* correct temporaray #ifdefs
2014-04-27 00:41:46 +02:00
Alexandro Sánchez Bach a2157a5365 Merge pull request #201 from Nekotekina/master
Compilation fix again
2014-04-26 12:55:29 +02:00
Nekotekina 0d375809b1 Useless code removed 2014-04-26 00:28:43 +04:00
Nekotekina a24cb250d8 Compilation fix again 2014-04-26 00:09:23 +04:00
Alexandro Sánchez Bach 6facd8d9c6 Merge pull request #200 from Nekotekina/master
Compilation fixes
2014-04-25 15:53:35 +02:00
Nekotekina 555d053e32 Compilation fixes 2014-04-25 16:48:27 +04:00
Alexandro Sánchez Bach 15b0b6830e Merge pull request #199 from darkf/net-work
Improve networking
2014-04-25 10:00:18 +02:00
darkf 2b7c12a3f0 Stub cellWebBrowserEstimate2 so some apps proceed 2014-04-24 22:14:40 -07:00
darkf ee2e0b3bbf sys_net: Implement sockaddr_in, inet_addr, listen 2014-04-24 22:02:33 -07:00
darkf b0b6034e63 accept accepts NULL address 2014-04-24 05:10:43 -07:00
Alexandro Sánchez Bach 8c4fd75c82 Merge pull request #198 from darkf/spugui
Add SPU decoder mode selection to GUI/Config
2014-04-23 20:38:34 +02:00
darkf 090f7f8cfb Add SPU decoder mode selection to GUI/Config 2014-04-23 05:06:19 -07:00
Alexandro Sánchez Bach 0d7e45639a Merge pull request #197 from Nekotekina/master
Simple SPU JIT
2014-04-23 13:19:18 +02:00
Nekotekina 525084e7cc Some stuff 2014-04-20 23:36:53 +04:00
Nekotekina e1bbedd4bf Accuracy improved 2014-04-20 02:53:42 +04:00
Alexandro Sánchez Bach 9e793c2122 cellSaveData* (cellSysutil) refactoring 2014-04-19 18:50:06 +02:00
Nekotekina 678a964ff4 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-04-19 18:45:55 +04:00
Alexandro Sánchez Bach 225c58c17b Merge pull request #196 from Bigpet/deleteErr
fix copying class with pointers as member
2014-04-19 11:33:27 +02:00
Nekotekina 7875738391 More opcodes 2014-04-19 02:11:07 +04:00
Nekotekina 62df7eb499 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
Conflicts:
	rpcs3/rpcs3.vcxproj.filters

Conflicts fixed
2014-04-18 16:59:31 +04:00
Peter Tissen ee9d25c675 forgot the right check 2014-04-18 13:31:37 +02:00
Peter Tissen 79eaffaaa7 copying class with pointers as member when deleting them in the desctructor is danger zone. 2014-04-18 13:28:27 +02:00
Alexandro Sánchez Bach ef108ae4d6 Merge pull request #194 from Dante38490/patch-1
Restore the "# Visual Studio 2013" comment in rpcs3.sln
2014-04-18 00:17:25 +02:00
Dante38490 9900b36f07 return back
restore correct version
2014-04-17 23:38:07 +02:00
Alexandro Sánchez Bach bad20ab9df Merge pull request #193 from nohbdy/pull_apr172014
RSX Bugfixes and plugging memory leaks
2014-04-17 23:18:20 +02:00
Nekotekina 5d091411a3 More opcodes 2014-04-18 00:25:02 +04:00
nohbdy d136adc73f RSX Bugfixes and plugging memory leaks
BUGFIX: Add break after NV4097_SET_TEXTURE_BORDER_COLOR in RSXThread.cpp
BUGFIX: Fix parameters passed to RSXTexture::SetControl3 (they were being
passed in reverse order)
BUGFIX: Remove invalid, non-sensical call to glPixelStorei in GLGSRender.h
BUGFIX: Fix signed/unsigned comparison compiler warnings in GLGSRender.h
CHANGE: Make GLFragmentProgram::Decompiler synchronous by default
CHANGE: Update wxWidgets submodule to latest commit
BUGFIX: Fix several memory leaks
ADDED: Created a new MSVC debug configuration to output locations
  of allocations that end up leaking after the program
  is closed.
BUGFIX: Fix the stupid PadHandler crash due to the lack of a virtual d'tor
2014-04-17 15:15:43 -05:00
Nekotekina 29d2ea7513 Some bugs fixed 2014-04-17 03:28:21 +04:00
Nekotekina a57841d006 Some comments cleared 2014-04-16 15:36:20 +04:00
Nekotekina dab0751300 ... 2014-04-16 15:09:06 +04:00
B1ackDaemon 34729e2687 Merge pull request #191 from Bigpet/master
Fix for video playback
2014-04-15 17:12:15 +03:00
Peter Tissen f073f1ca4b yeah, that happened 2014-04-15 14:48:21 +02:00
Alexandro Sánchez Bach aa8e854be2 Merge pull request #187 from Bigpet/master
range-check and more explicit ownership with vector<ptr>
2014-04-15 00:55:07 +02:00
Nekotekina c41317dd82 New bugs added 2014-04-14 13:42:55 +04:00
Peter Tissen 8ef9414406 try to reign in the vector<ptr> madness 2014-04-14 10:55:43 +02:00
Peter Tissen 552b71a378 fix not range-checked vector access 2014-04-14 09:01:31 +02:00
Alexandro Sánchez Bach 5dc9be649d Merge pull request #184 from daniel-dressler/master
Add Linux build instructions for Debian & Ubuntu
2014-04-13 07:38:55 +02:00
danieru b87aa55351 Fix run instruction hitting CWD bug
PCS3 assumes current working directory is bin folder.
So running it like ./bin/pcs3 stops it from finding
dev_hdd0 and related.
2014-04-12 21:15:09 -06:00
danieru 57a9b557e9 Add Linux build instructions for Debian & Ubuntu 2014-04-12 19:19:48 -06:00
B1ackDaemon 0d7397a636 Merge pull request #183 from Bigpet/cmakefix
quote guard CMake variables
2014-04-12 22:54:43 +03:00
B1ackDaemon a059297bf4 Merge pull request #182 from Bigpet/array_remove
Replace Array with std::vector
2014-04-12 22:54:34 +03:00
Bigpet a14c61802e quote guard CMake variables 2014-04-12 21:36:34 +02:00
Nekotekina 180f8aac5d SPU Interpreter fix 2014-04-12 14:27:27 +04:00
Peter Tissen cdaca2d308 fix accidental wxWidgets version change 2014-04-12 12:09:48 +02:00
Bigpet 25c3aa8e19 fixes to get llvm to compile (excepti for utils.cpp, that'll get fixed
later)

Eradicate the Array almost everywhere, some usages like Stack still
remains
2014-04-12 12:06:52 +02:00
Peter Tissen d65968b41d unify line endings to shut up VS 2014-04-12 11:42:20 +02:00
Nekotekina e56bb1b675 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-04-11 12:33:41 +04:00
Nekotekina a7057f5205 Conflicts fixed 2014-04-10 02:00:01 +04:00
Alexandro Sánchez Bach c8d8428275 Merge pull request #179 from O1L/master
Minor fix in GUI an other changes.
2014-04-09 23:59:29 +02:00
Oil 0763e429b8 I just forgot to do it... 2014-04-10 00:42:50 +04:00
Oil 770ebaf271 Implemented small tool for generating id of HLE-Function. Fixed small issue in PADManager dialog. 2014-04-09 23:57:26 +04:00
Alexandro Sánchez Bach 8183ee4d56 cellSaveData* improvements
* cellSaveDataFixedSave2 and cellSaveDataFixedLoad2 implemented. Still a
little buggy.
* Small fix the cellSaveDataList(Save|Load)2 problem in Disgaea D2 and
other games.

NOTE: cellSysutil_SaveData.cpp is a total mess: some blocks of code
appear in all the syscalls. I just want to wait until most of the
SaveData functions are implemented and working to do some serious
refactoring.
2014-04-09 18:23:14 +02:00
Alexandro Sánchez Bach 930d507d43 Merge pull request #178 from Bigpet/master
Remove GCC specific variadic macro syntax
2014-04-08 21:59:25 +02:00
Peter Tissen 10ca726752 Remove GCC specific variadic macro syntax 2014-04-08 21:47:02 +02:00
Alexandro Sánchez Bach e89ecd192b Merge pull request #177 from Bigpet/minifix
Various warning fixes and devirtualization
2014-04-08 20:06:20 +02:00
Alexandro Sánchez Bach ce1b6039ac Merge pull request #175 from eriksson/nx-fixes
*nix fixes
2014-04-08 20:05:55 +02:00
Peter Tissen 4066950975 Various warning fixes and devirtualization
* Remove ArrayString
* devirtualize GetCount and SetCount, they're no longer needed
* set storage duration of fmt::placeholder to extern to be consistent
* make length unsigned and the return value of sprintf signed
* remove dead code "s.Close()" is never reached
* devirtualize WrteToLog()
* devirtualize Ini functions
2014-04-08 19:41:47 +02:00
Nekotekina 33f7afd6e6 Some bugs fixed 2014-04-08 19:10:07 +04:00
Eriksson Monteiro 3cb18ac5a9 fix trailing comma in array 2014-04-08 00:41:09 +01:00
Alexandro Sánchez Bach 1975b7e139 Merge pull request #176 from lioncash/ppu-typo
Fix a typo in SUBFZE for the PPUInterpreter.
2014-04-07 21:21:38 +02:00
Nekotekina 4e9dc8ab9c SPU JIT: more asm 2014-04-07 22:27:30 +04:00
Lioncash f019bd995a Fix typo in SUBFZE for the PPUInterpreter. 2014-04-07 11:48:30 -04:00
Nekotekina f9b68bc012 SPU JIT fix
Nothing changed in interpreter.
2014-04-07 17:06:13 +04:00
Alexandro Sánchez Bach 9e40247af0 Fixed error in SC_Pad.cpp and Readme.md updated 2014-04-07 14:40:50 +02:00
Alexandro Sánchez Bach f45223563c Merge pull request #150 from lioncash/unique-ptr
Misc cleanup of the Io stuff.
2014-04-07 09:49:09 +02:00
Lioncash d36da21d6f Fix stupid mistake I made with rebasing.
Accidentally overwrote the Pad handler stuff for windows. Should be fixed now.
2014-04-06 23:47:00 -04:00
Lioncash 3c5e3fa853 Move the mouse/keyboard/pad handlers over to using unique_ptr as the underlying base. 2014-04-06 23:46:59 -04:00
lioncash c5a7946a24 Move Keyboard/Mouse/Pad handlers over to using vector. 2014-04-06 23:46:59 -04:00
lioncash 26e80a18b4 Disallow inheriting of the null and windows mouse/keyboard/pad handlers. These aren't intended to be further extended. 2014-04-06 23:46:58 -04:00
Eriksson Monteiro e65d1a3dd9 replace CLK_TCK for CLOCKS_PER_SEC 2014-04-06 22:51:36 +01:00
Eriksson Monteiro 5a5edf17fd Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 into nx-dbgoutput 2014-04-06 22:35:36 +01:00
Alexandro Sánchez Bach 8798b05e1f Merge pull request #161 from lioncash/vs
Reorganize the VS project.
2014-04-06 22:59:05 +02:00
Alexandro Sánchez Bach b6cda331c0 Merge pull request #174 from Nmzik/master
Added 2 new functions
2014-04-06 21:58:58 +02:00
Nmzik f9e6230ead added 2 functions 2014-04-06 23:47:21 +04:00
Nekotekina e614a7313c SPU JIT WIP 2014-04-06 23:23:32 +04:00
Hykem d0b249fbca Merge pull request #172 from O1L/master
GUI: Pad Settings dialog reworked.
2014-04-06 16:17:07 +01:00
Hykem f76e1630b4 Merge pull request #171 from Nmzik/master
Minor improvement
2014-04-06 16:08:07 +01:00
Eriksson Monteiro d7dc938653 remove trailing commas in arrays 2014-04-06 14:25:53 +01:00
Alexandro Sánchez Bach 039dd480da Merge pull request #173 from lioncash/misc
Fix two parameter sanity checks in sceRtc.
2014-04-06 15:00:26 +02:00
Lioncash 842a6fe1d4 Fix two parameter sanity checks in sceRtc. 2014-04-05 15:46:56 -04:00
Nekotekina 4a9310755f Working on simple SPU JIT
No, it doesn't work.
2014-04-05 20:30:08 +04:00
O1L bbbe2f8916 GUI: Pad Settings dialog reworked. 2014-04-05 18:26:45 +04:00
Nmzik 3243c4c0c8 Test 2014-04-05 14:17:32 +04:00
Alexandro Sánchez Bach 3bcf5d1557 Merge pull request #170 from Nekotekina/master
Audio fixes
2014-04-04 17:55:09 +02:00
Nekotekina 82edd111e9 asmjit submodule added 2014-04-04 19:36:53 +04:00
Nekotekina c6c6dbe546 Conflicts fixed 2014-04-04 18:43:43 +04:00
Alexandro Sánchez Bach dcb9d53e6d Merge pull request #169 from lioncash/tab-fixes
Use spaces for vertical alignment
2014-04-04 16:01:57 +02:00
lioncash d0c9d7c0ae Use spaces for vertical alignment 2014-04-04 09:25:38 -04:00
Alexandro Sánchez Bach e25796f0d0 Merge pull request #168 from darkf/sysutil
Implement/stub cellSysutilGetBgmPlaybackStatus
2014-04-04 11:32:53 +02:00
darkf 4d4b6c0895 Implement/stub cellSysutilGetBgmPlaybackStatus 2014-04-04 00:28:00 -07:00
Nekotekina 24eb97f287 AudioDumper: 8ch output 2014-04-04 00:46:40 +04:00
Nekotekina fb9dbfab3a Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-04-03 16:11:56 +04:00
Nekotekina 1e02598903 cellSync: global mutex avoided
cellAudio: level bug fixed
2014-04-03 15:01:14 +04:00
Alexandro Sánchez Bach 7093852fa0 lv2 sc_table edited & FP recompiler ddx/ddy fix
* Replaced ddx/ddy with dFdx/dFdy in FP recompiler.
* SysCalls table edited. It should now be easier to read / edit. Tell me
if you disagree with this.
2014-04-03 04:20:12 +02:00
Alexandro Sánchez Bach 01b5681dc8 Merge pull request #165 from lioncash/misc
Add a parameter check to some Gif/Jpg/Png decoding syscalls
2014-04-03 04:06:51 +02:00
Lioncash 9d0dd4c7cf Add a parameter check to some Gif/Jpg/Png decoding syscalls 2014-04-02 22:02:43 -04:00
Alexandro Sánchez Bach 262607c83d Merge pull request #164 from lioncash/stubs
Stub some sceNp funcs
2014-04-03 02:55:44 +02:00
Lioncash 2a83af6dbf Stub some sceNp funcs 2014-04-02 19:32:07 -04:00
Alexandro Sánchez Bach 91958ce1cb Merge pull request #162 from lioncash/build-fix
Fix the build.
2014-04-02 21:02:41 +02:00
Lioncash 1aff35f669 Fix the build. 2014-04-02 14:42:25 -04:00
Lioncash bb40c0a71a Reorganize the VS project.
Puts all the headers with the corresponding cpp file instead of having every include in a single folder.

Also added headers that weren't included previously.
2014-04-02 14:30:30 -04:00
Alexandro Sánchez Bach fc9a90e220 Merge pull request #160 from Bigpet/master
Gui logging in main thread
2014-04-02 19:58:34 +02:00
Alexandro Sánchez Bach 2c2ee023b5 Merge pull request #159 from lioncash/vector
Move most of PPUProgramCompiler over to vector
2014-04-02 19:57:02 +02:00
Alexandro Sánchez Bach 81cdaa883a cellPngDec fixes and some rewritings
* This commit solves the cellPngDec GetMemFromAddr(0x0) error when
loading PNGs from files.
* cellVideoOutGetResolution, cellRtc* syscalls rewritten to use the use
the mem*_t data types.
* Replaced int/uint with s32/u32 in some syscall arguments and structs.
2014-04-02 19:53:44 +02:00
Peter Tissen dad82aa1eb Gui logging in main thread
Do the logging to the GUI log element in the main thread. Not doing this
causes issues with the GTK backend of wxWidgets. Plus it's just common
sense to try to limit gui calls to one thread.
2014-04-02 17:57:50 +02:00
Nekotekina b6d8f1e028 Small fix (cellAudio, fsAioRead)
libsynth2 draft
2014-04-02 19:17:43 +04:00
Lioncash 990fca3e7b Minor simplifications to PPUProgramCompiler 2014-04-02 10:21:16 -04:00
Lioncash b3e0441940 Move PPUProgramCompiler to vector 2014-04-02 09:58:47 -04:00
Nekotekina e2e8980194 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-04-02 12:37:03 +04:00
Alexandro Sánchez Bach c294f5318f Merge pull request #157 from Dante38490/patch-4
Update rpcs3.sln on VS 2013
2014-04-01 23:31:10 +02:00
Dante38490 d1219b0dc8 Update rpcs3.sln 2014-04-01 22:05:54 +02:00
Nekotekina d2ca1cc25a Audio sync fix
Libmixer: SSPlayer draft
Detection fixed
Macros for function substitute registration
2014-04-02 00:04:56 +04:00
Alexandro Sánchez Bach 4857e86cdc Merge pull request #156 from Bigpet/wxString_exorcism
Fix static placeholder test.
2014-04-01 20:30:44 +02:00
Peter Tissen 748aa6fce8 fix indentation 2014-04-01 20:27:58 +02:00
Peter Tissen 373ae6b107 remove dummy alias in strfmt. Fix some wxString remnants, that only make problems in Linux 2014-04-01 20:13:22 +02:00
Peter Tissen 69352206b6 blantant test code removal well this is embarassing, VS didn't recompile it, so I didn't notice the mistake 2014-04-01 19:44:38 +02:00
Alexandro Sánchez Bach 2ab8aa173d Merge pull request #155 from Bigpet/wxString_exorcism
Wx string exorcism fixups
2014-04-01 19:40:28 +02:00
Peter Tissen 02729695ff remove some wxString references I missed 2014-04-01 19:25:22 +02:00
Peter Tissen bcb9ad94c1 correct some merge error that happened from automatic git merging 2014-04-01 19:19:51 +02:00
Alexandro Sánchez Bach bc095322c3 Merge pull request #153 from Bigpet/wxString_exorcism
wxString exorcism
2014-04-01 18:25:33 +02:00
Peter Tissen febe8624bf remove redundant c_str -> string -> c_str conversions 2014-04-01 17:22:57 +02:00
Peter Tissen 8ac226ae69 replace all instances of wxString with std::string in all cases not
directly involved in either the GUI or other wxWidget classes like wxFile
2014-04-01 16:23:03 +02:00
Nekotekina 7c79631609 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-04-01 12:19:32 +04:00
Alexandro Sánchez Bach fa4473de49 Merge pull request #147 from lioncash/mem-leaks
Fix some memleaks in unedat.cpp
2014-03-31 21:41:24 +02:00
Alexandro Sánchez Bach a09ad031ec cellSaveData* (cellSysutil) improvements
* cellSaveData improvements: cellSaveDataListLoad2 should work perfectly
(ignoring the fact that there is no dialog, and the first entry is
chosen automatically). cellSaveDataListSave2 has improved too. Some code
refactoring is required though.
* Reverted (deleted) Emu/SysCalls/Dialogs/ folder which I accidentally
included while merging Nekotekina's branch (including minor SaveData
changes).
* Modified some small things in cellGcmSys.
2014-03-31 20:30:07 +02:00
Peter Tissen b1894ac6cb fix implicit conversion error 2014-03-31 17:35:05 +02:00
Peter Tissen 8a000940da upgrade to VS2013 to use variadic templates for type safe printing 2014-03-31 17:35:04 +02:00
Nekotekina 24becb9325 Conflicts fixed 2014-03-31 18:38:21 +04:00
lioncash c4b64c8d9f Fix variable typos in unedat.cpp
Also fixed possible uninitialized variable usage. Initializes length to zero.
2014-03-31 08:59:52 -04:00
lioncash e47e37a8d2 Fix some memory leaks in unedat.cpp. 2014-03-31 08:56:24 -04:00
Alexandro Sánchez Bach 01dbb8eb9a Merge pull request #145 from Nekotekina/master
Fixed conflicts.
2014-03-31 12:04:34 +02:00
Alexandro Sánchez Bach 8011cc8ec4 Merge pull request #146 from darkf/stuff
Add FindGLEW to CMake build and fix naming error
2014-03-31 11:23:17 +02:00
Alexandro Sánchez Bach 66ec7c0d63 Merge pull request #144 from acmiyaguchi/gcm
Reorganize cellGcmSys module
2014-03-31 11:18:40 +02:00
darkf 61d0e4ee54 Rename xor to xor_ to allow build to continue in compliant compilers 2014-03-31 00:55:27 -07:00
darkf 8007693084 Add FindGLEW to CMake modules along with some compiler flags 2014-03-31 00:00:30 -07:00
Nekotekina 9afbbfad0a Little fix 2014-03-31 10:19:51 +04:00
Anthony Miyaguchi 2106fb83b2 Added cellGcmSetUserHandler that already existed but was never added. 2014-03-30 18:01:51 -07:00
Anthony Miyaguchi b571f14fe4 Function declaration at top needed for another function. 2014-03-30 17:56:03 -07:00
Anthony Miyaguchi eab81deb27 Reordered functions for organization. 2014-03-30 17:54:57 -07:00
Anthony Miyaguchi a62552b086 Organized the cellGcmSys_init() functions in a more sane manner. 2014-03-30 17:54:34 -07:00
Nekotekina 2d955dc297 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-31 00:43:44 +04:00
Hykem 196c2ffe5b Updated the crypto engine:
- Updated AES and SHA-1 source code;
- Fixed a few code warnings;
- Implemented EDAT/SDAT decryption.

Started SPURS implementation:
- Added an internal SPURSManager class draft;
- Added several drafts for cellSpurs functions.

Implemented key.edat decryption in sceNpDrmIsAvailable:
- NOTE: Currently, the decrypted key.edat is stored under dev_hdd1/titleID and the user must replace this file in dev_hdd0. This behavior will change in the future as it's currently intended for controlled testing only.
2014-03-30 21:09:49 +01:00
Nekotekina 9e2561d121 Downmixing/upmixing 2014-03-30 22:53:43 +04:00
Nekotekina fce074d812 Audio mixing fixed
Libmixer reseen
Some bugs fixed
2014-03-30 15:59:55 +04:00
Alexandro Sánchez Bach e6aa1a9553 Merge pull request #142 from lioncash/hdd
Misc HDD stuff
2014-03-30 12:23:47 +02:00
Lioncash b9de74f5c6 Move VHDDManager over to using vector. Also fix some variable and function name typos. 2014-03-30 00:13:00 -04:00
Lioncash 479ef45aec Fix a case where m_hdd_file is passed to m_file uninitialized.
Due to the way initializations work in C++, despite the order of the initializations in the initialization list, it will actually do the initializing in the order the class variables are defined.
2014-03-30 00:08:16 -04:00
Alexandro Sánchez Bach ae5d06d4be Merge pull request #141 from lioncash/bounds
Memset the ringbuffer in m_fs_config by the size of the actual ringbuffer struct, not FsRingBufferConfig's size..
2014-03-30 00:18:02 +01:00
Alexandro Sánchez Bach 3e328cdea5 Merge pull request #140 from lioncash/misc-things
Fix missing unary increment operator in DisAsmFrame
2014-03-30 00:15:47 +01:00
Lioncash 12b627fa9c Memset the ringbuffer in m_fs_config by the size of the actual ringbuffer struct, not FsRingBufferConfig. 2014-03-29 16:28:39 -04:00
Lioncash d6bcf14cc0 Fix missing unary increment operator in DisAsmFrame 2014-03-29 16:13:05 -04:00
Nekotekina 72bb0c842f Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-29 20:49:43 +04:00
Alexandro Sánchez Bach 7804c56584 Merge pull request #138 from bagedevimo/nix-fix
More *nix fixes.
2014-03-29 16:26:08 +01:00
Ben Anderson 33f7f37ca7 Fixes null ptr in gcc, probably to do with operator precedence. @Bigpet was all over this one. 2014-03-30 03:21:41 +13:00
Ben Anderson 84c9323750 Fixes GL fix, which was broken. Added -g flag to cmake, so we can have debug builds. 2014-03-30 03:15:46 +13:00
Alexandro Sánchez Bach 4c6aa34810 Merge pull request #135 from bagedevimo/path-fix
Nix Path fix.
2014-03-29 09:50:26 +01:00
Ben Anderson e24027eccb Added call to GlewInit() under *nix, should fix cairo display crashes. 2014-03-29 21:11:43 +13:00
Nekotekina 98024cbb01 Conflicts fixed 2014-03-29 12:04:38 +04:00
Ben Anderson b317b2feda Commenting out all of this, should fix the pathing glitches on *nix, without breaking windows functionality. 2014-03-29 20:52:39 +13:00
Alexandro Sánchez Bach a7fbd5c9b6 Merge pull request #133 from bagedevimo/fix
Fixes invalid conversion from wxStringConst, to std::string under gcc-4-8
2014-03-29 07:05:57 +01:00
Ben Anderson 6141c33630 Fixes invalid conversion from wxStringConst, to std::string under gcc-4.8 2014-03-29 13:52:27 +13:00
Nekotekina 689c41ccb3 Minor fixes
Libmixer: additional patterns
2014-03-29 02:50:05 +04:00
Alexandro Sánchez Bach 503c24453a cellSaveData* progress & reverted commit 950fcfe
* Reverted commit
https://github.com/DHrpcs3/rpcs3/commit/950fcfe4ef6da8aad5198fc12b029862545cfc4e
(Reverted ConLog changes) that fixed the "Bad flip!" error since there
is a better way of solving it. It will be fixed soon.
* Moved cellSaveData to cellSysutil (but preserving the functions in a
separated file named: cellSysutil_SaveData.cpp).
* Progress on cellSaveDataList* functions.
* Added a small margin to the new Settings dialog. :-)
2014-03-28 20:06:15 +01:00
Alexandro Sánchez Bach 64b80f5a2e Merge pull request #132 from O1L/master
GUI: Config -> Settings menu reworked.
2014-03-28 19:37:32 +01:00
O1L 1be14f818a GUI: some changes in Config -> Settings 2014-03-28 21:17:44 +04:00
Alexandro Sánchez Bach 5bf70afb21 Merge pull request #131 from bagedevimo/x11
Fixes X11 threading issue, under Linux
2014-03-28 13:03:54 +01:00
Ben Anderson b36a5a95f0 x11 fix 2014-03-29 00:33:51 +13:00
Nekotekina 70cc2494aa bad_flip issue fix 2014-03-28 12:47:32 +04:00
Hykem 98b4a35fb5 Merge pull request #130 from nohbdy/bugfix
Minor code and memory initialization fixes
2014-03-28 04:53:28 +00:00
Hykem e03b68f12f Merge pull request #129 from acmiyaguchi/master
Fix a hang after failing to run an *.elf file and stopping emulator
2014-03-28 04:52:51 +00:00
Alexandro Sánchez Bach 950fcfe4ef Reverted ConLog changes of commit 5ea58d94
This was causing a "Bad flip!" error on Arkedo Series 02 Swap!. I guess
we will have to search for a better solution. I just reverted the
ConLog.cpp / ConLog.h files.

Related commit:
https://github.com/DHrpcs3/rpcs3/commit/5ea58d9451c2af7884bb5d1fd74e47d0bcc5770a
2014-03-28 05:32:24 +01:00
Alexandro Sánchez Bach 2c7269e3de PSF Loader improved & issue #126 fixed
* Improved PSF Loader: Now you can get the value of the PARAM.SFO
entries directly with the GetString(key), GetInteger(key) methods.
GameInfo related lines were removed since they have nothing to do with
PSF files.
* cellGame, cellSysutil, and GameViewer are modified because of the PSF
Loader changes.
* Removed unnecessary null pointer checks:
https://github.com/DHrpcs3/rpcs3/issues/126
2014-03-28 05:20:13 +01:00
nohbdy d533572ee9 Minor code and memory initialization fixes
* Explicitly initialize member variables in SELFDecrypter, MemInfo, and
VirtualMemoryBlock
* Zero out memory used for counter/nonce in aes-ctr
* Fix use of a ControlInfo pointer after it is added to an Array via
Array::Move (which makes it an invalid pointer) in
SELFDecrypter::LoadHeaders
2014-03-27 22:16:14 -05:00
Anthony Miyaguchi 544bacf54e Quick one line change fixes a hang after failing to run an *.elf file and stopping the emulator via the Stop button. 2014-03-27 18:57:28 -07:00
Alexandro Sánchez Bach 64145d7d62 Merge pull request #124 from xsacha/master
Linux build fix
2014-03-27 23:17:59 +01:00
Alexandro Sánchez Bach 1fd42c34c2 Minor fixes
* Modified some .gitignore's
* Removed some #include <vector>'s
and other stuff...
2014-03-27 16:40:58 +01:00
Alexandro Sánchez Bach c541176a32 Merge pull request #125 from lioncash/ui
Simplify some VFS-related code.
2014-03-27 16:08:04 +01:00
Alexandro Sánchez Bach 7d3414c44c Merge pull request #127 from lioncash/misc-things
Minor logging changes.
2014-03-27 16:03:38 +01:00
lioncash a5f35cc437 Fix a typo in a log message
Also moved a logging statement after an if statement check. We don't want to signify creation of something before checking its validity.
2014-03-27 09:23:32 -04:00
lioncash 7f5412f427 Make a some printfs into error log calls. 2014-03-27 09:22:56 -04:00
lioncash 007f0f2437 More specific log message for adecRawRead.
Was previously logging as adecRead.
2014-03-27 07:36:24 -04:00
Lioncash 8e44bcdbda Simplify some VFS-related code. 2014-03-27 02:49:02 -04:00
Sacha 9b0bcf0b54 Linux build fix 2014-03-27 11:12:45 +10:00
Hykem 457455b71d Merge pull request #121 from lioncash/stack
Use Push instead of AddCpy in CallStackBranch.
2014-03-27 00:12:04 +00:00
Hykem f399ce68a2 Merge pull request #122 from lioncash/misc-things
Remove an unnecessary c_str call.
2014-03-27 00:11:47 +00:00
Lioncash 2185465d34 Remove an unnecessary c_str call. 2014-03-26 19:54:09 -04:00
Lioncash a7bc2034d0 Use Push instead of AddCpy in CallStackBranch. 2014-03-26 19:25:12 -04:00
Nekotekina 994ce50392 Experimental libmixer
adec, vdec improved
fixed sound
2014-03-27 02:45:58 +04:00
Nekotekina 79c01316d6 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-26 16:00:58 +04:00
Alexandro Sánchez Bach c57d3af8dd Merge pull request #120 from xsacha/master
Linux build fix
2014-03-26 10:02:03 +01:00
Sacha ebc6b9e66e Fix an assign. Some other misc changes. 2014-03-26 10:29:17 +10:00
Sacha 3e9cbb4a24 Linux build fix. 2014-03-26 10:23:06 +10:00
Nekotekina 7f7a23027b Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-26 02:26:11 +04:00
Nekotekina 8a54f542d0 Reservation improved 2014-03-25 17:05:07 +04:00
Alexandro Sánchez Bach 31e1464e1a Merge pull request #117 from lioncash/const-references
Use const references for the string keys in Ini.cpp/.h
2014-03-25 02:11:56 +01:00
Alexandro Sánchez Bach 621edfb926 Merge pull request #118 from lioncash/misc-things
Fix erroneous assignment in an if statement.
2014-03-25 02:09:11 +01:00
Lioncash a5d9c9033f Fix erroneous assignment in an if statement.
Should have been a comparison.
2014-03-24 20:08:33 -04:00
Lioncash b8d3ce7ae8 Use const references for the string keys in Ini.cpp/.h 2014-03-24 19:53:14 -04:00
Nekotekina 21d19ccd59 Small RSX fix 2014-03-24 21:51:20 +04:00
Nekotekina 9b1c0c97d3 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-24 19:28:28 +04:00
Alexandro Sánchez Bach 0ef0cfb38a Merge pull request #114 from lioncash/misc-things
Misc things
2014-03-24 15:32:16 +01:00
lioncash 90b83f6b3e Fix a missing return in an if statement in sceNpTrophyCreateContext. 2014-03-24 09:40:25 -04:00
lioncash 6841230141 Fix erroneous duplicate condition check in cellSpursGetTasksetId. 2014-03-24 09:40:02 -04:00
lioncash 8302e6c001 Fix case where UTF16stoUTF8s in cellL10n.cpp would always fail out if compiled with Visual Studio. 2014-03-24 09:21:17 -04:00
lioncash 4db1f49aaf Remove redundant assignment in RSXThread.
This is assigned the same value further down the function.
2014-03-24 08:53:34 -04:00
lioncash c00850c4c5 Minor const correctness 2014-03-24 08:47:30 -04:00
lioncash 874da27599 Initialize strings through the initializer list in PPUProgramCompiler.h 2014-03-24 08:40:35 -04:00
Hykem ea34cb52c1 Merge pull request #112 from Dante38490/patch-1
Update git-version-gen.cmd
2014-03-23 20:49:05 +00:00
Nekotekina 7bab42455b Minor fixes
cellAtrac faked
2014-03-23 23:43:37 +04:00
B1ackDaemon d1ffea0847 Merge pull request #113 from Nekotekina/master
Playable video
2014-03-22 23:09:00 +02:00
Nekotekina be80a7c39c SC_Lwcond fixed 2014-03-23 01:04:55 +04:00
Nekotekina d0ea397492 cellAtrac draft
sys_spu_thread_group_resume
Some bugs fixed
2014-03-22 15:08:07 +04:00
Dante38490 3701b2b551 Update git-version-gen.cmd
little change add adress website officiel
2014-03-22 11:45:59 +01:00
Nekotekina 169fcd098b Demuxer improvement 2014-03-22 05:08:25 +04:00
Nekotekina 5ea58d9451 ConLog unicode support improved 2014-03-21 19:06:08 +04:00
Nekotekina 39d1e21802 Fix slashes for Windows :p 2014-03-21 13:45:26 +04:00
Nekotekina cad7a05848 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-21 13:02:10 +04:00
Alexandro Sánchez Bach ad7ac17647 Small fixes in sceNpTrophy and cellSaveData
* Added cellSaveData.cpp to the project.
* Fixed wrong cellSaveData structs.
* Fixed compilation problem caused by the switch/case statements
introduced in sceNpTrophy and TROPUSR.cpp in the last commit
2014-03-21 00:46:27 +01:00
Alexandro Sánchez Bach f86ac251a8 TROPUSR Loader & sceNpTrophy stuff
* Added a loader for the TROPUSR.DAT files.
* Added a few structs/enums to sceNpTrophy.h
* Added more sceNpTrophy functions and updated other ones.
* Updated cellHddGame error codes in cellSysutil.h
* Added addresses of cellHddGame to cellSysutil_init.

NOTE:  There is a known problem in the `if
(!Emu.GetVFS().ExistsFile(filepath))` in `TROPUSRLoader::Load` which
causes the games to overwrite their TROPUSR.DAT file every time they
boot and they "forget" the unlocked trophies. However, as long as the
game is running the unlocked trophies should be still there.
2014-03-20 19:23:14 +01:00
Alexandro Sánchez Bach 834700eb24 Merge pull request #110 from Bigpet/master
stswi and lswi instructions
2014-03-20 02:56:56 +01:00
Peter Tissen f0e73a652f stswi and lswi instructions 2014-03-20 02:48:02 +01:00
Alexandro Sánchez Bach f0129382b9 Merge pull request #109 from Bigpet/master
Missed carry flag corrections and the rotate fixes
2014-03-20 01:03:59 +01:00
Peter Tissen 6e4203998a Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-20 00:51:58 +01:00
Alexandro Sánchez Bach cd4f0b2c68 Merge pull request #108 from Bigpet/master
added SUBFME, SUBFZE and fix cache folder creation
2014-03-20 00:10:12 +01:00
Nekotekina 87e016bdf0 RLWIMI, RLWINM and RLWNM fixed 2014-03-19 23:40:52 +01:00
Peter Tissen 5a1ce28105 fix carry errors 2014-03-19 23:40:49 +01:00
Peter Tissen acf955635f correct the subtraction instructions and try something more sensible for overflow detection 2014-03-19 18:13:52 +01:00
Alexandro Sánchez Bach 8c2aee5e64 cellHddGameCheck and some fixes
* Fixed wrong endianness in several structs.
* Fixed CreateFile-related bug in TRP Loader.
* Added cellHddGame (cellSysutil) structs and cellHddGameCheck.
2014-03-19 16:19:35 +01:00
Nekotekina a520934abd RLWIMI, RLWINM and RLWNM fixed 2014-03-19 18:47:28 +04:00
Peter Tissen 27bb41d652 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-19 14:38:42 +01:00
Nekotekina 38bfbe2c40 Audio decoding 2014-03-19 04:32:23 +04:00
Peter Tissen 2ddee26d83 add experimental subfme and subfze support and fix cache folder creation 2014-03-18 23:58:42 +01:00
Alexandro Sánchez Bach 37f7a31a22 Another small fix related with TextureBorderColor
TODO: Find an appropriate place for setting the GL_TEXTURE_BORDER_COLOR
parameter.
2014-03-18 18:27:11 +01:00
Alexandro Sánchez Bach 2601933bdc TextureBorderColor & cellFont problems fixed
* Fixed tabs/spaces problem in cellSysutil.h too.

NOTE: The problem with cellFont (crash on line 604) has been fixed, but
for a high price: There is now a huge memory leak when a NULL pointer is
passed to cellFontRenderSurfaceInit.
2014-03-18 17:45:26 +01:00
Alexandro Sánchez Bach fb38897b8f Merge pull request #105 from kacek/master
implemented  cellGcmsetTexture_BorderColor function
2014-03-18 13:00:35 +01:00
kacek 39dc6f0838 cellGcmSetTexture_BorderColor fix 2014-03-18 07:20:59 +01:00
kacek 4b14c72ed8 implemented cellGcmsetTexture_BorderColor function 2014-03-18 01:03:26 +01:00
Alexandro Sánchez Bach cf4501fe41 cellGame, cellSysutil and TRP installer improved
* TRP Loader and sceNpTrophyRegisterContext improved.
* cellSysutil constants moved to cellSysutil.h
* cellGameBootCheck bug fixed that makes size->hddFreeSizeKB be 0.
* Added system language selector (this is *not* RPCS3's language).
cellSysutilGetSystemParamInt(0x111) will return the selected language.

NOTE: The problems caused by the last commit (pull request #104 merged)
are not yet fixed.
2014-03-17 20:34:19 +01:00
Alexandro Sánchez Bach 9786c036d5 Merge pull request #104 from xsacha/master
Fix some strings for Linux
2014-03-17 18:13:10 +01:00
Nekotekina c4d9223034 event flag improvement (not finished)
Fixed empty SPU thread name issue
2014-03-17 19:07:47 +04:00
Sacha 6968137bbc Fix slashes for Linux 2014-03-17 23:41:15 +10:00
Nekotekina 475c3ff967 Merge https://github.com/elisha464/rpcs3 2014-03-17 13:17:12 +04:00
Nekotekina 4cbe3a2a46 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-17 13:16:43 +04:00
Nekotekina 1a1bed2258 Event flag partial implementation 2014-03-17 00:14:46 +04:00
Alexandro Sánchez Bach 39a717b239 Merge pull request #103 from xsacha/master
Linux build fix
2014-03-16 16:15:41 +01:00
Sacha a00f47b5e4 Linux build fix 2014-03-16 22:49:05 +10:00
Nekotekina 4aa6ddf3dd Weird MFC_PUTR_CMD handling 2014-03-16 01:33:19 +04:00
Nekotekina c9a421f12f SPU Thread Group-specific MMIO
LS access, SNR writing
2014-03-16 00:46:53 +04:00
Hykem 0a35c4f2c4 Added missing change. 2014-03-15 20:37:29 +00:00
Hykem c4a9c874d1 Improved FRES and FRSQRTE results (tested with ppu_fpu).
Implemented and improved several SC_Memory syscalls.

Started working in sceNp module.
2014-03-15 19:45:43 +00:00
B1ackDaemon 65eb873597 Merge pull request #102 from Nekotekina/master
Different changes
2014-03-15 18:03:55 +02:00
Nekotekina 60d922da11 DMA List commands
cellAudio: multiple queue support
sys_cond simplified
cellFsMkdir (?)
2014-03-15 19:43:14 +04:00
Nekotekina 024aa0660c Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-15 03:15:18 +04:00
Alexandro Sánchez Bach 6c4a980d36 Minor changes
* Fixed identation
* Make some parts of the code more readable.
2014-03-14 18:12:12 +01:00
Alexandro Sánchez Bach 48abfdfbb1 Merge pull request #101 from O1L/master
Minor changes.
2014-03-14 15:05:53 +01:00
O1L b0f6b03c38 Fixed crash on using NUll Audio Output, fixed possible crash in OpenAL exit and minor changes in cellAudioEventQueue functions. 2014-03-14 17:53:37 +03:00
O1L 50d49141b0 Conflicts fixed. 2014-03-14 16:50:50 +03:00
Nekotekina 2c447f686d sys_spinlock implemented 2014-03-13 20:11:16 +04:00
Nekotekina 2de22f0321 Fixed conflicts 2014-03-13 13:18:47 +04:00
Nekotekina 8cc6a287a7 Update 2014-03-13 13:17:45 +04:00
DH 0e437312ad Improved OpenAL audio output
Implemented LDBRX PPU instruction
Enabled FRSQRTE PPU instruction
Improved Fragment Program Decompiler
Implemented Log lvl selection
2014-03-13 02:26:53 +02:00
Alexandro Sánchez Bach 80cfb2eb58 cellGame functions & MULHD(U) warn. disabled 2014-03-12 23:34:35 +01:00
Alexandro Sánchez Bach fb1b57720c Merge pull request #100 from O1L/master 2014-03-11 20:14:39 +01:00
elisha464 62f9d454eb Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-11 21:00:21 +02:00
elisha464 c08c5eef10 disabled a few stuff and changed color to white before rendering to main window (fix fw_stencil_reflect) 2014-03-11 20:52:14 +02:00
Alexandro Sánchez Bach 5c563d04c7 Merge pull request #99 from xsacha/master
Linux build fix
2014-03-11 19:29:28 +01:00
elisha464 9194b73a81 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-11 19:57:31 +02:00
O1L a31160fe99 Fix converting audio data. Implemented some cellFsStRead functions. 2014-03-11 20:45:15 +03:00
Alexandro Sánchez Bach b31a990cf1 cellUserInfo module added & cellFsReadWithOffset 2014-03-11 18:40:37 +01:00
Sacha 5f3f7e197a Linux build fix. 2014-03-12 02:36:58 +10:00
Nekotekina b7b33145f6 Compilation fix 2014-03-12 02:36:58 +10:00
Nekotekina 7f7d5a57c8 rldcr, rldcl instructions
Some intructions fixed
2014-03-11 20:20:01 +04:00
Alexandro Sánchez Bach d5e94d4cd9 Some sys_net functions
* sys_net; Added some functions using winsock.h | sys/socket.h
* sys_net: Renamed overloaded function/structs "*" to "sys_net_*"
* Added SetAddr function to mem_base_t
2014-03-11 15:42:28 +01:00
Nekotekina 7984df37c3 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-10 20:24:15 +04:00
DHrpcs3 d90d2f2df7 Merge pull request #98 from lioncash/out-of-bounds-fix
Fix a case where an array is read out of bounds in cellSpurs.cpp
2014-03-10 16:11:46 +02:00
Lioncash 1aa6e5df95 Fix a case where an array is read out of bounds in cellSpurs.cpp 2014-03-10 03:28:17 -04:00
Nekotekina a33575b115 Compilation fix 2014-03-10 03:07:53 +04:00
Alexandro Sánchez Bach b46cb71324 Merge pull request #97 from xsacha/master
Fix slashes in OpenAL includes
2014-03-09 17:37:41 +01:00
Sacha bde5c9cfed Fix slashes in OpenAL includes 2014-03-10 00:44:12 +10:00
Alexandro Sánchez Bach 8461bee32e Updates in cellL10n and sceNpTrophy
* UTF16stoUTF8s updated.
* Added missing return in sceNpTrophyRegisterContext.
* Added sceNpTrophyGetGameInfo.
2014-03-09 04:57:19 +01:00
Alexandro Sánchez Bach 2f65e84562 Merge pull request #94 from Nekotekina/master
Different changes
2014-03-08 00:20:43 +01:00
Nekotekina 75f535c947 Conflicts fixed 2014-03-08 03:02:59 +04:00
Hykem fdf935afe9 Merge pull request #93 from O1L/master
Implemented OpenAL audio output.
2014-03-07 22:46:55 +00:00
O1L df894c05b2 Implemented simple OpenAL audio output. Structures and enum's from cellAudio.cpp moved to cellAudio.h . Audio dump functions moved in AudioDumper class. 2014-03-08 02:15:39 +03:00
Nekotekina 1c302433af cellSpurs draft added 2014-03-08 01:31:08 +04:00
Nekotekina 3a00ec7682 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-07 16:04:14 +04:00
Nekotekina 3127543b6e sys_ppu_thread_join, sys_ppu_thread_exit fixed
Some diagnostic messages in mutexes
2014-03-07 16:03:42 +04:00
elisha464 0edd70d3d8 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-07 09:10:29 +02:00
Alexandro Sánchez Bach 4af648905c Merge pull request #91 from Bigpet/master
respect the outputBytesPerLine parameter
2014-03-07 04:23:08 +01:00
Peter Tissen 3871134a49 respect the outputBytesPerLine parameter if it's longer than the natural length of the PNG file 2014-03-07 04:15:56 +01:00
elisha464 e32a6a2eea Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-06 19:46:23 +02:00
Alexandro Sánchez Bach 898fbf02b8 Fixes in sceNpTrophy and FSEL (PPU instr.) 2014-03-06 13:27:58 +01:00
Nekotekina fac86aae58 Conflicts fixed (again) 2014-03-06 15:55:50 +04:00
Nekotekina 05c6a96d27 Conflicts fixed 2014-03-06 15:50:45 +04:00
Nekotekina e86a849600 libmixer draft
and some hacks
2014-03-06 15:40:50 +04:00
Alexandro Sánchez Bach d6596ca453 Progress in cellL10n
* cellL10n added to the project.
* Function addresses added to cellL10n_init.
* UTF16stoUTF8s implemented (WARNING: I haven't tested it).
2014-03-06 09:48:35 +01:00
Alexandro Sánchez Bach 39d3814be7 Changes in cellRtc & sceNpTrophy
* Two header files added: cellRtc.h and sceNpTrophy.h
* Changes in sceNpTrophyCreateContext.
* Implemented sceNpTrophyGetTrophyInfo.
2014-03-06 01:52:23 +01:00
Nekotekina 384536ba4f prx_mem memory leak fixed
CPUThread::ExecAsCallback (experimental)
2014-03-04 23:18:17 +04:00
Alexandro Sánchez Bach 8204deaae6 Minor changes
* Fixed some forgotten `!` in cellFsGetFreeSize.
* Fixed VSUM2SWS opcode.
* Added cellNetCtl to the project.
* Implemented cellNetCtlGetState.
2014-03-04 15:40:15 +01:00
Alexandro Sánchez Bach bc77f27bb2 Merge pull request #90 from Aishou/master
Linux compilation fixes
2014-03-04 15:18:12 +01:00
Aishou d32025ae3c more fixes... 2014-03-04 09:37:28 +01:00
Nekotekina b32a8e2e28 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-04 03:36:45 +04:00
Nekotekina 8a4c67deab It can play video, but it can't
I don't know how to disable aggressive data caching that occures in
vdecRead(). Also ReleaseAu function is disabled because it breaks
everything.
2014-03-04 03:21:34 +04:00
elisha464 11571cf2a4 fix memory alignment
added eaIOMap with flags (draft)
changed gcmInit to throw an error when not being able to map to io address
2014-03-03 22:45:27 +02:00
Aishou 354cf24302 fix gcc compile... 2014-03-03 14:51:54 +01:00
Aishou bd45704c83 merge branch 'master' of https://github.com/DHrpcs3/rpcs3 into crypto 2014-03-03 14:42:21 +01:00
Alexandro Sánchez Bach 05db17b2b0 Fixed x64 compilation errors & cellFsGetFreeSize 2014-03-03 14:16:42 +01:00
Aishou caa797cee3 not sure about it.. but compiles.. 2014-03-03 12:05:15 +01:00
Aishou 85626024a0 fix gcc complain about non-const reference... 2014-03-03 11:44:00 +01:00
Hykem 4770e5af08 Fixed AboutDialog (changed in last commit). 2014-03-03 04:59:22 +00:00
Hykem a1adc6cdaa First installment of RPCS3's custom crypto engine:
- Removed all scetool dependencies;
- Implemented a key vault to manage PS3 keys internally;
- Implemented SELF decryption;
- Improved PKG handling.

Notes:
- NPDRM SELF files (EBOOT.BIN) can also be decrypted. A valid matching RAP file must be placed under the dev_usb000 folder.
- The source code is considerably commented and several debugging functions were also added in order to aid anyone who wishes to contribute to the engine.
2014-03-03 04:48:07 +00:00
Nekotekina c064c701e2 cellAdec draft 2014-03-03 03:02:42 +04:00
Alexandro Sánchez Bach 6fcead2a0e Merge pull request #89 from Nekotekina/master
...
2014-03-02 14:37:06 +01:00
Aishou 851acfdbf3 add ffmpeg to link.. 2014-03-02 13:00:57 +01:00
Aishou bea8be29d5 get ffmpeg working with cmake.. 2014-03-02 12:55:20 +01:00
Aishou 7a1d44b552 Merge https://github.com/Nekotekina/rpcs3 2014-03-02 11:57:17 +01:00
Aishou b4712c0dca Merge remote-tracking branch 'upstream/master' 2014-03-02 11:50:07 +01:00
Nekotekina c978fe377d Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-02 10:24:18 +04:00
Nekotekina 9e62b330b1 I cannot do anything 2014-03-02 03:50:47 +04:00
Alexandro Sánchez Bach 1e53c7f244 Reverted 'Unimpl.' warning on some SPU instr.
I'm sorry. I deserve punishment and torture for this.
2014-03-01 20:29:26 +01:00
Aishou e0d3f1cae6 Merge remote-tracking branch 'upstream/master' 2014-03-01 19:59:36 +01:00
Alexandro Sánchez Bach 6c28753dae Minor fixes: SPU, sys_mmapper, and cmd-line args.
* Some SPU instructions updated:
- Updated wrong instructions: SHLH, FRDS
- Added UNIMPLEMENTED warning to: HBR, HBRA, HBRR
* Updated sys_mmapper_allocate_memory declaration in SysCalls.h
* Added sceNp.cpp to project
* Added checkbox in the Settings menu for exiting RPCS3 when
sys_process_exit (SC_Process.cpp) is called. Unfortunately, due to some
problems, this checkbox doesn't have a real effect yet.
2014-03-01 19:33:40 +01:00
Alexandro Sánchez Bach 7f7ad1b661 Few functions added
* sceNpManagerGetStatus
* sys_mmapper_free_memory
* Minor changes in sys_mmapper_allocate_memory
* Changed the layout of the sys_vm functions in SysCalls.cpp
2014-03-01 19:33:39 +01:00
Alexandro Sánchez Bach cd10dca71f RPCS3 arguments, TTY to file & sceNpTrophy stuff 2014-03-01 19:33:38 +01:00
Aishou d418cceae4 fix the typo. 2014-03-01 15:32:15 +01:00
Nekotekina 4828723d5c Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-03-01 12:39:42 +04:00
Nekotekina 17fa60c31c Vpost draft 2014-03-01 12:38:50 +04:00
Aishou fd564159b5 gcc.. 2014-02-28 20:21:52 +01:00
Aishou 377db4515a Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
Conflicts:
	Utilities/BEType.h
2014-02-28 19:55:48 +01:00
Alexandro Sánchez Bach 6a15351363 Merge pull request #88 from Bigpet/master
fix small mistakes
2014-02-28 19:39:43 +01:00
Peter Tissen dbc39bce40 fix small mistakes
fix endian mistakes, mistaken word length and preprocessor mistake
2014-02-28 19:36:19 +01:00
Alexandro Sánchez Bach 38fbd190b0 Merge pull request #87 from elisha464/master
minor rsx fixes
2014-02-28 14:23:14 +01:00
Nekotekina f3a3a630c3 Merge branch 'master' of https://github.com/elisha464/rpcs3 2014-02-28 13:53:46 +04:00
elisha464 1ab5bc40a0 fixed colors on scogger 2014-02-28 11:19:56 +02:00
Nekotekina dbdae77780 Some errors fixed 2014-02-27 22:25:32 +04:00
elisha464 d0300e5f43 fix alpha test 2014-02-27 19:47:08 +02:00
elisha464 5fbc190c80 fixed flipped colors on some homebrews 2014-02-26 23:24:57 +02:00
Nekotekina 8b952bf98c memcpy partially replaced
Fixed one of exit issues
2014-02-26 18:06:13 +04:00
Aishou f85420b343 small compile fixes 2014-02-26 14:24:41 +01:00
Nekotekina 8bd0ee875c Fixed conflicts 2014-02-26 15:27:06 +04:00
Nekotekina 8048c70bc8 cond/lwcond fixed 2014-02-26 14:35:30 +04:00
Nekotekina 0bd5dc5363 Demuxer improved, cellPamf improved
File reading improved
2014-02-26 11:51:00 +04:00
Alexandro Sánchez Bach 681c3c53f0 cellPad modifications
* Using be_t on cellPad structs.
* Swapped Square and Circle default keys (they were inverted).
2014-02-25 14:09:44 +01:00
Alexandro Sánchez Bach 2827db0e2a Using be_t in some cellGcm structs & minor fixes
* Using be_t in CellGcmControl, CellGcmConfig, CellGcmContextData and
CellGcmTileInfo.
* Fixed wrong names in Emu/SysCalls/Modules/sceNp.cpp
* Fixed ConLog's mount info strings in System.cpp
2014-02-24 17:03:47 +01:00
DHrpcs3 d9d80d8fb4 Merge pull request #83 from Bigpet/master
Make buildable with GCC in Linux
2014-02-24 09:14:21 +02:00
Alexandro Sánchez Bach 7379b0e2ed Minor changes: GCM command, PKG loader & SysCalls
* Fixed incorrect time displayed on NV4097_GET_REPORT.
* Fixed small bug in PKGLoader::UnpackEntry
* Moved some code in SC_Time.cpp
* Auxiliary function declarations of SC_Time.cpp in SC_Time.h
* Updated cellFsUnlink. *This won't work until ExistsFile is fully
implemented*.
2014-02-24 07:54:42 +01:00
Peter Tissen 1908286e7c make things compile under windows again, there's still some ugly ifdefs
I'd like to get rid of
2014-02-24 01:51:55 +01:00
Nekotekina a14276abf1 Work on demuxer, ffmpeg libs linked 2014-02-24 04:00:42 +04:00
Bigpet 92fb77d50e more merge fixes, I should really compile it before submitting a pull request 2014-02-23 20:40:12 +01:00
Bigpet aef3b24c8d fix small type mismatch 2014-02-23 18:23:14 +01:00
Bigpet 1be8563fdb fix small merge mistake 2014-02-23 18:21:10 +01:00
Bigpet bebf027e0b merge newer changes 2014-02-23 18:13:08 +01:00
Bigpet 9a30ce5f18 Make buildable with GCC in Linux
* replace GetThreadID with std::this_thread.getId()
* name all anonymous structs and unions that contain non-trivially constructable objects
* made default constructor for big endian type noexcept to make it work with std::atomic
* move instantiated specialized template function members ouside of the class definition to comply with the standard
* added default instantiation for template parameter "=nullptr"
* used the C++11 standardized thread_local instead of the __declspec(thread)
* added transitional definitions to bridge the microsoft specific calls (compare and exchange and aligned alloc)
* removed cyclic dependency between Emulator->CPUThreadManager->CPUThread->SMutex->Emulator->...
* fixed some instances of indentation by space instead of tabs
* surrounded some unused code with an #if 0 block to make sure it doesn't compile
2014-02-23 17:52:52 +01:00
Alexandro Sánchez Bach 696e00a570 Merge refactoring branch & Krofna's pull req. #46 2014-02-23 02:39:46 +01:00
Nekotekina 8df7f49b55 ffmpeg submodule added 2014-02-22 21:42:23 +04:00
DH 81b19057bb Implemented audio Dump To File
Fixed MFOCRF, MTOCRF, MTCRF
Minor fixes
2014-02-22 14:06:23 +02:00
DHrpcs3 7c6c20ef18 Merge pull request #82 from Nekotekina/master
Event, audio, SPU fixes
2014-02-22 10:54:32 +02:00
DH 05184d2e71 Improved GameViewer
GameViewer use VFS.
Implemented be_t increment / decrement
Implemented se
Improved sys_fs syscalls.
2014-02-22 04:53:06 +02:00
Nekotekina b56df0c7f6 New functions
sys_spu_thread_bind_queue, sys_spu_thread_connect_event and SPU-side
sys_spu_thread_receive_event, sys_spu_thread_send_event
Fixed event system
Fixed SleepQueue priority alg
Audio: cellAudioGetPortTimestamp and cellAudioGetPortBlockTag
2014-02-22 04:26:50 +04:00
Bigpet 07135570f4 merge branch 2014-02-21 20:36:22 +01:00
Alexandro Sánchez Bach e7a721a1fb Merge pull request #46 from krofna 2014-02-21 17:13:57 +01:00
Alexandro Sánchez Bach 17b877e448 Minor changes in RSXTexture.h and PKG Loader
* Moved RSXTexture from RSXThread.h to RSXTexture.h
* Renamed RSXTexture::Getmipmap to RSXTexture::GetMipmap
* Used more GCM texture format constants in GLGSRender.h
* PKG Loader: Added an "Overwrite?" dialog in case the folder
dest+titleID (i.e. "/dev_hdd0/game/"+titleID) already exists. Note that
in that case, the game won't be installed regardless of the option you
choose on the dialog.
2014-02-21 14:21:08 +01:00
Alexandro Sánchez Bach 5f9e60c45f PKG Loader rewritten
* Rewritten unpkg.c -> Loader/PKG.cpp
* MainFrame::InstallPkg now *only* installs the PKG.
* Fixed crash when unpacking big debug PKG files.
* Debug PKGs are no longer recrypted.
* 'About...' dialog updated to remove PKG-related notice.
* Unpkg removed.

NOTE: The class PKGLoader is using wxWidgets functions to access the
files. I think VFS would be better, but the Emulator isn't necessarily
running when installing the PKG. In the other hand, initializing VFS
with RPCS3 may be somewhat risky... Any alternatives?

TODO: Get rid of the decrypted "*.dec" files, and try to decrypt and
read contents of the PKG on the fly using the information stored in
m_entries.
2014-02-21 02:35:33 +01:00
Nekotekina 81147506f0 Event fix, cellAudio fix 2014-02-21 00:47:22 +04:00
Nekotekina 08b4748aae cellAdec, cellVpost headers 2014-02-20 16:13:02 +04:00
Nekotekina 9351e50f63 Minor changes, some bugs fixed
cellVdec headers, cellFsAioRead review, sync stuff review, cellAdec and
cellVpost
2014-02-20 06:16:17 +04:00
DH d6fe398f79 Implemented RSXThread OutOfArgsCount notification. 2014-02-20 01:39:47 +02:00
Alexandro Sánchez Bach 8fedbd204e Merge pull request #81 from elisha464/master
small fix, makes scogger run
2014-02-19 23:50:53 +01:00
elisha464 ab4c4c2fd2 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-20 00:41:32 +02:00
elisha464 45452c57c4 fixed MFOCRF 2014-02-20 00:38:47 +02:00
DH b1df7444a4 Minor fixes 2014-02-19 19:27:52 +02:00
Alexandro Sánchez Bach 83a7c83761 Moved some lines and deleted old code
* Removed Compiler ELF references from rpcs3.cpp
* Reordered the menu bar lines.
* Moved the construction of some panels of MainFrame from rpcs3.cpp to
MainFrame.cpp
2014-02-19 05:33:31 +01:00
Alexandro Sánchez Bach b85a86b225 RSX Debugger: Shader program editor
* Added checkbox in the Settings dialog for logging/editing shader
programs.
* Added "Programs" tab to the RSX Debugger. Double-click on the entries
to view/edit the shaders. Click on "Yes" after closing the editor will
recompile your program even if no changes were done.
* Replaced "Ctrl+C" shortcut for running the emulator with "Ctrl+E" to
avoid accidentally unpausing the emulator when copying text.
* Added glDetachShader to GLProcTable.tbl

NOTE: There is a known bug: For some reason, certain shaders refuse to
compile again, even if you save the original shader as the "new" one.
2014-02-19 01:41:57 +01:00
Alexandro Sánchez Bach 51613df455 Merge pull request #80 from Nekotekina/master
Sync changes, simple file output for sound
2014-02-18 20:57:32 +01:00
Nekotekina d849e083b6 Small changes 2014-02-18 22:45:51 +04:00
Alexandro Sánchez Bach 22558df68e Merge pull request #79 from elisha464/master
vertexShaderDecompiler fix
2014-02-17 22:10:08 +01:00
elisha464 7f7b12a6dd a small fix in vertexShaderDecompiler (fixes scogger loading screen) 2014-02-17 23:05:59 +02:00
elisha464 07c9fbee7f Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
Conflicts:
	rpcs3/Emu/GS/GL/GLGSRender.cpp
	rpcs3/Emu/GS/GL/GLGSRender.h
	rpcs3/Emu/GS/RSXTexture.cpp
	rpcs3/Emu/GS/RSXThread.cpp
	rpcs3/Emu/GS/RSXThread.h
	rpcs3/Gui/RSXDebugger.cpp
	rpcs3/rpcs3.vcxproj.filters
2014-02-17 19:27:17 +02:00
Alexandro Sánchez Bach ab25edfacc Few source-code improvements
* Fixed identation inconsistency after last merge.
* Replaced uint32_t with u32 in LinearToSwizzleAddress.
* Replaced hardcoded values with defined GCM constants (in Emu/GS/GCM.h)
in some switch statements.

This commit won't produce any changes in the RPCS3 executable. It's just
to make the code easier to read.
2014-02-16 22:17:56 +01:00
Nekotekina 931929a82c Fixed conflicts 2014-02-16 21:57:36 +04:00
DH bd8ff4ca11 Fixed cellFsOpen & cellFsOpendir 2014-02-16 17:37:32 +02:00
Nekotekina 4375b9dd2a Audio port output in .wav file 2014-02-16 19:23:58 +04:00
DH 321d323beb Improved VFS
- Implemended vfsDir.
- Improved vfsDevice.
- Improved vfsFile.
2014-02-16 17:19:06 +02:00
DH 5d59dae730 Fixed RSXDebugger 2014-02-16 11:39:03 +02:00
DH a7368cc893 Merged elisha464 branch 2014-02-16 10:56:58 +02:00
DH 01f3763eb4 Small fixes 2014-02-16 10:28:32 +02:00
Alexandro Sánchez Bach 3fdb50b0ea Some sceNpTrophy syscalls and few fixes
* Restored deleted functions in FuncList.cpp
* Fixed bugs in TRPLoader.
* Implemented some sceNpTrophy syscalls.
* Added sceNp headers (required for sceNpTrophy).
* Updated .gitignore to ignore trophies.

NOTE: Thanks to the new sceNpTrophy syscalls, RPCS3 can install the
trophy contents in dev_hdd0/home/00000001/trophy/. Remember this is
still on an experimental stage.
2014-02-16 02:51:04 +01:00
Nekotekina 848c5dadf0 Fixed some problems 2014-02-16 01:16:35 +04:00
elisha464 5590efe054 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
Conflicts:
	rpcs3/Emu/GS/GL/GLVertexProgram.cpp
	rpcs3/rpcs3.vcxproj.filters
2014-02-15 13:05:16 +02:00
B1ackDaemon 700698247a Merge pull request #77 from Bigpet/SysCacheImpl
Basic sys cache implementation
2014-02-15 08:13:31 +02:00
Peter Tissen bdc8eba3bb Add cache support
also added tentative blocksize and sys_game_procexit support

added final cache support and improved the process chainloading error messages

don't ignore cache directory in the .gitignore

add warning for clearing cache
2014-02-15 01:51:59 +01:00
Peter Tissen f3ad989e34 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-15 01:44:18 +01:00
Alexandro Sánchez Bach deaedcb6fa TRP Loader and undo few cellGame changes 2014-02-15 01:06:12 +01:00
Alexandro Sánchez Bach f2a3db0bd8 Merge pull request #76 from Bigpet/master
Fix stepping a little better than last time
2014-02-14 21:09:24 +01:00
Nekotekina e066bcf261 Small cellAudio update 2014-02-15 00:08:02 +04:00
Peter Tissen b5d588a40b Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-14 20:50:25 +01:00
Peter Tissen f179bd4cd7 fix stepping a little better than last time 2014-02-14 20:50:02 +01:00
Alexandro Sánchez Bach e03d274071 Merge pull request #75 from Bigpet/master
Undo thread behavior changes and add html subproject to dependencies.
2014-02-14 18:17:04 +01:00
Peter Tissen 8bf8c7e6e9 undo thread behavior changes and add html subproject to dependencies. 2014-02-14 18:14:14 +01:00
elisha464 f7967f97ec flipped frame buffer 2014-02-14 14:50:41 +02:00
Nekotekina e94ea409fe sys_lwcond, sys_mutex, sys_cond rewritten
Some bugs fixed
2014-02-14 15:40:41 +04:00
Alexandro Sánchez Bach 82e0bbebdb Fixed few warnings and typos 2014-02-14 01:30:15 +01:00
Alexandro Sánchez Bach 209155d71d Merge pull request #72 from Bigpet/master
Fix "Go to Adress" and Stepping
2014-02-14 00:17:25 +01:00
Peter Tissen 6fbd4d3daf Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-14 00:10:58 +01:00
Peter Tissen 11ba83738f make stepping work again, it's impossible to use it without these changes 2014-02-14 00:08:32 +01:00
Alexandro Sánchez Bach eb93e87b7f Logging CheckBox, cellGame stuff and other fixes
* cellGameContentPermit and cellGameBootCheck updated.
* Checkbox in the Settings dialog, for enabling logging.
* Fixed GUI issue in the InterpreterDisAsmFrame.
* Fixed -dirty flag in wxWidgets submodule.
2014-02-13 20:05:23 +01:00
Alexandro Sánchez Bach 2b63888782 Merge pull request #71 from Nekotekina/master
Log fixes
2014-02-13 18:10:36 +01:00
elisha464 6846d15dc8 more rsx texture (filters)
implemented deswizzling of textures (only one format for now, a fix for multiple context sample)
2014-02-13 19:02:46 +02:00
Nekotekina 5a240c32a9 log fixes (to wx_str()) 2014-02-13 20:59:13 +04:00
Nekotekina a6faf04db4 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-13 15:57:34 +04:00
Alexandro Sánchez Bach 373d189edb Merge pull request #70 from Nekotekina/rpcs3
and conflicts fixed.
2014-02-13 12:13:05 +01:00
Alexandro Sánchez Bach 5953781c13 Few bugs fixed and license file added
* Fixed GUI issues caused by the update to wxWidgets 3.
* Fixed small bug in SC_TTY (thanks Nukem9!)
* Added GPL v2 license file.
2014-02-13 11:33:07 +01:00
Nekotekina 77ec2c954f Trying to fix merge conflicts... 2014-02-13 12:39:58 +04:00
Alexandro Sánchez Bach 256ee2ff8a Merge pull request #68 from Bigpet/master
Remove the outdated gl.lib reference
2014-02-12 22:18:12 +01:00
Peter Tissen 39e72fc3cc add the dependencies config for rpcs3, so that wxwidgets gets automatically build to build rpcs3 2014-02-12 22:08:03 +01:00
Peter Tissen d3f4b086c6 add the x64 library directory correctly 2014-02-12 21:57:37 +01:00
Peter Tissen de95ac3adb remove the outdated gl.lib reference, if this causes new linker issues we need to add the right name to the vcxproj instead 2014-02-12 21:46:23 +01:00
Alexandro Sánchez Bach 3a9b5afe30 Merge pull request #67 from Bigpet/master
change submodule to DHrpcs3
2014-02-12 21:09:12 +01:00
Peter Tissen b8400cbe63 change submodule to DHrpcs3 2014-02-12 21:07:44 +01:00
Nekotekina 460d948e87 Event system rewriting, EventManager partially implemented
cellAudio partially rewritten, some bugs fixed
2014-02-12 23:03:14 +04:00
Alexandro Sánchez Bach e9b3c4b5f6 Merge pull request #66 from Bigpet/wxWidget3Port
wxWidgets3 port
2014-02-12 19:54:41 +01:00
Peter Tissen 1400625648 add submodule instructions and bump submodule version 2014-02-12 19:23:33 +01:00
Alexandro Sánchez Bach 8adf19c904 Few module functions added
Implemented:
* cellSysutilApGetRequiredMemSize
* cellGameContentErrorDialog

Binded lv2 SysCall 814 to cellFsUnlink
2014-02-11 03:47:25 +01:00
Peter Tissen b05e466e8f clean up more output conversions, everything that wants to get printed needs to be explicitly convertex to the wxCharType otherwise the VFormat prints nothing 2014-02-10 19:51:03 +01:00
elisha464 48115b153e more rsx texture (control1)
and fixed crash of rsx debugger
2014-02-10 18:34:30 +02:00
Peter Tissen 427a63f324 remove commented out code 2014-02-10 17:16:35 +01:00
Peter Tissen 7423997b42 convert Dbg console packets uniformly to char* 2014-02-10 17:13:38 +01:00
elisha464 bc38af04a5 implemented viewport scale and offset (but everything seems to flip now :( ) 2014-02-10 17:57:32 +02:00
Peter Tissen b9c3dc352d use .wx_str() instead of .mb_str(), Dbg console is still broken 2014-02-10 13:53:09 +01:00
elisha464 c2ec1cb709 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
Conflicts:
	rpcs3/rpcs3.vcxproj.filters
2014-02-10 14:47:15 +02:00
Peter Tissen fdcdd7769f use the unicode version of the regex lib, don't know why the releas config links against it while debug doesn't 2014-02-10 11:19:48 +01:00
Peter Tissen bf26e069b8 use relative paths again to include the wxWidgets stuff 2014-02-10 03:00:02 +01:00
Peter Tissen 3f52a6aa50 prevent overflow becaus wxStrings aren't \0 terminated anymore 2014-02-10 02:43:24 +01:00
Peter Tissen b9abb1e075 merging vfs changes because I need to fix wxstring reads 2014-02-10 02:23:40 +01:00
Peter Tissen 59dcbd3ba3 make it compilable, don't merge this, string logs are broken and paths absolute to my machine 2014-02-10 02:13:13 +01:00
Alexandro Sánchez Bach 4d98826259 Directory-related functions implemented
* cellFsOpendir, cellFsReaddir, cellFsClosedir functions implemented.
* vfsDirBase: m_entryes, GetEntryes renamed to m_entries, GetEntries
respectively.
* vfsLocalDir: Read() function added to get the entries one by one.
* Moved IsExists() from vfsLocalDir to vfsDirBase to avoid "R6025 pure
virtual function call" error.
* Other minor changes in some functions of sys_fs
2014-02-09 22:53:48 +01:00
Peter Tissen 6dcfaf8617 add wxWidgets repository as a submodule 2014-02-09 22:03:38 +01:00
Peter Tissen 30df3727c2 delete submodules again 2014-02-09 21:51:01 +01:00
Peter Tissen 145450964a add wxWidgets submodule 2014-02-09 21:48:23 +01:00
Peter Tissen 8f7ceee36a remove local copy of wxWidgets 2014-02-09 21:45:53 +01:00
Alexandro Sánchez Bach 27a4e6a2b6 Merge pull request #65 from Bigpet/master
Update Readme with some links to the wiki and forums
2014-02-09 18:55:15 +01:00
Peter Tissen d85c26aa8b Update Readme with some links to the wiki and forums 2014-02-09 18:44:04 +01:00
Alexandro Sánchez Bach 4ebd974f5e Merge pull request #64 from Nekotekina/master
Last changes
2014-02-09 14:50:35 +01:00
Nekotekina 3308fefa7f Small changes
lwmutex completely implemented
2014-02-09 15:11:48 +04:00
Alexandro Sánchez Bach 66a9acfb04 cellFont rendering functions
-Now, all the games using rendering text using
cellFontRenderCharGlyphImage and all the related functions should work,
or at least don't crash.

-There are still issues with the character position on surface, and in
some cases, it renders the text with a different font than the one the
game specified. A lot of cellFont stuff is still missing or may be not
properly implemented.

-For games using system-embedded fontsets you have to find a *legal* way
to copy the .TTF files from your PS3 into dev_flash/data/font.
2014-02-09 12:07:50 +01:00
Nekotekina ed40732e7b Reservation review
Minor changes
SC_Event_flag.cpp module detached
2014-02-08 01:55:25 +04:00
Nekotekina 6c606be09f Reservation implemented
Some SPU bugs fixed;
sys_spu_thread_get_exit_status
sys_spu_thread_group_destroy
2014-02-07 02:55:48 +04:00
DHrpcs3 ce88a4fc9a Merge pull request #63 from O1L/master
Improved UnPkg.
2014-02-07 00:40:45 +02:00
O1L 74426fd4e9 Minor changes 2014-02-06 22:34:05 +04:00
O1L e0737204fd Use _ftelli64 and _fseeki64 instead ftell and fseek in unpkg, required to unpacking big files (> 4 Gb). Deleted wxMoveDir() (not needed now :P ) and added simple progress bars in unpkg. 2014-02-06 20:58:42 +04:00
elisha464 c515cb8fb6 more rsx texture (address, control0, image rect) 2014-02-05 22:48:30 +02:00
Nekotekina cfe154d916 Small changes, some bugs fixed 2014-02-05 15:55:32 +04:00
elisha464 d2bd0b0ccf Copy Paste :P (thnx AlexAletra) 2014-02-04 18:47:31 +02:00
Nekotekina aeca523a34 Small changes 2014-02-04 00:23:05 +04:00
elisha464 ad4ad4e55d started fixing the rsx textures
offset and format are done
2014-02-03 18:11:47 +02:00
Nekotekina 311486ed79 Fixed thread issues
Fixed args passing
Fixed thread stopping/pausing (temporarily)
Fixed problems with SC_Condition and SC_Mutex (partially)
2014-02-03 17:12:25 +04:00
Nekotekina a0c8e116df Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-03 01:20:48 +04:00
DH 8ba8d35541 Fixed compilation errors. 2014-02-02 22:47:17 +02:00
Nekotekina 7fce5589f8 Memory alignment fix
Some mutexes added, _sys_heap_memalign implemented
2014-02-02 23:49:10 +04:00
DH beb19633e9 Implemented vfsLocalDir & vfsDirBase.
Improved ThreadBase.
Minor fixes.
2014-02-02 21:42:32 +02:00
elisha464 8467d8c8c7 fixed clamping of texture_border 2014-02-01 18:44:19 +02:00
elisha464 39bb6d3b2b Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-01 16:15:42 +02:00
elisha464 da8cd146eb change warning to log in lwmutex 2014-02-01 16:15:24 +02:00
elisha464 79c2654a8c fixed problem of textures being disabled after every end command 2014-02-01 14:54:55 +02:00
elisha464 bff084c233 fix WriteDepthBuffer and scissoring 2014-02-01 13:10:57 +02:00
Nekotekina 15dd0bb0f2 Oops 2014-02-01 14:19:15 +04:00
Nekotekina b602260314 Some typos fixed (thanks to Nukem9)
cellSysutilCheckCallback() modified, some warnings converted
2014-02-01 14:17:15 +04:00
DHrpcs3 16c284214f Merge pull request #60 from elisha464/master
fragmentDecompiler fix
2014-01-31 23:30:22 -08:00
elisha464 9526ff37b9 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-01 00:16:43 +02:00
B1ackDaemon 31c0687fc0 Merge pull request #59 from Nekotekina/master
New sync primitives
2014-01-31 14:09:32 -08:00
Nekotekina 9919154d66 Afterfix 2014-02-01 02:07:37 +04:00
elisha464 985b27daab Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-02-01 00:02:10 +02:00
Nekotekina 6553909dc5 Fixed conflicts 2014-02-01 01:56:44 +04:00
Nekotekina 67601bd639 Small changes 2014-02-01 01:35:48 +04:00
DH d93ce95a36 Small fixes 2014-01-31 22:54:26 +02:00
elisha464 678e455b4f fixed fragment decompiler
when adding a const, I added a check to see if it already exists
2014-01-31 22:44:35 +02:00
DH 4b8d6b6919 Improved ThreadBase.
Improved Vertex Shader Decompiler.
2014-01-31 20:40:18 +02:00
Nekotekina 432c6cf206 Small changes
SC_FUNC changes (done by DH)
PPUInterpreter changes (copied from main, done by elisha464)
Log() using fixed
2014-01-31 16:46:49 +04:00
Nekotekina 6efe751d4c Bugs fixed, lwcond implementation
Modules: mutex added
2014-01-31 03:40:05 +04:00
Nekotekina 67a144df2a SC_Rwlock implementation, SC_Lwcond draft
Other small changes
2014-01-30 00:31:09 +04:00
Alexandro Sánchez Bach d07b5f0dc8 Merge pull request #58 from elisha464/master
Fixed some vector instructions and a small fix in the fragment shader decompiler
2014-01-28 11:41:27 -08:00
elisha464 7e591deaf3 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-28 20:02:20 +02:00
elisha464 3209b2f5f3 fixed VPREM and VSLDOI 2014-01-28 20:01:44 +02:00
elisha464 057efb48fa fix problem where there was black quads instead of text in fw samples 2014-01-26 23:08:09 +02:00
elisha464 543ed01642 delete m_main_mem_addr 2014-01-26 23:07:14 +02:00
Alexandro Sánchez Bach 211a477864 Merge pull request #57 from Nekotekina/master
Update: lwmutex reimplementation, cellPamf update, cellDmux draft, small changes in PPU interpreter
2014-01-25 15:17:15 -08:00
Nekotekina 4de64e5afe FDs fix 2014-01-26 02:53:02 +04:00
Nekotekina 88208f5e01 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-26 00:42:53 +04:00
Alexandro Sánchez Bach 09387879a0 Merge pull request #56 from elisha464/master
changed RSXThread to use the IO Memory

The datatype args didn't work for a certain part of RSXThread, because it tried to read from memory directly, but I needed it to you se read32 of the memorybase so it can reach the virtual memory block and in the end the real address.
2014-01-23 16:35:47 -08:00
elisha464 e8d00e6bbd Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-24 02:28:04 +02:00
elisha464 824fd46062 forgot some stuff :P 2014-01-24 02:26:08 +02:00
elisha464 8e9dcd279a changed everything to use the new IO address space 2014-01-24 01:22:56 +02:00
Nekotekina fc3f5348b8 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-24 00:38:29 +04:00
Alexandro Sánchez Bach 51512f25c5 Merge pull request #55 from elisha464/master
More fixes
2014-01-23 12:11:54 -08:00
elisha464 eac9526549 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-23 22:11:28 +02:00
elisha464 4ee90e1f90 changed warning of cellGcmAddressToOffset to Log 2014-01-23 21:38:26 +02:00
elisha464 8a3835bcef fix thread exit crash 2014-01-23 21:37:59 +02:00
Nekotekina d16dbedaa1 Fixed conflicts 2014-01-23 22:45:40 +04:00
Nekotekina 93faac5780 Small changes 2014-01-23 22:40:49 +04:00
elisha464 64bfae6648 fix stop when trying to run two games in a row 2014-01-23 19:03:43 +02:00
DHrpcs3 4b356998f2 Merge pull request #53 from elisha464/master
minor fixes
2014-01-22 12:49:03 -08:00
elisha464 ec942f2657 fixed getId and create thread (the id was written using write32 instead of write64) 2014-01-22 21:53:11 +02:00
elisha464 f260d1c602 fix cellGcmMapMainMemory 2014-01-22 20:04:11 +02:00
DHrpcs3 cf740f5129 Merge pull request #52 from elisha464/master
More memory mapping functions
2014-01-21 13:28:55 -08:00
elisha464 14c7c63e34 small fix 2014-01-21 22:23:28 +02:00
elisha464 7920f6d473 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
Conflicts:
	rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp
2014-01-21 21:19:07 +02:00
elisha464 9b9e621593 finished all memory mapping functions of libgcm 2014-01-21 21:10:44 +02:00
elisha464 8514a14cf4 small change to unmapping functions 2014-01-21 20:29:16 +02:00
elisha464 6504ddede4 fixed some memory mapping functions 2014-01-21 20:08:33 +02:00
elisha464 66a481d4bc Implement reserved memory in virtual memory block 2014-01-21 19:55:48 +02:00
Nekotekina 5f9bc13898 Some bugs fixed 2014-01-21 03:34:16 +04:00
Nekotekina 6fb1a67a83 SC_Lwmutex 2014-01-20 01:19:37 +04:00
DH dc2fd8c39e Improved vfsDevice.
Minor fixes.
2014-01-19 18:05:27 +02:00
Nekotekina d65647acf3 cellPamf update, cellDmux draft 2014-01-19 14:52:30 +04:00
DH ab41540064 Improved ID manager.
Improved MemoryBlock.
2014-01-19 05:14:11 +02:00
DHrpcs3 159b6ecea3 Merge pull request #51 from elisha464/master
Memory Mapping functions for libgcm and virtual memory block
2014-01-18 14:21:52 -08:00
elisha464 4e4dd43646 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-18 23:36:42 +02:00
elisha464 48726e8fed More memory mapping functions for libgcm 2014-01-18 23:36:22 +02:00
Nekotekina 9e06aeff33 cellPamf update 2014-01-18 03:45:07 +04:00
elisha464 509d46a544 Added Virtual Memory Block for the IO Address Space
Started implementing some the memory mapping functions of libgcm
2014-01-17 18:56:03 +02:00
Nekotekina e41f21abc7 Simple analog stick support (from KB)
Left stick: arrows; right stick: PgDn/PgUp (vertical) and Home/End
(horizontal)
Added L10n functions' list (copied from old distr)
Fixed "LoadShdr64 error: shstrndx too big" in ELF64 loader
Other minor changes
2014-01-14 23:03:48 +04:00
Ivan e0a70bb0fa Merge pull request #49 from Nekotekina/master
cellSyncMutex+SPU
2014-01-12 02:40:53 -08:00
Nekotekina 970b834f2e CellSync review (mutexes, SPU).
File descriptors temporarily detached from ID manager.
Some logs disabled.
2014-01-12 14:27:59 +04:00
Nekotekina 4e8cd72e59 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-12 13:35:10 +04:00
Alexandro Sánchez Bach 2506810a2e cellAudio updated
cellAudio:
* Change endianness of datatypes.
* Fixed port handling.
* Uninitialize module when restarting.
* Minor syntax fixes.
2014-01-10 22:06:22 +01:00
Nekotekina 1be7454bc4 Fixed errors, improvements
cellSync review, MFC channel AtomicStat added, draft implementation of
MFC_GETLLAR_CMD, MFC_PUTLLC_CMD etc, memory allocating hacks for
alignment.
2014-01-10 05:30:59 +04:00
DH 76695a97b9 Implemented mem_func_ptr_t.
Improved cellFsAioRead.
Fixed cellAudioOut* return error codes.
2014-01-08 23:16:13 +02:00
Alexandro Sánchez Bach 1d61e7b4a4 Merge pull request #48 from Nekotekina/master
Compilation fix + other fixes
2014-01-07 13:36:51 -08:00
Nekotekina 775bf8b340 Fixed conflicts 2014-01-08 00:49:40 +04:00
Nekotekina f4952bee18 Small fixes 2014-01-08 00:27:34 +04:00
DH 7971db665e Improved Vertex Shader Decompiler.
Fixed VFS Manager crash.
Fixed SPU image loader.
Draft implementation of cellFsAioRead.
Improved Callbacks.
2014-01-07 22:11:02 +02:00
DH cbeadcf872 Improved RSX Debugger
- Fixed crash in debug build.
 - Implemented texture selection.
2014-01-07 09:30:41 +02:00
B1ackDaemon 40f2e679ec Merge pull request #47 from Nekotekina/master
cellSync, cellPamf and other
2014-01-06 08:53:30 -08:00
Nekotekina db8f01717c cellPamf improvements 2014-01-06 20:16:11 +04:00
Nekotekina 5f8d36600c cellPamf partial research and implementation 2014-01-06 05:50:56 +04:00
Nekotekina 2d011e94cd Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-05 03:58:19 +04:00
Nekotekina 5f06f46f32 Minor improvements
cellFsAioRead partially implemented, cellPadInfoPressMode &
cellPadInfoSensorMode stubs
2014-01-05 03:58:03 +04:00
Alexandro Sánchez Bach aa9b0d0a31 RSX Debugger, Mem. Viewer and module improvements
* Small cleanup in cellJpgDec and cellPngDec.
* cellPamf added to the project and a few test lines added to
cellPamfGetHeaderSize(2).
* Improved speed of the Raw Image Preview on the the Memory Viewer.
* Now you can click on the shown buffers / textures in the RSX Debugger
in order to see them in full size. More settings added to the tabs.
* Fixed cellFsStat in order to fix the crash aused by opening
directiories. The solution is really *really* ugly. Once vfsDir is
ready, I will replace it with something better.
2014-01-05 00:45:44 +01:00
Nekotekina 64b18b4dc2 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2014-01-02 18:56:53 +04:00
Alexandro Sánchez Bach 1a43fe5ceb RSX Debugger & cellFont improved
RSX Debugger:
*Better way to add name:value pairs to the tabs.
*Added some entries in the Settings/Texture/Lightning tabs.
*Experimental DisAsm.
*Support for previewing RGB textures (buggy!).
*Minor cleanups and improvements

cellFont:
*Added cellFontOpenFontMemory, cellFontOpenFontFile,
cellFontOpenFontset. They still need some modifications (e.g. bind these
functions to stblib/stb_truetype.h).
2014-01-02 02:13:08 +01:00
Nekotekina 906f448221 Fixed conflicts 2013-12-31 15:16:05 +04:00
Nekotekina 552fd355bc New functions
Added cellSync module, implemented sys_spu_thread_group_join,
sys_spu_thread_group_suspend, added /dev_bdvd/ device, fixed default
values of analog sticks.
2013-12-31 15:10:24 +04:00
Alexandro Sánchez Bach d1a27748a3 Experimental RSX Debugger & minor changes
RSX Debugger:
Currently, it can preview the color buffers while the RSX Thread is
running, view and modify the render flags, and act as a memory viewer in
the RSX command buffers (no disasm yet). You can press F5, to update the
information (buffers, memory, flags, etc.) of the frame. There are *a
lot* of TODO's here that will be done in the future.

Minor changes:
*Added /dev_flash/ to VFS (required for cellFont in the future).
*cellMsgDialogOpenErrorCode implemented using wxMessageBox. The
information for each error code comes from PSDevWiki. There are lots
error codes missing.
*Updated sys_memory_get_page_attribute

Happy new year to everyone! :-)
2013-12-30 23:59:39 +01:00
Alexandro Sánchez Bach 3858f5097e Merge pull request #40 from osvcos/master
Halfplement syscall 351 (sys_memory_get_page_attribute)
2013-12-30 13:32:28 -08:00
Osvaldo Costa 7277940b84 Halfplement syscall 351 (sys_memory_get_page_attribute) 2013-12-30 16:34:39 -03:00
Osvaldo Costa 9a1e22fb85 Halfplement syscall 351 (sys_memory_get_page_attribute) 2013-12-29 18:18:51 -03:00
Alexandro Sánchez Bach 24d01a28c8 Merge pull request #38 from O1L/master
Update missed WindowsPadHandler.h

_Note:_ O1L explained that there was some issues when trying to fix what I mentioned in my last comment caused by wxWidgets 2.8.12. Therefore I will merge this commit as we can try different approaches to fix this in the future.
2013-12-28 14:03:32 -08:00
O1L 429041097b Update missed file 2013-12-28 14:05:44 +04:00
Hykem e807ae1a58 Merge pull request #37 from O1L/master
cellSysutil audio functions, configurable controls and other minor changes
2013-12-27 13:51:14 -08:00
Hykem f477b62813 Merge pull request #36 from Nekotekina/master
SPU Improvements
2013-12-27 13:50:55 -08:00
Hykem 69be408b32 Merge pull request #34 from osvcos/master
Relocate sys_process_is_stack to sysPrxForUser.cpp
2013-12-27 13:50:25 -08:00
Nekotekina ca13d4f2ef SPU
LQX Hack removed, Critical Section for m_status removed.
2013-12-27 15:35:08 +04:00
O1L 286254a10a Implemented some cellSysutil audio functions, added configurable controls (draft/ugly implementation), and minor changes in cellAudio and ConLog 2013-12-27 14:55:11 +04:00
Nekotekina 1ab5ef9dd7 SPU
Implemented sys_raw_spu_load, sys_raw_spu_image_load. Minor review of
MFC, channels.
2013-12-25 21:28:10 +04:00
Nekotekina 35257f5e94 SPU Improvements
Implemented sys_spu_image_import, original Mandelbrot PKG should work
now.
2013-12-24 21:34:51 +04:00
Nekotekina 3a82ed5dc9 Fixed x86 build
Fixed crashes
2013-12-24 15:10:55 +04:00
Nekotekina ab2bc35b18 Fixed conflicts
(merge branch)
2013-12-24 12:42:03 +04:00
DH eb2ab73e16 Implemented LWZUX, LWAX, LWAUX, LHA, LHAU, LWA, STWBRX, STHBRX. 2013-12-24 07:25:15 +02:00
DH 456374d487 Added missed files. 2013-12-24 06:02:21 +02:00
DH b500fcbaed Fixed ELF64 loader.
Fixed cellPadGetInfo.
Fixed cellFsOpen path encoding.
Draft implementation of cellAudioGetPortConfig.
Implemented STBUX, STHUX, STWUX.
Improved Boot (S)ELF / Install PKG UI.
2013-12-24 05:58:32 +02:00
Nekotekina fdb3fdb927 Files removed
They don't work from this folder
2013-12-23 17:20:16 +04:00
Nekotekina ba8108d595 SPU Fixes
Mandelbrot set does work now and its modified version included in
TEST12345 folder.
2013-12-23 15:57:09 +04:00
Nekotekina 37b5b49f58 Fast fix
Previous commit was wrong
2013-12-22 22:16:57 +04:00
Nekotekina c9abf559be SPU Improvements
Implemented SNR channels and syscalls, fixed sys_spu_thread_initialize
(args' passing, SPU image copying for each thread)
2013-12-22 21:40:50 +04:00
Nekotekina e28ba30561 Notification of NI flag change
Probably useless.
2013-12-19 02:30:06 +04:00
Nekotekina c3d2cd344f Win32 fix & elf loading fix
Fixed compilation error for x86 version. Fixed issue with ELF loading.
2013-12-15 01:59:37 +04:00
Nekotekina 01a274a1db Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-12-14 04:17:02 +04:00
Nekotekina eed6a7ffe3 STBUX implemented
Missed PPU opcode + replaced some non-unicode non-ASCII characters in
PPPInstrTable.h
2013-12-14 04:15:20 +04:00
Nekotekina ee137323aa MBox, some improvements
Some changes reverted (warnings), multi-thread safety fixed, MBox MMIO
modified
2013-12-13 05:35:28 +04:00
Osvaldo Costa 2c1cb51843 Relocate sys_process_is_stack to sysPrxForUser.cpp 2013-12-11 19:26:36 -03:00
Osvaldo Costa bc3772614b Relocate sys_process_is_stack to sysPrxForUser.cpp 2013-12-11 19:13:28 -03:00
Nekotekina c9fc99c388 Basic DMA, MFC, channel changes
Added new consts, thread-safe locks for critical resources, removed some
warnings. Modified git-version.h
2013-12-11 02:58:11 +04:00
Alexandro Sánchez Bach e2de06da63 Fixed conflicts 2013-12-09 18:07:13 +01:00
Alexandro Sánchez Bach 849af30bfd First cellFont functions & minor changes
* Edited .gitignore
* Moved some functions to cellFontFT.
* Now cellFont initializes correctly, but it doesn't render anything
yet. There are still several things to change and functions to
implement. I will take care of it.
2013-12-09 17:56:04 +01:00
Nekotekina bba9ea830f Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-12-08 21:46:14 +04:00
Nekotekina e8d2245a0b Revert "SPU Improvement"
This reverts commit 9bf8f2eec5.
2013-12-08 21:44:52 +04:00
DH bf03874be2 Refresh Game Viewer after Install PKG 2013-12-08 19:06:20 +02:00
DH 23539f13b5 Improved Boot UI.
Added dev_usb000.
Fixed Game Viewer.
Minor fixes.
2013-12-08 18:54:45 +02:00
Nekotekina 78ca7e1d44 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-12-08 18:04:12 +04:00
Nekotekina 34ac4688e6 MFC
Minor changes
2013-12-08 18:03:51 +04:00
DH eaef09df91 Improved PSF loader.
Improved Game Viewer.
Implemented cellPadGetInfo.
Minor improvements.
2013-12-08 15:47:54 +02:00
Nekotekina 2135fb9685 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-12-08 05:00:53 +04:00
DH 34f5997f82 Improved OpenGL renderer.
- Rotate color buffer.
2013-12-08 02:42:59 +02:00
DH 76a93443c3 Improved OpenGL renderer
- Implemented color buffer reading.
2013-12-08 02:09:16 +02:00
Nekotekina 430ded8259 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-12-08 03:13:03 +04:00
Nekotekina 9bf8f2eec5 SPU Improvement
Some instructions implemented with SSE intrinsics
2013-12-08 03:12:37 +04:00
DH bba1b6a6e0 SPU improvements
- Implemented more SPU Channels.
- Improved interpreter.
Minor improvements.
2013-12-08 00:52:41 +02:00
Hykem a9a246a866 General improvements:
- Added drafts for event flag emulation;
- Implemented memory locking/unlocking;
- Refactored common SC_Memory objects;
- Implemented VM (virtual memory) syscalls;
- Improved cellGameBootCheck;
- Added more dummy values to cellVideoOutGetDeviceInfo;
- Mapped functions sys_mmapper_allocate_memory and sys_mmapper_map_memory to sysPrxForUser;
- Mapped syscalls 341 and 342 (duplicates of 324 and 325) to sys_memory_container_create and sys_memory_container_destroy;

Improved PKG installation routine:
- Allow immediate game booting;
- Fixed and improved game folder path handling.
2013-12-07 20:56:42 +00:00
DHrpcs3 ff4fcdd5fd Merge pull request #33 from Nekotekina/master
SPU Changes Request
2013-12-04 05:52:26 -08:00
Nekotekina 241ae83645 SPU Improvement
Implemented CFLTS, CFLTU, CSFLT and CUFLT. Finally fixed FREST.
2013-12-04 00:35:45 +04:00
Nekotekina 73c2628ef4 SPU Fixes 3.2 2013-12-02 22:49:06 +04:00
Nekotekina 38fabf7cd2 SPU Fixes 3.1
Small fixes
2013-12-02 14:40:58 +04:00
Nekotekina 1cfcc742d8 SPU Fixes 3
Almost all implemented instructions are fixed. Partialy tested. Some
instructions are still unimplemented.
2013-12-01 21:30:40 +04:00
Nekotekina ae39d3802f SPU Fixes 2
It's almost finished
2013-12-01 04:36:55 +04:00
Nekotekina b217742c7b Merge fix 2013-11-30 03:50:43 +04:00
Nekotekina f0946c4bc8 Merge branch 'master' of https://github.com/Nekotekina/rpcs3 2013-11-30 03:40:50 +04:00
Nekotekina 384e20acf0 SPU fixes
Partially tested and fixed
2013-11-30 03:40:31 +04:00
Nekotekina c48168ffc7 SPU ELF loading
I'm not sure that it's correct way to get entry point
2013-11-29 19:27:10 +04:00
Nekotekina 65c920bc8d Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-11-29 18:46:57 +04:00
Alexandro Sánchez Bach 5ce57e963f New functions & Minor changes
* cellGameBootCheck, cellSysutilGetSystemParamString partially
implemented.
* Improved debug SELF loader (I applied DH's changes over another part
of code that Hykem wrote).
* Added checkbox in the Config>Settings menu to ignore Read/Write errors
(disabled by default).
* Minor issues.
2013-11-29 05:56:26 +01:00
Nekotekina a32fe40275 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-11-28 18:37:33 +04:00
DH 28a5d1bcab Fixed conflicts. 2013-11-28 14:27:04 +02:00
DHrpcs3 1bc99a3762 Merge pull request #30 from xsacha/master
Removal of WX dependency and introduction of Qt UI alternative
2013-11-28 04:09:49 -08:00
Nekotekina 794cd4cf89 cellGcmSetUserHandler (empty), SPU.SF syntax
Test commit
2013-11-28 02:15:45 +04:00
Sacha 6bcaf469e8 First stage of WX dependency removal. 2013-11-28 05:16:19 +10:00
Sacha d83a9b12d6 Introduce a Qt UI for RPCS3 2013-11-27 16:37:46 +10:00
DH 4fbfc14763 Improved Debug SELF loader 2013-11-26 07:04:39 +02:00
DH 9ce30fdd74 Improved OpenGL renderer & RAW SPU
- Improved Fragment Shader Decompiler.
- Fixed NV308A_COLOR cmd.
- Fixed break points for RAW SPU Thread.
- Added cellMsgDialogOpen2 to cellSysutil module.
2013-11-26 06:34:19 +02:00
B1ackDaemon dae31c44e0 Merge pull request #27 from Hykem/master
Syscall 114 and UNFSELF
2013-11-25 17:22:26 -08:00
Hykem 97d65e5563 Missing changes from last commit. 2013-11-26 00:28:08 +00:00
Hykem 03d2525ccc Implemented syscall 114.
Implemented manual unfself routine for debug (homebrew) packages.
2013-11-26 00:23:25 +00:00
DHrpcs3 a852baee5b Merge pull request #25 from FGRE/master
Fix linking
2013-11-25 09:57:22 -08:00
DHrpcs3 12c2e13dfa Merge pull request #26 from O1L/master
Added cellFont module (dummy in this moment) & minor changes in default settings
2013-11-25 09:56:33 -08:00
O1L 206cc6ac91 Added libfont module. Set Renderer to OpenGL, Aspect Ratio to 16:9 and Pad Handler to Windows by default. Partially implemented cellGcmSetDebugOutputLevel and cellGcmSetSecondVFrequency functions. Added 'host_root' path to VFS Manager. 2013-11-25 15:49:55 +04:00
Mislav Blažević 9a8cf34f44 Fix linking 2013-11-24 10:23:04 +01:00
Alexandro Sánchez Bach f43a324937 New GCM commands implemented
- NV4097_SET_DEPTH_BOUNDS_MIN
- NV4097_SET_POLY_OFFSET_FILL_ENABLE
- NV4097_SET_POLY_OFFSET_LINE_ENABLE
- NV4097_SET_POLY_OFFSET_POINT_ENABLE
- NV4097_SET_RESTART_INDEX_ENABLE
- NV4097_SET_RESTART_INDEX
2013-11-24 01:47:17 +01:00
DH c7ca4b996a Fixed compilation errors
Minor improvements
2013-11-24 02:01:57 +02:00
DHrpcs3 0ff38bc8ce Merge pull request #24 from FGRE/master
Fix compilation with GNU compiler
2013-11-23 14:50:13 -08:00
Mislav Blažević 2926d3805c Cleanup OpenGL hacks 2013-11-23 23:31:05 +01:00
Mislav Blažević d8bd34b57e Start porting to GNU compiler 2013-11-23 23:27:58 +01:00
DH f91bd80bc2 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-11-23 20:51:32 +02:00
DH da9c778a4c Improved RAW SPU
Fixed sc binder_func_10
2013-11-23 20:50:54 +02:00
Alexandro Sánchez Bach 268a654fec Implemented Raw Image Preview tool 2013-11-23 18:56:03 +01:00
DH 8463694d4f - Improved call stack. 2013-11-23 17:20:31 +02:00
DH cbe4ab253c Improved Memory Viewer 2013-11-23 07:38:19 +02:00
Alexandro Sánchez Bach 5e1a958ee6 New debugging features, cellGame & minor changes
Two cellGame functions partially implemented:
- cellGameGetParamInt
- cellGameGetParamString

New debugging features:
- Call Stack viewer added
- Memory Viewer rewritten (Not finished yet)

Modified definition of UNIMPLEMENTED_FUNC to improve compatibility with
other compilers: Thanks @krofna

Replaced the "Compiler" menu entry with "Tools" and "Memory Viewer"
entry added.

NOTE: To "quickly" browse the memory using the Memory Viewer you can use
the scrollbar. Notice the irony of the word 'quickly' since the memory
viewer is actually slow as fuck. I will fix that soon. As you can see,
I'd like to add a Raw image viewer in the future in order to "see"
textures directly from memory.
2013-11-23 05:47:19 +01:00
DH 62c1980cac Improved PPU Interpreter
- Fixed MULHW & MULHWU.
- Improved MULHD & MULHDU.
2013-11-23 04:55:26 +02:00
DH aab69513aa Fixed SLD.
Thanks to elisha464.
2013-11-22 17:15:04 +02:00
DHrpcs3 ead70f5c00 Merge pull request #19 from osvcos/master
Change the GUI a little bit
2013-11-19 13:20:29 -08:00
DH 9d5b13839b - Fixed OpenGL renderer LoadVertexArray & DrawArray.
- Improved SPU SCs.
- Renamed mem_ptr_t -> mem_list_ptr_t, mem_struct_ptr_t -> mem_ptr_t.
2013-11-19 23:10:23 +02:00
Osvaldo Costa 19fea00432 Change the GUI a little bit
Removed the launch of the ELF Compiler window at startup. Instead of it,
I added a menubar item called "Compiler", and within it a menu item
called "ELF Compiler", wich will launch the window.
2013-11-17 23:10:59 -03:00
DH 5373747210 - Improved sc function binder.
- Improved Module binder.
- Added Dump Depth Buffer & Dump Color Buffers options (values can be changed on the fly).
2013-11-16 23:12:30 +02:00
DH baea02901b - Implemented cellRescResetFlipStatus & cellRescGetFlipStatus.
- Renamed gs homebrews.
- Updated AboutDialog.
2013-11-16 03:44:08 +02:00
Alexandro Sánchez Bach 382ae8a78f Improved cellResc module
* cellResc module improved

* Many changes in this commit are from [DH]: The implementation of
cellRescSetConvertAndFlip, cellRescSetWaitFlip and cellRescSetSrc as
well as all the other changes that are not in cellResc module.

* Fixed another conflict from O1L/rpcs3 (master): Deleted
"cellPhotoUtility" (which already exists in cellPhotoExport)
Now all the conflicts are solved. :-)

NOTE: We should search for a better name for 's_rescInternalInstance'.
This one is just too long and some lines don't even fit in my screen
because of this.
2013-11-16 01:38:22 +01:00
Alexandro Sánchez Bach 2a5f353e1e Fixed remaining conflicts
Fixed remaining conflicts from O1L/rpcs3 (master):
* Removed cellPhotoDecodeUtil.cpp, cellPhotoImportUtil.cpp and
cellScreenShotUtility.cpp which are already present.
* Updated cellSaveData.cpp to fix the conflicts.
2013-11-14 12:54:37 +01:00
Alexandro Sánchez Bach 45e58d882e Merge pull request #17 from O1L/master
PKG Installer
2013-11-14 03:34:28 -08:00
O1L b1caa5f9c4 Fixed errors from previous commit. Sorry. 2013-11-13 23:43:44 +04:00
O1L 6d56f1ae86 Implemented PKG Installer, improved Boot game. 2013-11-13 22:35:25 +04:00
O1L 584d4eb9d4 Updated 2013-11-13 22:24:24 +04:00
DH 3dd9683b47 Fixed clear mask. 2013-11-09 23:49:01 +02:00
DH 842559804f Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-11-09 23:30:41 +02:00
DH 521244b0e0 Improved GS Renderer. 2013-11-09 23:29:49 +02:00
Alexandro Sánchez Bach a55f76879e Merge pull request #16 from Magn3s1um/master
Floating-Point Status and Control Register (FPSCR) and code fixes
2013-11-09 08:07:17 -08:00
Magn3s1um 63482dcfdc -Fixed MPYU and special registers based on comments 2013-11-09 07:51:26 -08:00
Magn3s1um 1192d20295 -Partial Implementation of Floating-Point Status and Control Register (FPSCR) 2013-11-09 07:41:56 -08:00
DH 6ea2c7d6a8 - Fixed memory leaks in cellRtc module.
- Fixed CPUThread crash.
- Improved ARMv7 Interpreter.
2013-11-09 14:25:12 +02:00
Alexandro Sánchez Bach 3b15f35432 Merge pull request #15 from Hykem/master
Fix for OpenGL error and implementation of cellRtc
2013-11-08 18:55:34 -08:00
Alexandro Sánchez Bach 620b8d0369 Fixed errors of last commit
I forgot to modify one line of code that broke the entire solution. Now
this is fixed. I also disabled the logging of sys_timer_usleep calls.
2013-11-09 03:48:43 +01:00
Hykem 3076571b6f Fixed OpenGL error 0x0502.
Implemented cellRtc module.

Added module name list in cellSysmodule to aid debugging.
2013-11-09 01:27:37 +00:00
Magn3s1um 3c762750a0 -Added SPR registers
-Implemented MTSPR
2013-11-08 17:17:44 -08:00
Alexandro Sánchez Bach 60261408c2 Merge branch 'master' of https://github.com/AlexAltea/rpcs3
NOTE: I included some changes of the forks of O1L and Dante38490 to my
fork. However, a conflict appeared while merging their sources with the
ones of DH. I had to resolve this conflict manually and push all the
changes like a new commit, that's why there changes weren't recorded
individually and (probably) won't appear at in the commits list. I am
very sorry for this, I'll try to avoid this in the future.

In order to preserve the authors of those commits, I write this list
here:
O1L: Dummy Modules (cellAudio, cellSaveData, and more)

https://github.com/O1L/rpcs3/commit/23ece01a0b6381cbbf70f87d6fa5d8d38094a1d3

https://github.com/O1L/rpcs3/commit/784fc571b3d5d7b4a59e52b27c2abba866e6f225

Dante38490: Spotted and fixed an issue in git-version-gen.cmd

https://github.com/Dante38490/rpcs3/commit/44e8867125deff3cecc29c6ed42f3a6fda998e5a

Regarding my changes:
* New lv2 SysCalls implemented (and others improved)
* SDATA unpacker implemented
* Changed layout of sc_table
2013-11-09 02:05:58 +01:00
DH 099333c992 - Implemented some ARMv7 instructions. 2013-11-06 03:01:15 +02:00
DH f18fff08c7 - Fixed compilation errors. 2013-11-05 22:04:55 +02:00
DH b263c3ebaf - Renamed ARM9 to ARMv7.
- Improved ELF32 loader.
2013-11-05 21:22:58 +02:00
DH 6b22e7d90a - Implemented ARM9Interpreter & ARM9DisAsm.
- Implemented MemoryBlockLE & DynamicMemoryBlockLE.
- Implemented CPUDecoder.
2013-11-05 20:12:18 +02:00
DH 0b35be32a4 - Implemented ARM9Thread.
- Improved OpenGL Renderer.
- Improved RAW SPU mfc.
2013-11-03 21:23:16 +02:00
DHrpcs3 6622dc42b5 Merge pull request #9 from Hykem/master
Add SELF decryption and ELF32 little endian support
2013-10-28 15:50:36 -07:00
Hykem 198d0a2fc0 Added ELF32 little endian support for PSP ELF files. 2013-10-28 21:58:03 +00:00
Alexandro Sánchez Bach f1b420eb3b SELF decrypter improves & About... dialog added
SELF decrypter improved:
The files 'scetool.exe' and 'zlib1.dll' are no longer needed. Everything
needed is now included in the rpsc3 project. So the only thing you need
in order to load SELF files are the keys. More information about this
matter in my last commit: c1565e55

Warning for devs! There is a lot of spaghetti code in /scetool/. I
fucked up things a bit while trying to include scetool in rpcs3. There
is a lot of unused code there and I need to make sure that everything is
working properly. In any case, the code seems to work stable so
end-users shouldn't be worried about this warning. ;-)

'About...' dialog added:
Well, I have nothing more to say here. I wish you all a nice day!
2013-10-21 23:02:43 +02:00
Alexandro Sánchez Bach c1565e55e5 Experimental SELF decryption support
This SELF decryption feature is not portable and its code looks really
ugly. It is experimental and is meant to save time to developers when
doing tests with SELF files. Besides that, it works (under Windows). :-)

How to use it:
1. Place "scetool.exe" (and "zlib1.dll") into the main rpcs3 folder.

2. Obtain a LEGAL copy of the SELF decryption keys and place them in a
folder named "data" next to the main executable in a format that is
readable for "scetool.exe". That is, following files should be present:
data/keys
data/ldr_curves
data/vsh_curves

(See screenshot in the comments)

NOTE: These are the steps to enable SELF decryption and it applies to
future commits regarding this matter. We do NOT take any responsibility
about the way you obtain the keys or (until we include SELF decryption
into our code) the actions "scetool.exe" (or "zlib1.dll") perform.
2013-10-14 21:40:44 +02:00
DH 5874a5683e Fixed small error. 2013-10-06 18:41:19 +03:00
DH 64cd9746b8 Fixed minor Debugger errors. 2013-10-06 18:05:58 +03:00
DH 8259006bc3 Improved OpenGL renderer.
- Improved Vertex Shader Decompiler.
- Fixed CMD analyzer.

- Improved sys_fs module.
- Minor fixes.
2013-10-06 17:15:04 +03:00
DH dd48f827c3 - Implemented be_t, mem_struct_ptr_t, vfsFile.
- Improved sys_fs, cellPngDec, cellJpgDec, cellGifDec modules.
2013-10-06 15:07:42 +03:00
O1L f8193fd784 Merge branch 'master' of https://github.com/DHrpcs3/rpcs3 2013-10-01 15:05:44 +04:00
O1L 23ece01a0b Minor improved cellAudio module. More dummy modules created. Some modules are not included to the project. If you want to implement a function of any of these modules, add the corresponding file to the project first. 2013-09-30 20:35:28 +04:00
B1ackDaemon efd336b743 Merge pull request #7 from AlexAltea/master
Some modules updated / improved & New dummy modules
2013-09-28 15:07:31 -07:00
Alexandro Sánchez Bach 2eb2a2a197 Small issue fixed 2013-09-28 23:05:56 +02:00
Alexandro Sánchez Bach 9bb2d082e6 Some Modules updated to use mem*_t class
cellKb, cellMouse and cellSysutil now use the mem*_t instances instead
of using "u32 *_addr" variables.
2013-09-28 16:30:04 +02:00
Alexandro Sánchez Bach afb9273823 More dummy modules
* 41 new dummy modules created.

NOTE: I have detached the previous 4 dummy modules of my last commit
(1a85ccbbf4) from the project since they will consume space of the
executable, and compilation time and don't provide anything useful yet,
the same applies to this commit. The only reason to provide this dummy
modules is to avoid that developers have to spend too much time on
creating the template of the module before implementing functions. If
you want to implement a function of any of these modules, add the
corresponding file to the project first.
2013-09-28 04:36:57 +02:00
O1L 784fc571b3 Created new dummy module for cellAudio. 2013-09-27 14:05:29 +04:00
Alexandro Sánchez Bach 1a85ccbbf4 Improved image dec. modules & New dummy modules
* Improved image decoding modules:
- Fixed error that appeared after last commit (eebe859f83).
- Changed some functions to use the mem*_t classes.
- Implemented cell*DecSetParameter.

* Created new dummy modules for sys_net (0x0000), sys_http (0x0001),
cellHttpUtil (0x0002) and cellSsl (0x0003).
2013-09-25 15:43:55 +02:00
DH eebe859f83 Improved mem_t.
- Implemented mem_ptr_t.
- Fixed issue 3.
2013-09-25 00:11:29 +03:00
B1ackDaemon e655999a23 Merge pull request #5 from AlexAltea/master
Improved debugger, modules and the SPU interpreter
2013-09-23 06:55:37 -07:00
Alexandro Sánchez Bach 7d97bbfbbf Changed syntax of last SPU instructions 2013-09-23 14:20:47 +02:00
Alexandro Sánchez Bach 03dcfeabc3 More SPU Instructions: Floating point comparison
* Implemented Floating/Double-floating comparison instructions:
FCGT, FCMGT, FCEQ, FCMEQ, DFCGT, DFCMGT, DFCEQ, DFCMEQ

* Implemented more Floating/Double-floating operations:
FMA, FMS, FNMS, DFMA, DFMS, DFNMS, DFNMA

* Implemented Double / Single floating-point conversion:
FESD, FRSD
2013-09-23 12:48:27 +02:00
Alexandro Sánchez Bach db7e68d308 More SPU Instructions: Floating point arithmetic
Implemented Floating/Double-floating arithmetic operations: Add,
Substract and Multiply: FA, FS, FM, DFA, DFS, DFM respectively.

* Fixed issue in the register editor: Wrong value displayed when reading
64 bit or 128 bit registers.

* Fixed issue in the register editor: Error when writing to 128 bit
registers.
2013-09-23 01:50:16 +02:00
Alexandro Sánchez Bach 9c6ae554fa Debugger improved: Register editor added
How to use the register editor:
1. Load an .ELF file
2. Select any instruction from a thread. (This is a workaround to
activate the appropriate event listener. This will be changed in the
future).
3. Press 'R' key and modify any register you want.

Note:
The register editor only works with PPU and SPU threads.

Additional changes:
* Fixed the filesize problem caused by the instruction editor dialog.
* Instruction Editor: Fixed small issue in SPU threads
2013-09-22 13:34:54 +02:00
Alexandro Sánchez Bach bf293ebbfc Debugger improved: Instruction editor added
How to use the instruction editor:
1. Load an .ELF file
2. Select an instruction from any valid memory address inside any
thread.
3. Press 'E' key and have fun. :P

Note1: I suggest to remove the function InterpreterDisAsmFrame::DClick
and use InterpreterDisAsmFrame::InstrKey to do all debugging-related
actions (Add breakpoint, Edit, Step, Run, etc.) using the same keyboard
layout as debuggers like OllyDbg.

Note2: The final binary is 200 KB larger due to this feature. This issue
should be fixed in the future. This has probably something to do with
the #include's.
2013-09-21 02:40:36 +02:00
Alexandro Sánchez Bach a11de0f607 Improved image decoding modules
* Huge improvement in the speed of cell{Png|Gif|Jpg}DecDecodeData when
reading input files.

Note: Sorry if this commit is too "small", but I need to sync every
change since I use two PCs.
2013-09-19 23:40:43 +02:00
Alexandro Sánchez Bach 20665b9f89 Improved sys_fs module
- cellFsStat now accepts mounting points in the path argument.

- cellFsMkdir, cellFsRmdir, cellFsUnlink and cellFsRename are now using
the real path provided by the VFS.

- cellFsFtruncate, cellFsTruncate and cellFsFGetBlockSize are partially
implemented.

Note: I have spotted a bug in cellFsRename and cellFsRmdir (this has
nothing to do with the changes I made), but I don't dare to fix it since
I am not sure if I will break other functions with my solution.
2013-09-18 23:50:00 +02:00
DHrpcs3 d7e4f7ec3b Merge pull request #4 from AlexAltea/master
New image decodification modules & IO devices
2013-09-15 08:13:23 -07:00
Alexandro Sánchez Bach b85d39bfc3 Minor issues fixed
*Memory leak in image decodification modules.

*Changed mouse wheel delta value.
2013-09-14 22:47:59 +02:00
Alexandro Sánchez Bach 1024a7c7c4 Mouse support added
*Implemented 'cellMouse*' functions from 'sys_io' module, which are part
of the libmouse library.

* Added corresponding entries in the 'Config > Settings' menu to change
the handler of the mouse. Supported handlers: Windows, Null.

* cellGifDec: Fixed some errors and added support for RGBA color.

(Remember: The mouse support is very experimental)
2013-09-14 20:20:57 +02:00
Alexandro Sánchez Bach 1b7302c0ba Keybord support improved
*Improved Keyboard:
- Fixed crash when using Null keyboard handler
- Added support for meta keys
- Added support for {caps, num, scroll} lock.

*Small issues fixed in previous module:
- cellGifDec: Fixed wrong information of packet field in
cellGifDecReadHeader.
- cellGifDec: Set DataOutInfo.recordType as 1 since the output is always
an image.
- cellJpgDec: Set colorSpace as 3, until a better function is
implemented.
- cellJpgDec, cellPngDec: Added RGBA support.

*Changed layout of "Config > Settings" menu.
2013-09-13 19:29:54 +02:00
Alexandro Sánchez Bach 4835ae35af Keybord support Added
* Implemented 'cellKb*' functions from 'sys_io' module, which are part
of the libkb library.

* Added corresponding entries in the 'Config > Settings' menu to change
the handler of the keyboard. Supported handlers: Windows, Null.

INFO: This keyboard library is *very* experimental and I am aware of
some bugs. There will be improvements soon.
2013-09-11 22:49:49 +02:00
Alexandro Sánchez Bach aea7f4aa77 cellGifDec Module Added
*Implemented 'cellGifDec', using 'sys_fs' to access the files and the
'stb_image' (stblib) library to decode GIF buffers to Raw-pixel buffers
that can be used as textures.

*Replace 'lodepng' and 'jpeg-compressor' libraries with 'stb_image' in
cellPngDec and cellJpgDec, respectively.

*Fixed minor issues in cellPngDec and cellJpgDec.
2013-09-10 15:17:02 +02:00
Alexandro Sánchez Bach 0275b430cf cellJpgDec Module Added
*Replaced "sys_jpgdec" with "cellJpgDec" in
"rpcs3\Emu\SysCalls\Modules.cpp".
*Implemented 'cellJpgDec', using 'sys_fs' to access the files and the
'jpg-compressor' (jpgd) library to decode JPG buffers to Raw-pixel
buffers that can be
used as textures.
*Fixed memory leak issue in cellPngDec and minor changes.
2013-09-09 18:27:31 +02:00
Alexandro Sánchez Bach 3123432dcc cellPngDec Module Added
Implemented 'cellPngDec', using 'sys_fs' to access the files and the
'lodepng' library to decode PNG buffers to Raw-pixel buffers that can be
used as textures.
2013-09-08 10:45:10 +02:00
DHrpcs3 43e0c84f64 Merge pull request #2 from cornytrace/master
Several small improvements
2013-09-05 03:44:45 -07:00
Cornee Traas eefd175900 Fix more spelling mistakes 2013-09-05 10:06:59 +02:00
Cornee Traas 9b921f3c2d Update .gitignore 2013-09-05 09:45:46 +02:00
Cornee Traas f25fa26b42 Refactor of game loading 2013-09-05 09:45:33 +02:00
Cornee Traas f4b98074b0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	rpcs3/Emu/GS/GL/GLGSRender.cpp
	rpcs3/Gui/InterpreterDisAsm.cpp
	rpcs3/Gui/MainFrame.cpp
2013-09-03 19:26:31 +02:00
Cornee Traas f42e6d7374 Update .gitignore to include git-version.h 2013-08-12 11:57:25 +02:00
Cornee Traas 96c692aefc Fix spelling of IsRunned to IsRunning 2013-08-12 11:56:56 +02:00
Cornee Traas d249bfef4d When debugging, put the git revision in the title
Useful for bug reports, user-friendly version still used when building
in release mode. A unix script for generating the git version is still
needed.
2013-08-11 00:09:27 +02:00
Cornee Traas cd3ad0b149 (indirectly) Fix ini boolean parsing error 2013-08-10 23:51:24 +02:00
Cornee Traas fafb88672a Fix debugger working directory 2013-08-10 23:48:54 +02:00
Cornee Traas 6fd824fcca Update .gitignore 2013-08-10 23:48:32 +02:00
2336 changed files with 101006 additions and 1016087 deletions
+48 -11
View File
@@ -9,21 +9,58 @@
# Compiled Static libraries
*.lai
*.la
*.a
/libs
# *.a # Commented out since OpenAL Soft's binaries use this extension.
*.opensdf
*.sdf
*.user
/bin/rpcs3.exe
/bin/RPCS3.log
*.suo
*.tlog
*.idb
*.pdb
*.obj
*.ilk
*.pch
*.log
*.exe
*.dll
*.elf
*.lastbuildstate
*.unsuccessfulbuild
*.res
*.dump
*.wav
/libs
/ipch
/rpcs3/Debug
/rpcs3/Release
/wxWidgets/lib
/bin/rpcs3.ini
/bin/compiled.elf
/bin/FragmentProgram.txt
/bin/VertexDataArray.dump
/bin/VertexProgram.txt
/bin/BreakPoints.dat
/bin/textures
*.suo
/rpcs3/Debug
/rpcs3/Release
/ipch
/bin/*.lib
/bin/*.exp
rpcs3/git-version.h
# Visual Studio Profiler Files
*.vspx
*.psess
# Copyrighted files
/bin/data/
/bin/dev_flash/data/font
/bin/dev_flash/sys
/bin/dev_flash/vsh
# Ignore installed games except test homebrews
!/bin/dev_hdd0/game/
/bin/dev_hdd0/game/*
!/bin/dev_hdd0/game/TEST12345/
# Ignore other system generated files
bin/dev_hdd0/log.txt
x64/Debug/emucore.lib
x64/Release/emucore.lib
+10
View File
@@ -0,0 +1,10 @@
[submodule "wxWidgets"]
path = wxWidgets
url = https://github.com/DHrpcs3/wxWidgets.git
ignore = dirty
[submodule "rpcs3-ffmpeg"]
path = ffmpeg
url = https://github.com/hrydgard/ppsspp-ffmpeg
[submodule "asmjit"]
path = asmjit
url = https://github.com/kobalicekp/asmjit
+35
View File
@@ -0,0 +1,35 @@
language: cpp
compiler:
- clang
- gcc
branches:
only:
- master
before_install:
- echo "yes" | sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
- echo "yes" | sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ precise universe'
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update
- sudo apt-get install libwxgtk3.0-dev libopenal-dev freeglut3-dev libglew-dev
- sudo apt-get install aria2 -qq
- download_extract() { aria2c -x 16 $1 -o $2 && tar -xf $2; }
# Travis uses CMake 2.8.7. We require 2.8.8. Grab latest
- sudo apt-get install -qq g++-4.8
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- sudo apt-get install lib32stdc++6 -qq &&
aria2c -x 16 http://www.cmake.org/files/v2.8/cmake-2.8.12.1-Linux-i386.sh &&
chmod a+x cmake-2.8.12.1-Linux-i386.sh &&
sudo ./cmake-2.8.12.1-Linux-i386.sh --skip-license --prefix=/usr;
before_script:
- git submodule update --init --recursive
- mkdir build
- cd build
- cmake ..
script:
- make
+6
View File
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 2.8)
set(ASMJIT_STATIC TRUE)
add_subdirectory( asmjit )
add_subdirectory( rpcs3 )
+339
View File
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
Binary file not shown.
+656
View File
@@ -0,0 +1,656 @@
#ifndef AL_AL_H
#define AL_AL_H
#if defined(__cplusplus)
extern "C" {
#endif
#ifndef AL_API
#if defined(AL_LIBTYPE_STATIC)
#define AL_API
#elif defined(_WIN32)
#define AL_API __declspec(dllimport)
#else
#define AL_API extern
#endif
#endif
#if defined(_WIN32)
#define AL_APIENTRY __cdecl
#else
#define AL_APIENTRY
#endif
/** Deprecated macro. */
#define OPENAL
#define ALAPI AL_API
#define ALAPIENTRY AL_APIENTRY
#define AL_INVALID (-1)
#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
/** Supported AL version. */
#define AL_VERSION_1_0
#define AL_VERSION_1_1
/** 8-bit boolean */
typedef char ALboolean;
/** character */
typedef char ALchar;
/** signed 8-bit 2's complement integer */
typedef signed char ALbyte;
/** unsigned 8-bit integer */
typedef unsigned char ALubyte;
/** signed 16-bit 2's complement integer */
typedef short ALshort;
/** unsigned 16-bit integer */
typedef unsigned short ALushort;
/** signed 32-bit 2's complement integer */
typedef int ALint;
/** unsigned 32-bit integer */
typedef unsigned int ALuint;
/** non-negative 32-bit binary integer size */
typedef int ALsizei;
/** enumerated 32-bit value */
typedef int ALenum;
/** 32-bit IEEE754 floating-point */
typedef float ALfloat;
/** 64-bit IEEE754 floating-point */
typedef double ALdouble;
/** void type (for opaque pointers only) */
typedef void ALvoid;
/* Enumerant values begin at column 50. No tabs. */
/** "no distance model" or "no buffer" */
#define AL_NONE 0
/** Boolean False. */
#define AL_FALSE 0
/** Boolean True. */
#define AL_TRUE 1
/**
* Relative source.
* Type: ALboolean
* Range: [AL_TRUE, AL_FALSE]
* Default: AL_FALSE
*
* Specifies if the Source has relative coordinates.
*/
#define AL_SOURCE_RELATIVE 0x202
/**
* Inner cone angle, in degrees.
* Type: ALint, ALfloat
* Range: [0 - 360]
* Default: 360
*
* The angle covered by the inner cone, where the source will not attenuate.
*/
#define AL_CONE_INNER_ANGLE 0x1001
/**
* Outer cone angle, in degrees.
* Range: [0 - 360]
* Default: 360
*
* The angle covered by the outer cone, where the source will be fully
* attenuated.
*/
#define AL_CONE_OUTER_ANGLE 0x1002
/**
* Source pitch.
* Type: ALfloat
* Range: [0.5 - 2.0]
* Default: 1.0
*
* A multiplier for the frequency (sample rate) of the source's buffer.
*/
#define AL_PITCH 0x1003
/**
* Source or listener position.
* Type: ALfloat[3], ALint[3]
* Default: {0, 0, 0}
*
* The source or listener location in three dimensional space.
*
* OpenAL, like OpenGL, uses a right handed coordinate system, where in a
* frontal default view X (thumb) points right, Y points up (index finger), and
* Z points towards the viewer/camera (middle finger).
*
* To switch from a left handed coordinate system, flip the sign on the Z
* coordinate.
*/
#define AL_POSITION 0x1004
/**
* Source direction.
* Type: ALfloat[3], ALint[3]
* Default: {0, 0, 0}
*
* Specifies the current direction in local space.
* A zero-length vector specifies an omni-directional source (cone is ignored).
*/
#define AL_DIRECTION 0x1005
/**
* Source or listener velocity.
* Type: ALfloat[3], ALint[3]
* Default: {0, 0, 0}
*
* Specifies the current velocity in local space.
*/
#define AL_VELOCITY 0x1006
/**
* Source looping.
* Type: ALboolean
* Range: [AL_TRUE, AL_FALSE]
* Default: AL_FALSE
*
* Specifies whether source is looping.
*/
#define AL_LOOPING 0x1007
/**
* Source buffer.
* Type: ALuint
* Range: any valid Buffer.
*
* Specifies the buffer to provide sound samples.
*/
#define AL_BUFFER 0x1009
/**
* Source or listener gain.
* Type: ALfloat
* Range: [0.0 - ]
*
* A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
* of about -6dB. Each multiplicaton by 2 equals an amplification of about
* +6dB.
*
* A value of 0.0 is meaningless with respect to a logarithmic scale; it is
* silent.
*/
#define AL_GAIN 0x100A
/**
* Minimum source gain.
* Type: ALfloat
* Range: [0.0 - 1.0]
*
* The minimum gain allowed for a source, after distance and cone attenation is
* applied (if applicable).
*/
#define AL_MIN_GAIN 0x100D
/**
* Maximum source gain.
* Type: ALfloat
* Range: [0.0 - 1.0]
*
* The maximum gain allowed for a source, after distance and cone attenation is
* applied (if applicable).
*/
#define AL_MAX_GAIN 0x100E
/**
* Listener orientation.
* Type: ALfloat[6]
* Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0}
*
* Effectively two three dimensional vectors. The first vector is the front (or
* "at") and the second is the top (or "up").
*
* Both vectors are in local space.
*/
#define AL_ORIENTATION 0x100F
/**
* Source state (query only).
* Type: ALint
* Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED]
*/
#define AL_SOURCE_STATE 0x1010
/** Source state value. */
#define AL_INITIAL 0x1011
#define AL_PLAYING 0x1012
#define AL_PAUSED 0x1013
#define AL_STOPPED 0x1014
/**
* Source Buffer Queue size (query only).
* Type: ALint
*
* The number of buffers queued using alSourceQueueBuffers, minus the buffers
* removed with alSourceUnqueueBuffers.
*/
#define AL_BUFFERS_QUEUED 0x1015
/**
* Source Buffer Queue processed count (query only).
* Type: ALint
*
* The number of queued buffers that have been fully processed, and can be
* removed with alSourceUnqueueBuffers.
*
* Looping sources will never fully process buffers because they will be set to
* play again for when the source loops.
*/
#define AL_BUFFERS_PROCESSED 0x1016
/**
* Source reference distance.
* Type: ALfloat
* Range: [0.0 - ]
* Default: 1.0
*
* The distance in units that no attenuation occurs.
*
* At 0.0, no distance attenuation ever occurs on non-linear attenuation models.
*/
#define AL_REFERENCE_DISTANCE 0x1020
/**
* Source rolloff factor.
* Type: ALfloat
* Range: [0.0 - ]
* Default: 1.0
*
* Multiplier to exaggerate or diminish distance attenuation.
*
* At 0.0, no distance attenuation ever occurs.
*/
#define AL_ROLLOFF_FACTOR 0x1021
/**
* Outer cone gain.
* Type: ALfloat
* Range: [0.0 - 1.0]
* Default: 0.0
*
* The gain attenuation applied when the listener is outside of the source's
* outer cone.
*/
#define AL_CONE_OUTER_GAIN 0x1022
/**
* Source maximum distance.
* Type: ALfloat
* Range: [0.0 - ]
* Default: +inf
*
* The distance above which the source is not attenuated any further with a
* clamped distance model, or where attenuation reaches 0.0 gain for linear
* distance models with a default rolloff factor.
*/
#define AL_MAX_DISTANCE 0x1023
/** Source buffer position, in seconds */
#define AL_SEC_OFFSET 0x1024
/** Source buffer position, in sample frames */
#define AL_SAMPLE_OFFSET 0x1025
/** Source buffer position, in bytes */
#define AL_BYTE_OFFSET 0x1026
/**
* Source type (query only).
* Type: ALint
* Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED]
*
* A Source is Static if a Buffer has been attached using AL_BUFFER.
*
* A Source is Streaming if one or more Buffers have been attached using
* alSourceQueueBuffers.
*
* A Source is Undetermined when it has the NULL buffer attached using
* AL_BUFFER.
*/
#define AL_SOURCE_TYPE 0x1027
/** Source type value. */
#define AL_STATIC 0x1028
#define AL_STREAMING 0x1029
#define AL_UNDETERMINED 0x1030
/** Buffer format specifier. */
#define AL_FORMAT_MONO8 0x1100
#define AL_FORMAT_MONO16 0x1101
#define AL_FORMAT_STEREO8 0x1102
#define AL_FORMAT_STEREO16 0x1103
/** Buffer frequency (query only). */
#define AL_FREQUENCY 0x2001
/** Buffer bits per sample (query only). */
#define AL_BITS 0x2002
/** Buffer channel count (query only). */
#define AL_CHANNELS 0x2003
/** Buffer data size (query only). */
#define AL_SIZE 0x2004
/**
* Buffer state.
*
* Not for public use.
*/
#define AL_UNUSED 0x2010
#define AL_PENDING 0x2011
#define AL_PROCESSED 0x2012
/** No error. */
#define AL_NO_ERROR 0
/** Invalid name paramater passed to AL call. */
#define AL_INVALID_NAME 0xA001
/** Invalid enum parameter passed to AL call. */
#define AL_INVALID_ENUM 0xA002
/** Invalid value parameter passed to AL call. */
#define AL_INVALID_VALUE 0xA003
/** Illegal AL call. */
#define AL_INVALID_OPERATION 0xA004
/** Not enough memory. */
#define AL_OUT_OF_MEMORY 0xA005
/** Context string: Vendor ID. */
#define AL_VENDOR 0xB001
/** Context string: Version. */
#define AL_VERSION 0xB002
/** Context string: Renderer ID. */
#define AL_RENDERER 0xB003
/** Context string: Space-separated extension list. */
#define AL_EXTENSIONS 0xB004
/**
* Doppler scale.
* Type: ALfloat
* Range: [0.0 - ]
* Default: 1.0
*
* Scale for source and listener velocities.
*/
#define AL_DOPPLER_FACTOR 0xC000
AL_API void AL_APIENTRY alDopplerFactor(ALfloat value);
/**
* Doppler velocity (deprecated).
*
* A multiplier applied to the Speed of Sound.
*/
#define AL_DOPPLER_VELOCITY 0xC001
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value);
/**
* Speed of Sound, in units per second.
* Type: ALfloat
* Range: [0.0001 - ]
* Default: 343.3
*
* The speed at which sound waves are assumed to travel, when calculating the
* doppler effect.
*/
#define AL_SPEED_OF_SOUND 0xC003
AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value);
/**
* Distance attenuation model.
* Type: ALint
* Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED,
* AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED,
* AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED]
* Default: AL_INVERSE_DISTANCE_CLAMPED
*
* The model by which sources attenuate with distance.
*
* None - No distance attenuation.
* Inverse - Doubling the distance halves the source gain.
* Linear - Linear gain scaling between the reference and max distances.
* Exponent - Exponential gain dropoff.
*
* Clamped variations work like the non-clamped counterparts, except the
* distance calculated is clamped between the reference and max distances.
*/
#define AL_DISTANCE_MODEL 0xD000
AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel);
/** Distance model value. */
#define AL_INVERSE_DISTANCE 0xD001
#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
#define AL_LINEAR_DISTANCE 0xD003
#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
#define AL_EXPONENT_DISTANCE 0xD005
#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
/** Renderer State management. */
AL_API void AL_APIENTRY alEnable(ALenum capability);
AL_API void AL_APIENTRY alDisable(ALenum capability);
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability);
/** State retrieval. */
AL_API const ALchar* AL_APIENTRY alGetString(ALenum param);
AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values);
AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values);
AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values);
AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param);
AL_API ALint AL_APIENTRY alGetInteger(ALenum param);
AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param);
AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param);
/**
* Error retrieval.
*
* Obtain the first error generated in the AL context since the last check.
*/
AL_API ALenum AL_APIENTRY alGetError(void);
/**
* Extension support.
*
* Query for the presence of an extension, and obtain any appropriate function
* pointers and enum values.
*/
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname);
AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname);
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename);
/** Set Listener parameters */
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value);
AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values);
AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value);
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3);
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values);
/** Get Listener parameters */
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value);
AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value);
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3);
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values);
/** Create Source objects. */
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources);
/** Delete Source objects. */
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources);
/** Verify a handle is a valid Source. */
AL_API ALboolean AL_APIENTRY alIsSource(ALuint source);
/** Set Source parameters. */
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value);
AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values);
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value);
AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values);
/** Get Source parameters. */
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value);
AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value);
AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values);
/** Play, replay, or resume (if paused) a list of Sources */
AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources);
/** Stop a list of Sources */
AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources);
/** Rewind a list of Sources */
AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources);
/** Pause a list of Sources */
AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources);
/** Play, replay, or resume a Source */
AL_API void AL_APIENTRY alSourcePlay(ALuint source);
/** Stop a Source */
AL_API void AL_APIENTRY alSourceStop(ALuint source);
/** Rewind a Source (set playback postiton to beginning) */
AL_API void AL_APIENTRY alSourceRewind(ALuint source);
/** Pause a Source */
AL_API void AL_APIENTRY alSourcePause(ALuint source);
/** Queue buffers onto a source */
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers);
/** Unqueue processed buffers from a source */
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers);
/** Create Buffer objects */
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers);
/** Delete Buffer objects */
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers);
/** Verify a handle is a valid Buffer */
AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer);
/** Specifies the data to be copied into a buffer */
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
/** Set Buffer parameters, */
AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value);
AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values);
AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value);
AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values);
/** Get Buffer parameters. */
AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value);
AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value);
AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values);
/** Pointer-to-function type, useful for dynamically getting AL entry points. */
typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability);
typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability);
typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability);
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param);
typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values);
typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values);
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param);
typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param);
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param);
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param);
typedef ALenum (AL_APIENTRY *LPALGETERROR)(void);
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname);
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname);
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename);
typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value);
typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values);
typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value);
typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3);
typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values);
typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value);
typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value);
typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3);
typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources);
typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources);
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value);
typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values);
typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value);
typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values);
typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value);
typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value);
typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers);
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers);
typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers);
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers);
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer);
typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value);
typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values);
typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value);
typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values);
typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value);
typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value);
typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value);
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value);
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value);
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel);
#if defined(__cplusplus)
} /* extern "C" */
#endif
#endif /* AL_AL_H */
+237
View File
@@ -0,0 +1,237 @@
#ifndef AL_ALC_H
#define AL_ALC_H
#if defined(__cplusplus)
extern "C" {
#endif
#ifndef ALC_API
#if defined(AL_LIBTYPE_STATIC)
#define ALC_API
#elif defined(_WIN32)
#define ALC_API __declspec(dllimport)
#else
#define ALC_API extern
#endif
#endif
#if defined(_WIN32)
#define ALC_APIENTRY __cdecl
#else
#define ALC_APIENTRY
#endif
/** Deprecated macro. */
#define ALCAPI ALC_API
#define ALCAPIENTRY ALC_APIENTRY
#define ALC_INVALID 0
/** Supported ALC version? */
#define ALC_VERSION_0_1 1
/** Opaque device handle */
typedef struct ALCdevice_struct ALCdevice;
/** Opaque context handle */
typedef struct ALCcontext_struct ALCcontext;
/** 8-bit boolean */
typedef char ALCboolean;
/** character */
typedef char ALCchar;
/** signed 8-bit 2's complement integer */
typedef signed char ALCbyte;
/** unsigned 8-bit integer */
typedef unsigned char ALCubyte;
/** signed 16-bit 2's complement integer */
typedef short ALCshort;
/** unsigned 16-bit integer */
typedef unsigned short ALCushort;
/** signed 32-bit 2's complement integer */
typedef int ALCint;
/** unsigned 32-bit integer */
typedef unsigned int ALCuint;
/** non-negative 32-bit binary integer size */
typedef int ALCsizei;
/** enumerated 32-bit value */
typedef int ALCenum;
/** 32-bit IEEE754 floating-point */
typedef float ALCfloat;
/** 64-bit IEEE754 floating-point */
typedef double ALCdouble;
/** void type (for opaque pointers only) */
typedef void ALCvoid;
/* Enumerant values begin at column 50. No tabs. */
/** Boolean False. */
#define ALC_FALSE 0
/** Boolean True. */
#define ALC_TRUE 1
/** Context attribute: <int> Hz. */
#define ALC_FREQUENCY 0x1007
/** Context attribute: <int> Hz. */
#define ALC_REFRESH 0x1008
/** Context attribute: AL_TRUE or AL_FALSE. */
#define ALC_SYNC 0x1009
/** Context attribute: <int> requested Mono (3D) Sources. */
#define ALC_MONO_SOURCES 0x1010
/** Context attribute: <int> requested Stereo Sources. */
#define ALC_STEREO_SOURCES 0x1011
/** No error. */
#define ALC_NO_ERROR 0
/** Invalid device handle. */
#define ALC_INVALID_DEVICE 0xA001
/** Invalid context handle. */
#define ALC_INVALID_CONTEXT 0xA002
/** Invalid enum parameter passed to an ALC call. */
#define ALC_INVALID_ENUM 0xA003
/** Invalid value parameter passed to an ALC call. */
#define ALC_INVALID_VALUE 0xA004
/** Out of memory. */
#define ALC_OUT_OF_MEMORY 0xA005
/** Runtime ALC version. */
#define ALC_MAJOR_VERSION 0x1000
#define ALC_MINOR_VERSION 0x1001
/** Context attribute list properties. */
#define ALC_ATTRIBUTES_SIZE 0x1002
#define ALC_ALL_ATTRIBUTES 0x1003
/** String for the default device specifier. */
#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
/**
* String for the given device's specifier.
*
* If device handle is NULL, it is instead a null-char separated list of
* strings of known device specifiers (list ends with an empty string).
*/
#define ALC_DEVICE_SPECIFIER 0x1005
/** String for space-separated list of ALC extensions. */
#define ALC_EXTENSIONS 0x1006
/** Capture extension */
#define ALC_EXT_CAPTURE 1
/**
* String for the given capture device's specifier.
*
* If device handle is NULL, it is instead a null-char separated list of
* strings of known capture device specifiers (list ends with an empty string).
*/
#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
/** String for the default capture device specifier. */
#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
/** Number of sample frames available for capture. */
#define ALC_CAPTURE_SAMPLES 0x312
/** Enumerate All extension */
#define ALC_ENUMERATE_ALL_EXT 1
/** String for the default extended device specifier. */
#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
/**
* String for the given extended device's specifier.
*
* If device handle is NULL, it is instead a null-char separated list of
* strings of known extended device specifiers (list ends with an empty string).
*/
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
/** Context management. */
ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
/** Device management. */
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
/**
* Error support.
*
* Obtain the most recent Device error.
*/
ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
/**
* Extension support.
*
* Query for the presence of an extension, and obtain any appropriate
* function pointers and enum values.
*/
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
/** Query function. */
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
/** Capture function. */
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
/** Pointer-to-function type, useful for dynamically getting ALC entry points. */
typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
#if defined(__cplusplus)
}
#endif
#endif /* AL_ALC_H */
+355
View File
@@ -0,0 +1,355 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 2008 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#ifndef AL_ALEXT_H
#define AL_ALEXT_H
#include <stddef.h>
/* Define int64_t and uint64_t types */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#endif
#include "alc.h"
#include "al.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef AL_LOKI_IMA_ADPCM_format
#define AL_LOKI_IMA_ADPCM_format 1
#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000
#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001
#endif
#ifndef AL_LOKI_WAVE_format
#define AL_LOKI_WAVE_format 1
#define AL_FORMAT_WAVE_EXT 0x10002
#endif
#ifndef AL_EXT_vorbis
#define AL_EXT_vorbis 1
#define AL_FORMAT_VORBIS_EXT 0x10003
#endif
#ifndef AL_LOKI_quadriphonic
#define AL_LOKI_quadriphonic 1
#define AL_FORMAT_QUAD8_LOKI 0x10004
#define AL_FORMAT_QUAD16_LOKI 0x10005
#endif
#ifndef AL_EXT_float32
#define AL_EXT_float32 1
#define AL_FORMAT_MONO_FLOAT32 0x10010
#define AL_FORMAT_STEREO_FLOAT32 0x10011
#endif
#ifndef AL_EXT_double
#define AL_EXT_double 1
#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012
#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013
#endif
#ifndef AL_EXT_MULAW
#define AL_EXT_MULAW 1
#define AL_FORMAT_MONO_MULAW_EXT 0x10014
#define AL_FORMAT_STEREO_MULAW_EXT 0x10015
#endif
#ifndef AL_EXT_ALAW
#define AL_EXT_ALAW 1
#define AL_FORMAT_MONO_ALAW_EXT 0x10016
#define AL_FORMAT_STEREO_ALAW_EXT 0x10017
#endif
#ifndef ALC_LOKI_audio_channel
#define ALC_LOKI_audio_channel 1
#define ALC_CHAN_MAIN_LOKI 0x500001
#define ALC_CHAN_PCM_LOKI 0x500002
#define ALC_CHAN_CD_LOKI 0x500003
#endif
#ifndef AL_EXT_MCFORMATS
#define AL_EXT_MCFORMATS 1
#define AL_FORMAT_QUAD8 0x1204
#define AL_FORMAT_QUAD16 0x1205
#define AL_FORMAT_QUAD32 0x1206
#define AL_FORMAT_REAR8 0x1207
#define AL_FORMAT_REAR16 0x1208
#define AL_FORMAT_REAR32 0x1209
#define AL_FORMAT_51CHN8 0x120A
#define AL_FORMAT_51CHN16 0x120B
#define AL_FORMAT_51CHN32 0x120C
#define AL_FORMAT_61CHN8 0x120D
#define AL_FORMAT_61CHN16 0x120E
#define AL_FORMAT_61CHN32 0x120F
#define AL_FORMAT_71CHN8 0x1210
#define AL_FORMAT_71CHN16 0x1211
#define AL_FORMAT_71CHN32 0x1212
#endif
#ifndef AL_EXT_MULAW_MCFORMATS
#define AL_EXT_MULAW_MCFORMATS 1
#define AL_FORMAT_MONO_MULAW 0x10014
#define AL_FORMAT_STEREO_MULAW 0x10015
#define AL_FORMAT_QUAD_MULAW 0x10021
#define AL_FORMAT_REAR_MULAW 0x10022
#define AL_FORMAT_51CHN_MULAW 0x10023
#define AL_FORMAT_61CHN_MULAW 0x10024
#define AL_FORMAT_71CHN_MULAW 0x10025
#endif
#ifndef AL_EXT_IMA4
#define AL_EXT_IMA4 1
#define AL_FORMAT_MONO_IMA4 0x1300
#define AL_FORMAT_STEREO_IMA4 0x1301
#endif
#ifndef AL_EXT_STATIC_BUFFER
#define AL_EXT_STATIC_BUFFER 1
typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei);
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq);
#endif
#endif
#ifndef ALC_EXT_EFX
#define ALC_EXT_EFX 1
#include "efx.h"
#endif
#ifndef ALC_EXT_disconnect
#define ALC_EXT_disconnect 1
#define ALC_CONNECTED 0x313
#endif
#ifndef ALC_EXT_thread_local_context
#define ALC_EXT_thread_local_context 1
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context);
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void);
#ifdef AL_ALEXT_PROTOTYPES
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context);
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
#endif
#endif
#ifndef AL_EXT_source_distance_model
#define AL_EXT_source_distance_model 1
#define AL_SOURCE_DISTANCE_MODEL 0x200
#endif
#ifndef AL_SOFT_buffer_sub_data
#define AL_SOFT_buffer_sub_data 1
#define AL_BYTE_RW_OFFSETS_SOFT 0x1031
#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length);
#endif
#endif
#ifndef AL_SOFT_loop_points
#define AL_SOFT_loop_points 1
#define AL_LOOP_POINTS_SOFT 0x2015
#endif
#ifndef AL_EXT_FOLDBACK
#define AL_EXT_FOLDBACK 1
#define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK"
#define AL_FOLDBACK_EVENT_BLOCK 0x4112
#define AL_FOLDBACK_EVENT_START 0x4111
#define AL_FOLDBACK_EVENT_STOP 0x4113
#define AL_FOLDBACK_MODE_MONO 0x4101
#define AL_FOLDBACK_MODE_STEREO 0x4102
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei);
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK);
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void);
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback);
AL_API void AL_APIENTRY alRequestFoldbackStop(void);
#endif
#endif
#ifndef ALC_EXT_DEDICATED
#define ALC_EXT_DEDICATED 1
#define AL_DEDICATED_GAIN 0x0001
#define AL_EFFECT_DEDICATED_DIALOGUE 0x9001
#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000
#endif
#ifndef AL_SOFT_buffer_samples
#define AL_SOFT_buffer_samples 1
/* Channel configurations */
#define AL_MONO_SOFT 0x1500
#define AL_STEREO_SOFT 0x1501
#define AL_REAR_SOFT 0x1502
#define AL_QUAD_SOFT 0x1503
#define AL_5POINT1_SOFT 0x1504
#define AL_6POINT1_SOFT 0x1505
#define AL_7POINT1_SOFT 0x1506
/* Sample types */
#define AL_BYTE_SOFT 0x1400
#define AL_UNSIGNED_BYTE_SOFT 0x1401
#define AL_SHORT_SOFT 0x1402
#define AL_UNSIGNED_SHORT_SOFT 0x1403
#define AL_INT_SOFT 0x1404
#define AL_UNSIGNED_INT_SOFT 0x1405
#define AL_FLOAT_SOFT 0x1406
#define AL_DOUBLE_SOFT 0x1407
#define AL_BYTE3_SOFT 0x1408
#define AL_UNSIGNED_BYTE3_SOFT 0x1409
/* Storage formats */
#define AL_MONO8_SOFT 0x1100
#define AL_MONO16_SOFT 0x1101
#define AL_MONO32F_SOFT 0x10010
#define AL_STEREO8_SOFT 0x1102
#define AL_STEREO16_SOFT 0x1103
#define AL_STEREO32F_SOFT 0x10011
#define AL_QUAD8_SOFT 0x1204
#define AL_QUAD16_SOFT 0x1205
#define AL_QUAD32F_SOFT 0x1206
#define AL_REAR8_SOFT 0x1207
#define AL_REAR16_SOFT 0x1208
#define AL_REAR32F_SOFT 0x1209
#define AL_5POINT1_8_SOFT 0x120A
#define AL_5POINT1_16_SOFT 0x120B
#define AL_5POINT1_32F_SOFT 0x120C
#define AL_6POINT1_8_SOFT 0x120D
#define AL_6POINT1_16_SOFT 0x120E
#define AL_6POINT1_32F_SOFT 0x120F
#define AL_7POINT1_8_SOFT 0x1210
#define AL_7POINT1_16_SOFT 0x1211
#define AL_7POINT1_32F_SOFT 0x1212
/* Buffer attributes */
#define AL_INTERNAL_FORMAT_SOFT 0x2008
#define AL_BYTE_LENGTH_SOFT 0x2009
#define AL_SAMPLE_LENGTH_SOFT 0x200A
#define AL_SEC_LENGTH_SOFT 0x200B
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*);
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*);
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*);
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum);
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data);
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
#endif
#endif
#ifndef AL_SOFT_direct_channels
#define AL_SOFT_direct_channels 1
#define AL_DIRECT_CHANNELS_SOFT 0x1033
#endif
#ifndef ALC_SOFT_loopback
#define ALC_SOFT_loopback 1
#define ALC_FORMAT_CHANNELS_SOFT 0x1990
#define ALC_FORMAT_TYPE_SOFT 0x1991
/* Sample types */
#define ALC_BYTE_SOFT 0x1400
#define ALC_UNSIGNED_BYTE_SOFT 0x1401
#define ALC_SHORT_SOFT 0x1402
#define ALC_UNSIGNED_SHORT_SOFT 0x1403
#define ALC_INT_SOFT 0x1404
#define ALC_UNSIGNED_INT_SOFT 0x1405
#define ALC_FLOAT_SOFT 0x1406
/* Channel configurations */
#define ALC_MONO_SOFT 0x1500
#define ALC_STEREO_SOFT 0x1501
#define ALC_QUAD_SOFT 0x1503
#define ALC_5POINT1_SOFT 0x1504
#define ALC_6POINT1_SOFT 0x1505
#define ALC_7POINT1_SOFT 0x1506
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*);
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum);
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei);
#ifdef AL_ALEXT_PROTOTYPES
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName);
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type);
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
#endif
#endif
#ifndef AL_EXT_STEREO_ANGLES
#define AL_EXT_STEREO_ANGLES 1
#define AL_STEREO_ANGLES 0x1030
#endif
#ifndef AL_EXT_SOURCE_RADIUS
#define AL_EXT_SOURCE_RADIUS 1
#define AL_SOURCE_RADIUS 0x1031
#endif
#ifndef AL_SOFT_source_latency
#define AL_SOFT_source_latency 1
#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200
#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201
typedef int64_t ALint64SOFT;
typedef uint64_t ALuint64SOFT;
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble);
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble);
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*);
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT);
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT);
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*);
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value);
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3);
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values);
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value);
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3);
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values);
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value);
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3);
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values);
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value);
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3);
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
+3
View File
@@ -0,0 +1,3 @@
/* The tokens that would be defined here are already defined in efx.h. This
* empty file is here to provide compatibility with Windows-based projects
* that would include it. */
+402
View File
@@ -0,0 +1,402 @@
/* Reverb presets for EFX */
#ifndef EFX_PRESETS_H
#define EFX_PRESETS_H
#ifndef EFXEAXREVERBPROPERTIES_DEFINED
#define EFXEAXREVERBPROPERTIES_DEFINED
typedef struct {
float flDensity;
float flDiffusion;
float flGain;
float flGainHF;
float flGainLF;
float flDecayTime;
float flDecayHFRatio;
float flDecayLFRatio;
float flReflectionsGain;
float flReflectionsDelay;
float flReflectionsPan[3];
float flLateReverbGain;
float flLateReverbDelay;
float flLateReverbPan[3];
float flEchoTime;
float flEchoDepth;
float flModulationTime;
float flModulationDepth;
float flAirAbsorptionGainHF;
float flHFReference;
float flLFReference;
float flRoomRolloffFactor;
int iDecayHFLimit;
} EFXEAXREVERBPROPERTIES, *LPEFXEAXREVERBPROPERTIES;
#endif
/* Default Presets */
#define EFX_REVERB_PRESET_GENERIC \
{ 1.0000f, 1.0000f, 0.3162f, 0.8913f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PADDEDCELL \
{ 0.1715f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.1700f, 0.1000f, 1.0000f, 0.2500f, 0.0010f, { 0.0000f, 0.0000f, 0.0000f }, 1.2691f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ROOM \
{ 0.4287f, 1.0000f, 0.3162f, 0.5929f, 1.0000f, 0.4000f, 0.8300f, 1.0000f, 0.1503f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.0629f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_BATHROOM \
{ 0.1715f, 1.0000f, 0.3162f, 0.2512f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.6531f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 3.2734f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_LIVINGROOM \
{ 0.9766f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.5000f, 0.1000f, 1.0000f, 0.2051f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2805f, 0.0040f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_STONEROOM \
{ 1.0000f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 2.3100f, 0.6400f, 1.0000f, 0.4411f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1003f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_AUDITORIUM \
{ 1.0000f, 1.0000f, 0.3162f, 0.5781f, 1.0000f, 4.3200f, 0.5900f, 1.0000f, 0.4032f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7170f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CONCERTHALL \
{ 1.0000f, 1.0000f, 0.3162f, 0.5623f, 1.0000f, 3.9200f, 0.7000f, 1.0000f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.9977f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CAVE \
{ 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 2.9100f, 1.3000f, 1.0000f, 0.5000f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.7063f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_ARENA \
{ 1.0000f, 1.0000f, 0.3162f, 0.4477f, 1.0000f, 7.2400f, 0.3300f, 1.0000f, 0.2612f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.0186f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_HANGAR \
{ 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 10.0500f, 0.2300f, 1.0000f, 0.5000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2560f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CARPETEDHALLWAY \
{ 0.4287f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 0.3000f, 0.1000f, 1.0000f, 0.1215f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.1531f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_HALLWAY \
{ 0.3645f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 1.4900f, 0.5900f, 1.0000f, 0.2458f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.6615f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_STONECORRIDOR \
{ 1.0000f, 1.0000f, 0.3162f, 0.7612f, 1.0000f, 2.7000f, 0.7900f, 1.0000f, 0.2472f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 1.5758f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ALLEY \
{ 1.0000f, 0.3000f, 0.3162f, 0.7328f, 1.0000f, 1.4900f, 0.8600f, 1.0000f, 0.2500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.9954f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.9500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FOREST \
{ 1.0000f, 0.3000f, 0.3162f, 0.0224f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.0525f, 0.1620f, { 0.0000f, 0.0000f, 0.0000f }, 0.7682f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CITY \
{ 1.0000f, 0.5000f, 0.3162f, 0.3981f, 1.0000f, 1.4900f, 0.6700f, 1.0000f, 0.0730f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1427f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_MOUNTAINS \
{ 1.0000f, 0.2700f, 0.3162f, 0.0562f, 1.0000f, 1.4900f, 0.2100f, 1.0000f, 0.0407f, 0.3000f, { 0.0000f, 0.0000f, 0.0000f }, 0.1919f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_QUARRY \
{ 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0000f, 0.0610f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.7000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PLAIN \
{ 1.0000f, 0.2100f, 0.3162f, 0.1000f, 1.0000f, 1.4900f, 0.5000f, 1.0000f, 0.0585f, 0.1790f, { 0.0000f, 0.0000f, 0.0000f }, 0.1089f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PARKINGLOT \
{ 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 1.6500f, 1.5000f, 1.0000f, 0.2082f, 0.0080f, { 0.0000f, 0.0000f, 0.0000f }, 0.2652f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_SEWERPIPE \
{ 0.3071f, 0.8000f, 0.3162f, 0.3162f, 1.0000f, 2.8100f, 0.1400f, 1.0000f, 1.6387f, 0.0140f, { 0.0000f, 0.0000f, 0.0000f }, 3.2471f, 0.0210f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_UNDERWATER \
{ 0.3645f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 1.4900f, 0.1000f, 1.0000f, 0.5963f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 7.0795f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 1.1800f, 0.3480f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DRUGGED \
{ 0.4287f, 0.5000f, 0.3162f, 1.0000f, 1.0000f, 8.3900f, 1.3900f, 1.0000f, 0.8760f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 3.1081f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_DIZZY \
{ 0.3645f, 0.6000f, 0.3162f, 0.6310f, 1.0000f, 17.2300f, 0.5600f, 1.0000f, 0.1392f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4937f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.8100f, 0.3100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_PSYCHOTIC \
{ 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
/* Castle Presets */
#define EFX_REVERB_PRESET_CASTLE_SMALLROOM \
{ 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 1.2200f, 0.8300f, 0.3100f, 0.8913f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_SHORTPASSAGE \
{ 1.0000f, 0.8900f, 0.3162f, 0.3162f, 0.1000f, 2.3200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_MEDIUMROOM \
{ 1.0000f, 0.9300f, 0.3162f, 0.2818f, 0.1000f, 2.0400f, 0.8300f, 0.4600f, 0.6310f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1550f, 0.0300f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_LARGEROOM \
{ 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.1259f, 2.5300f, 0.8300f, 0.5000f, 0.4467f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1850f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_LONGPASSAGE \
{ 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 3.4200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_HALL \
{ 1.0000f, 0.8100f, 0.3162f, 0.2818f, 0.1778f, 3.1400f, 0.7900f, 0.6200f, 0.1778f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_CUPBOARD \
{ 1.0000f, 0.8900f, 0.3162f, 0.2818f, 0.1000f, 0.6700f, 0.8700f, 0.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 3.5481f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CASTLE_COURTYARD \
{ 1.0000f, 0.4200f, 0.3162f, 0.4467f, 0.1995f, 2.1300f, 0.6100f, 0.2300f, 0.2239f, 0.1600f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3700f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_CASTLE_ALCOVE \
{ 1.0000f, 0.8900f, 0.3162f, 0.5012f, 0.1000f, 1.6400f, 0.8700f, 0.3100f, 1.0000f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
/* Factory Presets */
#define EFX_REVERB_PRESET_FACTORY_SMALLROOM \
{ 0.3645f, 0.8200f, 0.3162f, 0.7943f, 0.5012f, 1.7200f, 0.6500f, 1.3100f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.1190f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_SHORTPASSAGE \
{ 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 2.5300f, 0.6500f, 1.3100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_MEDIUMROOM \
{ 0.4287f, 0.8200f, 0.2512f, 0.7943f, 0.5012f, 2.7600f, 0.6500f, 1.3100f, 0.2818f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1740f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_LARGEROOM \
{ 0.4287f, 0.7500f, 0.2512f, 0.7079f, 0.6310f, 4.2400f, 0.5100f, 1.3100f, 0.1778f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2310f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_LONGPASSAGE \
{ 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 4.0600f, 0.6500f, 1.3100f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_HALL \
{ 0.4287f, 0.7500f, 0.3162f, 0.7079f, 0.6310f, 7.4300f, 0.5100f, 1.3100f, 0.0631f, 0.0730f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_CUPBOARD \
{ 0.3071f, 0.6300f, 0.2512f, 0.7943f, 0.5012f, 0.4900f, 0.6500f, 1.3100f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.1070f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_COURTYARD \
{ 0.3071f, 0.5700f, 0.3162f, 0.3162f, 0.6310f, 2.3200f, 0.2900f, 0.5600f, 0.2239f, 0.1400f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2900f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_FACTORY_ALCOVE \
{ 0.3645f, 0.5900f, 0.2512f, 0.7943f, 0.5012f, 3.1400f, 0.6500f, 1.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1140f, 0.1000f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
/* Ice Palace Presets */
#define EFX_REVERB_PRESET_ICEPALACE_SMALLROOM \
{ 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 1.5100f, 1.5300f, 0.2700f, 0.8913f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1640f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_SHORTPASSAGE \
{ 1.0000f, 0.7500f, 0.3162f, 0.5623f, 0.2818f, 1.7900f, 1.4600f, 0.2800f, 0.5012f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_MEDIUMROOM \
{ 1.0000f, 0.8700f, 0.3162f, 0.5623f, 0.4467f, 2.2200f, 1.5300f, 0.3200f, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_LARGEROOM \
{ 1.0000f, 0.8100f, 0.3162f, 0.5623f, 0.4467f, 3.1400f, 1.5300f, 0.3200f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_LONGPASSAGE \
{ 1.0000f, 0.7700f, 0.3162f, 0.5623f, 0.3981f, 3.0100f, 1.4600f, 0.2800f, 0.7943f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.0400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_HALL \
{ 1.0000f, 0.7600f, 0.3162f, 0.4467f, 0.5623f, 5.4900f, 1.5300f, 0.3800f, 0.1122f, 0.0540f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0520f, { 0.0000f, 0.0000f, 0.0000f }, 0.2260f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_CUPBOARD \
{ 1.0000f, 0.8300f, 0.3162f, 0.5012f, 0.2239f, 0.7600f, 1.5300f, 0.2600f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1430f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_COURTYARD \
{ 1.0000f, 0.5900f, 0.3162f, 0.2818f, 0.3162f, 2.0400f, 1.2000f, 0.3800f, 0.3162f, 0.1730f, { 0.0000f, 0.0000f, 0.0000f }, 0.3162f, 0.0430f, { 0.0000f, 0.0000f, 0.0000f }, 0.2350f, 0.4800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_ICEPALACE_ALCOVE \
{ 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 2.7600f, 1.4600f, 0.2800f, 1.1220f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1610f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
/* Space Station Presets */
#define EFX_REVERB_PRESET_SPACESTATION_SMALLROOM \
{ 0.2109f, 0.7000f, 0.3162f, 0.7079f, 0.8913f, 1.7200f, 0.8200f, 0.5500f, 0.7943f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 0.1880f, 0.2600f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_SHORTPASSAGE \
{ 0.2109f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 3.5700f, 0.5000f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1720f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_MEDIUMROOM \
{ 0.2109f, 0.7500f, 0.3162f, 0.6310f, 0.8913f, 3.0100f, 0.5000f, 0.5500f, 0.3981f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2090f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_LARGEROOM \
{ 0.3645f, 0.8100f, 0.3162f, 0.6310f, 0.8913f, 3.8900f, 0.3800f, 0.6100f, 0.3162f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2330f, 0.2800f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_LONGPASSAGE \
{ 0.4287f, 0.8200f, 0.3162f, 0.6310f, 0.8913f, 4.6200f, 0.6200f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_HALL \
{ 0.4287f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 7.1100f, 0.3800f, 0.6100f, 0.1778f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2500f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_CUPBOARD \
{ 0.1715f, 0.5600f, 0.3162f, 0.7079f, 0.8913f, 0.7900f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1810f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPACESTATION_ALCOVE \
{ 0.2109f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.1600f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1920f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
/* Wooden Galleon Presets */
#define EFX_REVERB_PRESET_WOODEN_SMALLROOM \
{ 1.0000f, 1.0000f, 0.3162f, 0.1122f, 0.3162f, 0.7900f, 0.3200f, 0.8700f, 1.0000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_SHORTPASSAGE \
{ 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.7500f, 0.5000f, 0.8700f, 0.8913f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_MEDIUMROOM \
{ 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.2818f, 1.4700f, 0.4200f, 0.8200f, 0.8913f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_LARGEROOM \
{ 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.2818f, 2.6500f, 0.3300f, 0.8200f, 0.8913f, 0.0660f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_LONGPASSAGE \
{ 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.3162f, 1.9900f, 0.4000f, 0.7900f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4467f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_HALL \
{ 1.0000f, 1.0000f, 0.3162f, 0.0794f, 0.2818f, 3.4500f, 0.3000f, 0.8200f, 0.8913f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_CUPBOARD \
{ 1.0000f, 1.0000f, 0.3162f, 0.1413f, 0.3162f, 0.5600f, 0.4600f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_COURTYARD \
{ 1.0000f, 0.6500f, 0.3162f, 0.0794f, 0.3162f, 1.7900f, 0.3500f, 0.7900f, 0.5623f, 0.1230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_WOODEN_ALCOVE \
{ 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.2200f, 0.6200f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
/* Sports Presets */
#define EFX_REVERB_PRESET_SPORT_EMPTYSTADIUM \
{ 1.0000f, 1.0000f, 0.3162f, 0.4467f, 0.7943f, 6.2600f, 0.5100f, 1.1000f, 0.0631f, 0.1830f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPORT_SQUASHCOURT \
{ 1.0000f, 0.7500f, 0.3162f, 0.3162f, 0.7943f, 2.2200f, 0.9100f, 1.1600f, 0.4467f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1260f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPORT_SMALLSWIMMINGPOOL \
{ 1.0000f, 0.7000f, 0.3162f, 0.7943f, 0.8913f, 2.7600f, 1.2500f, 1.1400f, 0.6310f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_SPORT_LARGESWIMMINGPOOL \
{ 1.0000f, 0.8200f, 0.3162f, 0.7943f, 1.0000f, 5.4900f, 1.3100f, 1.1400f, 0.4467f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2220f, 0.5500f, 1.1590f, 0.2100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_SPORT_GYMNASIUM \
{ 1.0000f, 0.8100f, 0.3162f, 0.4467f, 0.8913f, 3.1400f, 1.0600f, 1.3500f, 0.3981f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0450f, { 0.0000f, 0.0000f, 0.0000f }, 0.1460f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPORT_FULLSTADIUM \
{ 1.0000f, 1.0000f, 0.3162f, 0.0708f, 0.7943f, 5.2500f, 0.1700f, 0.8000f, 0.1000f, 0.1880f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SPORT_STADIUMTANNOY \
{ 1.0000f, 0.7800f, 0.3162f, 0.5623f, 0.5012f, 2.5300f, 0.8800f, 0.6800f, 0.2818f, 0.2300f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
/* Prefab Presets */
#define EFX_REVERB_PRESET_PREFAB_WORKSHOP \
{ 0.4287f, 1.0000f, 0.3162f, 0.1413f, 0.3981f, 0.7600f, 1.0000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_PREFAB_SCHOOLROOM \
{ 0.4022f, 0.6900f, 0.3162f, 0.6310f, 0.5012f, 0.9800f, 0.4500f, 0.1800f, 1.4125f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PREFAB_PRACTISEROOM \
{ 0.4022f, 0.8700f, 0.3162f, 0.3981f, 0.5012f, 1.1200f, 0.5600f, 0.1800f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PREFAB_OUTHOUSE \
{ 1.0000f, 0.8200f, 0.3162f, 0.1122f, 0.1585f, 1.3800f, 0.3800f, 0.3500f, 0.8913f, 0.0240f, { 0.0000f, 0.0000f, -0.0000f }, 0.6310f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.1210f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_PREFAB_CARAVAN \
{ 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.1259f, 0.4300f, 1.5000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
/* Dome and Pipe Presets */
#define EFX_REVERB_PRESET_DOME_TOMB \
{ 1.0000f, 0.7900f, 0.3162f, 0.3548f, 0.2239f, 4.1800f, 0.2100f, 0.1000f, 0.3868f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 1.6788f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_PIPE_SMALL \
{ 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 5.0400f, 0.1000f, 0.1000f, 0.5012f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 2.5119f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DOME_SAINTPAULS \
{ 1.0000f, 0.8700f, 0.3162f, 0.3548f, 0.2239f, 10.4800f, 0.1900f, 0.1000f, 0.1778f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0420f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PIPE_LONGTHIN \
{ 0.2560f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 9.2100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_PIPE_LARGE \
{ 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 8.4500f, 0.1000f, 0.1000f, 0.3981f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_PIPE_RESONANT \
{ 0.1373f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 6.8100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 }
/* Outdoors Presets */
#define EFX_REVERB_PRESET_OUTDOORS_BACKYARD \
{ 1.0000f, 0.4500f, 0.3162f, 0.2512f, 0.5012f, 1.1200f, 0.3400f, 0.4600f, 0.4467f, 0.0690f, { 0.0000f, 0.0000f, -0.0000f }, 0.7079f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_OUTDOORS_ROLLINGPLAINS \
{ 1.0000f, 0.0000f, 0.3162f, 0.0112f, 0.6310f, 2.1300f, 0.2100f, 0.4600f, 0.1778f, 0.3000f, { 0.0000f, 0.0000f, -0.0000f }, 0.4467f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_OUTDOORS_DEEPCANYON \
{ 1.0000f, 0.7400f, 0.3162f, 0.1778f, 0.6310f, 3.8900f, 0.2100f, 0.4600f, 0.3162f, 0.2230f, { 0.0000f, 0.0000f, -0.0000f }, 0.3548f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_OUTDOORS_CREEK \
{ 1.0000f, 0.3500f, 0.3162f, 0.1778f, 0.5012f, 2.1300f, 0.2100f, 0.4600f, 0.3981f, 0.1150f, { 0.0000f, 0.0000f, -0.0000f }, 0.1995f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_OUTDOORS_VALLEY \
{ 1.0000f, 0.2800f, 0.3162f, 0.0282f, 0.1585f, 2.8800f, 0.2600f, 0.3500f, 0.1413f, 0.2630f, { 0.0000f, 0.0000f, -0.0000f }, 0.3981f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
/* Mood Presets */
#define EFX_REVERB_PRESET_MOOD_HEAVEN \
{ 1.0000f, 0.9400f, 0.3162f, 0.7943f, 0.4467f, 5.0400f, 1.1200f, 0.5600f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0800f, 2.7420f, 0.0500f, 0.9977f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_MOOD_HELL \
{ 1.0000f, 0.5700f, 0.3162f, 0.3548f, 0.4467f, 3.5700f, 0.4900f, 2.0000f, 0.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1100f, 0.0400f, 2.1090f, 0.5200f, 0.9943f, 5000.0000f, 139.5000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_MOOD_MEMORY \
{ 1.0000f, 0.8500f, 0.3162f, 0.6310f, 0.3548f, 4.0600f, 0.8200f, 0.5600f, 0.0398f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.4740f, 0.4500f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
/* Driving Presets */
#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \
{ 1.0000f, 0.0000f, 3.1623f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \
{ 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_DRIVING_INCAR_RACER \
{ 0.0832f, 0.8000f, 0.3162f, 1.0000f, 0.7943f, 0.1700f, 2.0000f, 0.4100f, 1.7783f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DRIVING_INCAR_SPORTS \
{ 0.0832f, 0.8000f, 0.3162f, 0.6310f, 1.0000f, 0.1700f, 0.7500f, 0.4100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DRIVING_INCAR_LUXURY \
{ 0.2560f, 1.0000f, 0.3162f, 0.1000f, 0.5012f, 0.1300f, 0.4100f, 0.4600f, 0.7943f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DRIVING_FULLGRANDSTAND \
{ 1.0000f, 1.0000f, 0.3162f, 0.2818f, 0.6310f, 3.0100f, 1.3700f, 1.2800f, 0.3548f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.1778f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_DRIVING_EMPTYGRANDSTAND \
{ 1.0000f, 1.0000f, 0.3162f, 1.0000f, 0.7943f, 4.6200f, 1.7500f, 1.4000f, 0.2082f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_DRIVING_TUNNEL \
{ 1.0000f, 0.8100f, 0.3162f, 0.3981f, 0.8913f, 3.4200f, 0.9400f, 1.3100f, 0.7079f, 0.0510f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.0500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 155.3000f, 0.0000f, 0x1 }
/* City Presets */
#define EFX_REVERB_PRESET_CITY_STREETS \
{ 1.0000f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.7900f, 1.1200f, 0.9100f, 0.2818f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 0.1995f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CITY_SUBWAY \
{ 1.0000f, 0.7400f, 0.3162f, 0.7079f, 0.8913f, 3.0100f, 1.2300f, 0.9100f, 0.7079f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CITY_MUSEUM \
{ 1.0000f, 0.8200f, 0.3162f, 0.1778f, 0.1778f, 3.2800f, 1.4000f, 0.5700f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_CITY_LIBRARY \
{ 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.0891f, 2.7600f, 0.8900f, 0.4100f, 0.3548f, 0.0290f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
#define EFX_REVERB_PRESET_CITY_UNDERPASS \
{ 1.0000f, 0.8200f, 0.3162f, 0.4467f, 0.8913f, 3.5700f, 1.1200f, 0.9100f, 0.3981f, 0.0590f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1400f, 0.2500f, 0.0000f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CITY_ABANDONED \
{ 1.0000f, 0.6900f, 0.3162f, 0.7943f, 0.8913f, 3.2800f, 1.1700f, 0.9100f, 0.4467f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9966f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
/* Misc. Presets */
#define EFX_REVERB_PRESET_DUSTYROOM \
{ 0.3645f, 0.5600f, 0.3162f, 0.7943f, 0.7079f, 1.7900f, 0.3800f, 0.2100f, 0.5012f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0060f, { 0.0000f, 0.0000f, 0.0000f }, 0.2020f, 0.0500f, 0.2500f, 0.0000f, 0.9886f, 13046.0000f, 163.3000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_CHAPEL \
{ 1.0000f, 0.8400f, 0.3162f, 0.5623f, 1.0000f, 4.6200f, 0.6400f, 1.2300f, 0.4467f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.1100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_SMALLWATERROOM \
{ 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
#endif /* EFX_PRESETS_H */
+761
View File
@@ -0,0 +1,761 @@
#ifndef AL_EFX_H
#define AL_EFX_H
#include "alc.h"
#include "al.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ALC_EXT_EFX_NAME "ALC_EXT_EFX"
#define ALC_EFX_MAJOR_VERSION 0x20001
#define ALC_EFX_MINOR_VERSION 0x20002
#define ALC_MAX_AUXILIARY_SENDS 0x20003
/* Listener properties. */
#define AL_METERS_PER_UNIT 0x20004
/* Source properties. */
#define AL_DIRECT_FILTER 0x20005
#define AL_AUXILIARY_SEND_FILTER 0x20006
#define AL_AIR_ABSORPTION_FACTOR 0x20007
#define AL_ROOM_ROLLOFF_FACTOR 0x20008
#define AL_CONE_OUTER_GAINHF 0x20009
#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A
#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B
#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C
/* Effect properties. */
/* Reverb effect parameters */
#define AL_REVERB_DENSITY 0x0001
#define AL_REVERB_DIFFUSION 0x0002
#define AL_REVERB_GAIN 0x0003
#define AL_REVERB_GAINHF 0x0004
#define AL_REVERB_DECAY_TIME 0x0005
#define AL_REVERB_DECAY_HFRATIO 0x0006
#define AL_REVERB_REFLECTIONS_GAIN 0x0007
#define AL_REVERB_REFLECTIONS_DELAY 0x0008
#define AL_REVERB_LATE_REVERB_GAIN 0x0009
#define AL_REVERB_LATE_REVERB_DELAY 0x000A
#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B
#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C
#define AL_REVERB_DECAY_HFLIMIT 0x000D
/* EAX Reverb effect parameters */
#define AL_EAXREVERB_DENSITY 0x0001
#define AL_EAXREVERB_DIFFUSION 0x0002
#define AL_EAXREVERB_GAIN 0x0003
#define AL_EAXREVERB_GAINHF 0x0004
#define AL_EAXREVERB_GAINLF 0x0005
#define AL_EAXREVERB_DECAY_TIME 0x0006
#define AL_EAXREVERB_DECAY_HFRATIO 0x0007
#define AL_EAXREVERB_DECAY_LFRATIO 0x0008
#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009
#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A
#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B
#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C
#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D
#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E
#define AL_EAXREVERB_ECHO_TIME 0x000F
#define AL_EAXREVERB_ECHO_DEPTH 0x0010
#define AL_EAXREVERB_MODULATION_TIME 0x0011
#define AL_EAXREVERB_MODULATION_DEPTH 0x0012
#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013
#define AL_EAXREVERB_HFREFERENCE 0x0014
#define AL_EAXREVERB_LFREFERENCE 0x0015
#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016
#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017
/* Chorus effect parameters */
#define AL_CHORUS_WAVEFORM 0x0001
#define AL_CHORUS_PHASE 0x0002
#define AL_CHORUS_RATE 0x0003
#define AL_CHORUS_DEPTH 0x0004
#define AL_CHORUS_FEEDBACK 0x0005
#define AL_CHORUS_DELAY 0x0006
/* Distortion effect parameters */
#define AL_DISTORTION_EDGE 0x0001
#define AL_DISTORTION_GAIN 0x0002
#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003
#define AL_DISTORTION_EQCENTER 0x0004
#define AL_DISTORTION_EQBANDWIDTH 0x0005
/* Echo effect parameters */
#define AL_ECHO_DELAY 0x0001
#define AL_ECHO_LRDELAY 0x0002
#define AL_ECHO_DAMPING 0x0003
#define AL_ECHO_FEEDBACK 0x0004
#define AL_ECHO_SPREAD 0x0005
/* Flanger effect parameters */
#define AL_FLANGER_WAVEFORM 0x0001
#define AL_FLANGER_PHASE 0x0002
#define AL_FLANGER_RATE 0x0003
#define AL_FLANGER_DEPTH 0x0004
#define AL_FLANGER_FEEDBACK 0x0005
#define AL_FLANGER_DELAY 0x0006
/* Frequency shifter effect parameters */
#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001
#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002
#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003
/* Vocal morpher effect parameters */
#define AL_VOCAL_MORPHER_PHONEMEA 0x0001
#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002
#define AL_VOCAL_MORPHER_PHONEMEB 0x0003
#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004
#define AL_VOCAL_MORPHER_WAVEFORM 0x0005
#define AL_VOCAL_MORPHER_RATE 0x0006
/* Pitchshifter effect parameters */
#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001
#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002
/* Ringmodulator effect parameters */
#define AL_RING_MODULATOR_FREQUENCY 0x0001
#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002
#define AL_RING_MODULATOR_WAVEFORM 0x0003
/* Autowah effect parameters */
#define AL_AUTOWAH_ATTACK_TIME 0x0001
#define AL_AUTOWAH_RELEASE_TIME 0x0002
#define AL_AUTOWAH_RESONANCE 0x0003
#define AL_AUTOWAH_PEAK_GAIN 0x0004
/* Compressor effect parameters */
#define AL_COMPRESSOR_ONOFF 0x0001
/* Equalizer effect parameters */
#define AL_EQUALIZER_LOW_GAIN 0x0001
#define AL_EQUALIZER_LOW_CUTOFF 0x0002
#define AL_EQUALIZER_MID1_GAIN 0x0003
#define AL_EQUALIZER_MID1_CENTER 0x0004
#define AL_EQUALIZER_MID1_WIDTH 0x0005
#define AL_EQUALIZER_MID2_GAIN 0x0006
#define AL_EQUALIZER_MID2_CENTER 0x0007
#define AL_EQUALIZER_MID2_WIDTH 0x0008
#define AL_EQUALIZER_HIGH_GAIN 0x0009
#define AL_EQUALIZER_HIGH_CUTOFF 0x000A
/* Effect type */
#define AL_EFFECT_FIRST_PARAMETER 0x0000
#define AL_EFFECT_LAST_PARAMETER 0x8000
#define AL_EFFECT_TYPE 0x8001
/* Effect types, used with the AL_EFFECT_TYPE property */
#define AL_EFFECT_NULL 0x0000
#define AL_EFFECT_REVERB 0x0001
#define AL_EFFECT_CHORUS 0x0002
#define AL_EFFECT_DISTORTION 0x0003
#define AL_EFFECT_ECHO 0x0004
#define AL_EFFECT_FLANGER 0x0005
#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006
#define AL_EFFECT_VOCAL_MORPHER 0x0007
#define AL_EFFECT_PITCH_SHIFTER 0x0008
#define AL_EFFECT_RING_MODULATOR 0x0009
#define AL_EFFECT_AUTOWAH 0x000A
#define AL_EFFECT_COMPRESSOR 0x000B
#define AL_EFFECT_EQUALIZER 0x000C
#define AL_EFFECT_EAXREVERB 0x8000
/* Auxiliary Effect Slot properties. */
#define AL_EFFECTSLOT_EFFECT 0x0001
#define AL_EFFECTSLOT_GAIN 0x0002
#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003
/* NULL Auxiliary Slot ID to disable a source send. */
#define AL_EFFECTSLOT_NULL 0x0000
/* Filter properties. */
/* Lowpass filter parameters */
#define AL_LOWPASS_GAIN 0x0001
#define AL_LOWPASS_GAINHF 0x0002
/* Highpass filter parameters */
#define AL_HIGHPASS_GAIN 0x0001
#define AL_HIGHPASS_GAINLF 0x0002
/* Bandpass filter parameters */
#define AL_BANDPASS_GAIN 0x0001
#define AL_BANDPASS_GAINLF 0x0002
#define AL_BANDPASS_GAINHF 0x0003
/* Filter type */
#define AL_FILTER_FIRST_PARAMETER 0x0000
#define AL_FILTER_LAST_PARAMETER 0x8000
#define AL_FILTER_TYPE 0x8001
/* Filter types, used with the AL_FILTER_TYPE property */
#define AL_FILTER_NULL 0x0000
#define AL_FILTER_LOWPASS 0x0001
#define AL_FILTER_HIGHPASS 0x0002
#define AL_FILTER_BANDPASS 0x0003
/* Effect object function types. */
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*);
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*);
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint);
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint);
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*);
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat);
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*);
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*);
/* Filter object function types. */
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*);
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*);
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint);
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint);
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*);
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat);
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*);
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*);
/* Auxiliary Effect Slot object function types. */
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*);
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*);
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*);
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects);
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects);
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect);
AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue);
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues);
AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue);
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue);
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues);
AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters);
AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters);
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter);
AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue);
AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues);
AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue);
AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue);
AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues);
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots);
AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots);
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues);
#endif
/* Filter ranges and defaults. */
/* Lowpass filter */
#define AL_LOWPASS_MIN_GAIN (0.0f)
#define AL_LOWPASS_MAX_GAIN (1.0f)
#define AL_LOWPASS_DEFAULT_GAIN (1.0f)
#define AL_LOWPASS_MIN_GAINHF (0.0f)
#define AL_LOWPASS_MAX_GAINHF (1.0f)
#define AL_LOWPASS_DEFAULT_GAINHF (1.0f)
/* Highpass filter */
#define AL_HIGHPASS_MIN_GAIN (0.0f)
#define AL_HIGHPASS_MAX_GAIN (1.0f)
#define AL_HIGHPASS_DEFAULT_GAIN (1.0f)
#define AL_HIGHPASS_MIN_GAINLF (0.0f)
#define AL_HIGHPASS_MAX_GAINLF (1.0f)
#define AL_HIGHPASS_DEFAULT_GAINLF (1.0f)
/* Bandpass filter */
#define AL_BANDPASS_MIN_GAIN (0.0f)
#define AL_BANDPASS_MAX_GAIN (1.0f)
#define AL_BANDPASS_DEFAULT_GAIN (1.0f)
#define AL_BANDPASS_MIN_GAINHF (0.0f)
#define AL_BANDPASS_MAX_GAINHF (1.0f)
#define AL_BANDPASS_DEFAULT_GAINHF (1.0f)
#define AL_BANDPASS_MIN_GAINLF (0.0f)
#define AL_BANDPASS_MAX_GAINLF (1.0f)
#define AL_BANDPASS_DEFAULT_GAINLF (1.0f)
/* Effect parameter ranges and defaults. */
/* Standard reverb effect */
#define AL_REVERB_MIN_DENSITY (0.0f)
#define AL_REVERB_MAX_DENSITY (1.0f)
#define AL_REVERB_DEFAULT_DENSITY (1.0f)
#define AL_REVERB_MIN_DIFFUSION (0.0f)
#define AL_REVERB_MAX_DIFFUSION (1.0f)
#define AL_REVERB_DEFAULT_DIFFUSION (1.0f)
#define AL_REVERB_MIN_GAIN (0.0f)
#define AL_REVERB_MAX_GAIN (1.0f)
#define AL_REVERB_DEFAULT_GAIN (0.32f)
#define AL_REVERB_MIN_GAINHF (0.0f)
#define AL_REVERB_MAX_GAINHF (1.0f)
#define AL_REVERB_DEFAULT_GAINHF (0.89f)
#define AL_REVERB_MIN_DECAY_TIME (0.1f)
#define AL_REVERB_MAX_DECAY_TIME (20.0f)
#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f)
#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f)
#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f)
#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f)
#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f)
#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f)
#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f)
#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f)
#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f)
#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f)
#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f)
#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f)
#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE
#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE
#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE
/* EAX reverb effect */
#define AL_EAXREVERB_MIN_DENSITY (0.0f)
#define AL_EAXREVERB_MAX_DENSITY (1.0f)
#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f)
#define AL_EAXREVERB_MIN_DIFFUSION (0.0f)
#define AL_EAXREVERB_MAX_DIFFUSION (1.0f)
#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f)
#define AL_EAXREVERB_MIN_GAIN (0.0f)
#define AL_EAXREVERB_MAX_GAIN (1.0f)
#define AL_EAXREVERB_DEFAULT_GAIN (0.32f)
#define AL_EAXREVERB_MIN_GAINHF (0.0f)
#define AL_EAXREVERB_MAX_GAINHF (1.0f)
#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f)
#define AL_EAXREVERB_MIN_GAINLF (0.0f)
#define AL_EAXREVERB_MAX_GAINLF (1.0f)
#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f)
#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f)
#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f)
#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f)
#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f)
#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f)
#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f)
#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f)
#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f)
#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f)
#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f)
#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f)
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f)
#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f)
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f)
#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f)
#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f)
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f)
#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f)
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f)
#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f)
#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f)
#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f)
#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f)
#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f)
#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f)
#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f)
#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f)
#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f)
#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f)
#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f)
#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f)
#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f)
#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f)
#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f)
#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f)
#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f)
#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f)
#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE
#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE
#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE
/* Chorus effect */
#define AL_CHORUS_WAVEFORM_SINUSOID (0)
#define AL_CHORUS_WAVEFORM_TRIANGLE (1)
#define AL_CHORUS_MIN_WAVEFORM (0)
#define AL_CHORUS_MAX_WAVEFORM (1)
#define AL_CHORUS_DEFAULT_WAVEFORM (1)
#define AL_CHORUS_MIN_PHASE (-180)
#define AL_CHORUS_MAX_PHASE (180)
#define AL_CHORUS_DEFAULT_PHASE (90)
#define AL_CHORUS_MIN_RATE (0.0f)
#define AL_CHORUS_MAX_RATE (10.0f)
#define AL_CHORUS_DEFAULT_RATE (1.1f)
#define AL_CHORUS_MIN_DEPTH (0.0f)
#define AL_CHORUS_MAX_DEPTH (1.0f)
#define AL_CHORUS_DEFAULT_DEPTH (0.1f)
#define AL_CHORUS_MIN_FEEDBACK (-1.0f)
#define AL_CHORUS_MAX_FEEDBACK (1.0f)
#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f)
#define AL_CHORUS_MIN_DELAY (0.0f)
#define AL_CHORUS_MAX_DELAY (0.016f)
#define AL_CHORUS_DEFAULT_DELAY (0.016f)
/* Distortion effect */
#define AL_DISTORTION_MIN_EDGE (0.0f)
#define AL_DISTORTION_MAX_EDGE (1.0f)
#define AL_DISTORTION_DEFAULT_EDGE (0.2f)
#define AL_DISTORTION_MIN_GAIN (0.01f)
#define AL_DISTORTION_MAX_GAIN (1.0f)
#define AL_DISTORTION_DEFAULT_GAIN (0.05f)
#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f)
#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f)
#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f)
#define AL_DISTORTION_MIN_EQCENTER (80.0f)
#define AL_DISTORTION_MAX_EQCENTER (24000.0f)
#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f)
#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f)
#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f)
#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f)
/* Echo effect */
#define AL_ECHO_MIN_DELAY (0.0f)
#define AL_ECHO_MAX_DELAY (0.207f)
#define AL_ECHO_DEFAULT_DELAY (0.1f)
#define AL_ECHO_MIN_LRDELAY (0.0f)
#define AL_ECHO_MAX_LRDELAY (0.404f)
#define AL_ECHO_DEFAULT_LRDELAY (0.1f)
#define AL_ECHO_MIN_DAMPING (0.0f)
#define AL_ECHO_MAX_DAMPING (0.99f)
#define AL_ECHO_DEFAULT_DAMPING (0.5f)
#define AL_ECHO_MIN_FEEDBACK (0.0f)
#define AL_ECHO_MAX_FEEDBACK (1.0f)
#define AL_ECHO_DEFAULT_FEEDBACK (0.5f)
#define AL_ECHO_MIN_SPREAD (-1.0f)
#define AL_ECHO_MAX_SPREAD (1.0f)
#define AL_ECHO_DEFAULT_SPREAD (-1.0f)
/* Flanger effect */
#define AL_FLANGER_WAVEFORM_SINUSOID (0)
#define AL_FLANGER_WAVEFORM_TRIANGLE (1)
#define AL_FLANGER_MIN_WAVEFORM (0)
#define AL_FLANGER_MAX_WAVEFORM (1)
#define AL_FLANGER_DEFAULT_WAVEFORM (1)
#define AL_FLANGER_MIN_PHASE (-180)
#define AL_FLANGER_MAX_PHASE (180)
#define AL_FLANGER_DEFAULT_PHASE (0)
#define AL_FLANGER_MIN_RATE (0.0f)
#define AL_FLANGER_MAX_RATE (10.0f)
#define AL_FLANGER_DEFAULT_RATE (0.27f)
#define AL_FLANGER_MIN_DEPTH (0.0f)
#define AL_FLANGER_MAX_DEPTH (1.0f)
#define AL_FLANGER_DEFAULT_DEPTH (1.0f)
#define AL_FLANGER_MIN_FEEDBACK (-1.0f)
#define AL_FLANGER_MAX_FEEDBACK (1.0f)
#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f)
#define AL_FLANGER_MIN_DELAY (0.0f)
#define AL_FLANGER_MAX_DELAY (0.004f)
#define AL_FLANGER_DEFAULT_DELAY (0.002f)
/* Frequency shifter effect */
#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f)
#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f)
#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f)
#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0)
#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2)
#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0)
#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0)
#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1)
#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2)
#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0)
#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2)
#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0)
/* Vocal morpher effect */
#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0)
#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29)
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0)
#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24)
#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24)
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0)
#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0)
#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29)
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10)
#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24)
#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24)
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0)
#define AL_VOCAL_MORPHER_PHONEME_A (0)
#define AL_VOCAL_MORPHER_PHONEME_E (1)
#define AL_VOCAL_MORPHER_PHONEME_I (2)
#define AL_VOCAL_MORPHER_PHONEME_O (3)
#define AL_VOCAL_MORPHER_PHONEME_U (4)
#define AL_VOCAL_MORPHER_PHONEME_AA (5)
#define AL_VOCAL_MORPHER_PHONEME_AE (6)
#define AL_VOCAL_MORPHER_PHONEME_AH (7)
#define AL_VOCAL_MORPHER_PHONEME_AO (8)
#define AL_VOCAL_MORPHER_PHONEME_EH (9)
#define AL_VOCAL_MORPHER_PHONEME_ER (10)
#define AL_VOCAL_MORPHER_PHONEME_IH (11)
#define AL_VOCAL_MORPHER_PHONEME_IY (12)
#define AL_VOCAL_MORPHER_PHONEME_UH (13)
#define AL_VOCAL_MORPHER_PHONEME_UW (14)
#define AL_VOCAL_MORPHER_PHONEME_B (15)
#define AL_VOCAL_MORPHER_PHONEME_D (16)
#define AL_VOCAL_MORPHER_PHONEME_F (17)
#define AL_VOCAL_MORPHER_PHONEME_G (18)
#define AL_VOCAL_MORPHER_PHONEME_J (19)
#define AL_VOCAL_MORPHER_PHONEME_K (20)
#define AL_VOCAL_MORPHER_PHONEME_L (21)
#define AL_VOCAL_MORPHER_PHONEME_M (22)
#define AL_VOCAL_MORPHER_PHONEME_N (23)
#define AL_VOCAL_MORPHER_PHONEME_P (24)
#define AL_VOCAL_MORPHER_PHONEME_R (25)
#define AL_VOCAL_MORPHER_PHONEME_S (26)
#define AL_VOCAL_MORPHER_PHONEME_T (27)
#define AL_VOCAL_MORPHER_PHONEME_V (28)
#define AL_VOCAL_MORPHER_PHONEME_Z (29)
#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0)
#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1)
#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2)
#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0)
#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2)
#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0)
#define AL_VOCAL_MORPHER_MIN_RATE (0.0f)
#define AL_VOCAL_MORPHER_MAX_RATE (10.0f)
#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f)
/* Pitch shifter effect */
#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12)
#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12)
#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12)
#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50)
#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50)
#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0)
/* Ring modulator effect */
#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f)
#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f)
#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f)
#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f)
#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f)
#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f)
#define AL_RING_MODULATOR_SINUSOID (0)
#define AL_RING_MODULATOR_SAWTOOTH (1)
#define AL_RING_MODULATOR_SQUARE (2)
#define AL_RING_MODULATOR_MIN_WAVEFORM (0)
#define AL_RING_MODULATOR_MAX_WAVEFORM (2)
#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0)
/* Autowah effect */
#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f)
#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f)
#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f)
#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f)
#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f)
#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f)
#define AL_AUTOWAH_MIN_RESONANCE (2.0f)
#define AL_AUTOWAH_MAX_RESONANCE (1000.0f)
#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f)
#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f)
#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f)
#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f)
/* Compressor effect */
#define AL_COMPRESSOR_MIN_ONOFF (0)
#define AL_COMPRESSOR_MAX_ONOFF (1)
#define AL_COMPRESSOR_DEFAULT_ONOFF (1)
/* Equalizer effect */
#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f)
#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f)
#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f)
#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f)
#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f)
#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f)
#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f)
#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f)
#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f)
#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f)
#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f)
#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f)
#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f)
#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f)
#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f)
#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f)
#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f)
#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f)
#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f)
#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f)
#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f)
#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f)
#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f)
#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f)
#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f)
#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f)
#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f)
#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f)
#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f)
#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f)
/* Source parameter value ranges and defaults. */
#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f)
#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f)
#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f)
#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
#define AL_MIN_CONE_OUTER_GAINHF (0.0f)
#define AL_MAX_CONE_OUTER_GAINHF (1.0f)
#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f)
#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE
#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE
#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE
#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE
#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE
#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE
#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE
#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE
#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE
/* Listener parameter value ranges and defaults. */
#define AL_MIN_METERS_PER_UNIT FLT_MIN
#define AL_MAX_METERS_PER_UNIT FLT_MAX
#define AL_DEFAULT_METERS_PER_UNIT (1.0f)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* AL_EFX_H */
+34 -2
View File
@@ -1,4 +1,36 @@
rpcs3
RPCS3
=====
PS3 emulator/debugger
[![Build Status](https://travis-ci.org/DHrpcs3/rpcs3.svg?branch=master)](https://travis-ci.org/DHrpcs3/rpcs3)
An open-source PlayStation 3 emulator/debugger written in C++.
You can find some basic information in the [FAQ](https://github.com/DHrpcs3/rpcs3/wiki/FAQ). For discussion about this emulator and PS3 emulation please visit the [official forums](http://www.emunewz.net/forum/forumdisplay.php?fid=162).
### Development
If you want to contribute please take a took at the [Coding Style](https://github.com/DHrpcs3/rpcs3/wiki/Coding-Style), [Roadmap](https://github.com/DHrpcs3/rpcs3/wiki/Roadmap) and [Developer Information](https://github.com/DHrpcs3/rpcs3/wiki/Developer-Information) pages. You should as well contact any of the developers in the forum in order to know about the current situation of the emulator.
### Dependencies
__Windows__
* [Visual C++ Redistributable Packages for Visual Studio 2013](http://www.microsoft.com/en-us/download/details.aspx?id=40784)
* [OpenAL binaries](http://kcat.strangesoft.net/openal.html): download and copy `Win64\soft_oal.dll` to `rpcs3\bin\`
__Linux__
* Debian & Ubuntu: `sudo apt-get install libopenal-dev libwxgtk3.0-dev build-essential`
__Mac OSX__
* Install with Homebrew: `brew install glew wxwidgets`
* Remove '-framework QuickTime' from '_ldflags' in /usr/local/bin/wx-config
### Building
To initialize the repository don't forget to execute `git submodule update --init` to pull the wxWidgets source.
* __Windows__: Install *Visual Studio 2013*. Then open the *.SLN* file, and press *Build* > *Rebuild Solution*.
* __Linux & Mac OSX__:
`cd rpcs3 && cmake CMakeLists.txt && make && cd ../` Then run with `cd bin && ./rpcs3`
+1 -414
View File
@@ -1,318 +1,5 @@
#pragma once
template<typename T> class Array
{
protected:
u32 m_count;
T* m_array;
public:
Array()
: m_count(0)
, m_array(NULL)
{
}
~Array()
{
Clear();
}
inline bool RemoveAt(const u32 from, const u32 count = 1)
{
if(!GetCount()) return false;
const u32 to = from + count;
if(to > GetCount()) return false;
for(u32 i=0; i<count; ++i) m_array[from + i].~T();
memmove(m_array + from, m_array + to, (m_count-to) * sizeof(T));
m_count -= count;
return true;
}
void InsertRoomEnd(const u32 size)
{
_InsertRoomEnd(size);
}
bool InsertRoom(const u32 pos, const u32 size)
{
if(pos >= m_count) return false;
_InsertRoomEnd(size);
memmove(m_array + pos + size, m_array + pos, sizeof(T) * (m_count - size - pos));
return true;
}
inline bool Move(const u32 pos, T* data)
{
if(!InsertRoom(pos, 1)) return false;
memcpy(m_array + pos, data, sizeof(T));
free(data);
return true;
}
inline u32 Move(T* data)
{
_InsertRoomEnd(1);
memcpy(m_array + GetCount() - 1, data, sizeof(T));
free(data);
return m_count - 1;
}
inline bool Add(const u32 pos, T*& data)
{
if(!InsertRoom(pos, 1)) return false;
memcpy(m_array + pos, data, sizeof(T));
free(data);
data = m_array + pos;
return true;
}
inline u32 Add(T*& data)
{
_InsertRoomEnd(1);
memcpy(m_array + GetCount() - 1, data, sizeof(T));
free(data);
data = m_array + GetCount() - 1;
return m_count - 1;
}
inline bool AddCpy(const u32 pos, const T* data, u32 count = 1)
{
if(!InsertRoom(pos, count)) return false;
for(u32 i=0; i<count; ++i)
{
new (m_array + pos + i) T(data[i]);
}
return true;
}
inline bool AddCpy(const u32 pos, const T& data)
{
return AddCpy(pos, &data);
}
inline u32 AddCpy(const T* data, u32 count = 1)
{
_InsertRoomEnd(count);
for(u32 i=0; i<count; ++i)
{
new (m_array + m_count - count + i) T(data[i]);
}
return m_count - count;
}
inline u32 AddCpy(const T& data)
{
return AddCpy(&data);
}
inline void Clear()
{
u32 count = m_count;
m_count = 0;
for(u32 i=0; i<count; ++i) m_array[i].~T();
safe_free(m_array);
}
inline void ClearF()
{
m_count = 0;
safe_free(m_array);
}
inline T& Get(u32 num)
{
//if(num >= GetCount()) return *new T();
return m_array[num];
}
virtual u32 GetCount() const { return m_count; }
virtual void SetCount(const u32 count, bool memzero = true)
{
if(m_count >= count) return;
_InsertRoomEnd(count - m_count);
if(memzero) memset(m_array + m_count - count, 0, sizeof(T) * (m_count - count));
}
void Reserve(const u32 count)
{
SetCount(GetCount() + count);
}
void AppendFrom(const Array<T>& src)
{
if(!src.GetCount()) return;
Reserve(src.GetCount());
memcpy(m_array, &src[0], GetCount() * sizeof(T));
}
void CopyFrom(const Array<T>& src)
{
Clear();
AppendFrom(src);
}
inline T* GetPtr() { return m_array; }
inline const T* GetPtr() const { return m_array; }
T& operator[](u32 num) const { return m_array[num]; }
T* operator + (u32 right) const
{
return m_array + right;
}
T* operator ->()
{
return m_array;
}
protected:
void _InsertRoomEnd(const u32 size)
{
if(!size) return;
m_array = m_count ? (T*)realloc(m_array, sizeof(T) * (m_count + size)) : (T*)malloc(sizeof(T) * size);
m_count += size;
}
};
class ArrayString : public Array<char>
{
public:
ArrayString() : Array()
{
}
ArrayString(const wxString& value) : Array()
{
*this = value;
}
ArrayString(const char* value) : Array()
{
*this = value;
}
virtual u32 GetCount() const
{
return m_array ? strlen(m_array) : 0;
}
virtual void SetCount(const u32 count, bool memzero = true)
{
if(m_count && count < m_count - 1)
{
m_array[count] = '\0';
}
else
{
Array::SetCount(count + 1, memzero);
}
}
ArrayString& operator = (const char* right)
{
Clear();
if(right)
{
size_t len = strlen(right);
if(len)
{
SetCount(len);
memcpy(m_array, right, len * sizeof(char));
m_array[len] = '\0';
}
}
return *this;
}
ArrayString& operator = (const ArrayString& right)
{
Clear();
if(size_t len = right.GetCount())
{
SetCount(len);
memcpy(m_array, right.GetPtr(), len * sizeof(char));
m_array[len] = '\0';
}
return *this;
}
ArrayString& operator = (const wxString& right)
{
Clear();
if(size_t len = right.Len())
{
SetCount(len);
memcpy(m_array, right.c_str(), len * sizeof(char));
m_array[len] = '\0';
}
return *this;
}
ArrayString* Clone() const
{
ArrayString* new_array = new ArrayString();
(*new_array) = m_array;
return new_array;
}
};
template<typename T> struct Stack : public Array<T>
{
Stack() : Array<T>()
{
}
~Stack()
{
Clear();
}
void Push(const T data) { AddCpy(data); }
T Pop()
{
const u32 pos = GetCount() - 1;
const T ret = Get(pos);
RemoveAt(pos);
return ret;
}
};
template<typename T, size_t size> class SizedStack
{
T m_ptr[size];
@@ -368,106 +55,6 @@ public:
}
};
template<typename T> class ArrayF
{
u32 m_count;
T** m_array;
public:
ArrayF()
: m_count(0)
, m_array(NULL)
{
}
virtual ~ArrayF()
{
Clear();
}
inline bool RemoveFAt(const u32 from, const u32 count = 1)
{
if(from + count > m_count) return false;
memmove(&m_array[from], &m_array[from+count], (m_count-(from+count)) * sizeof(T**));
m_count -= count;
return true;
}
inline bool RemoveAt(const u32 from, const u32 count = 1)
{
if(from + count > m_count) return false;
for(uint i = from; i < from + count; ++i)
{
free(m_array[i]);
}
return RemoveFAt(from, count);
}
inline u32 Add(T& data)
{
return Add(&data);
}
inline u32 Add(T* data)
{
if(!m_array)
{
m_array = (T**)malloc(sizeof(T*));
}
else
{
m_array = (T**)realloc(m_array, sizeof(T*) * (m_count + 1));
}
m_array[m_count] = data;
return m_count++;
}
inline void ClearF()
{
if(m_count == 0) return;
m_count = 0;
m_array = NULL;
}
inline void Clear()
{
if(m_count == 0) return;
m_count = 0;
safe_free(m_array);
}
inline T& Get(const u64 num)
{
//if(m_count <= num) *m_array[0]; //TODO
return *m_array[num];
}
T** operator + (u32 right) const
{
return m_array + right;
}
T* operator ->()
{
return *m_array;
}
inline T** GetPtr()
{
return m_array;
}
inline u32 GetCount() const { return m_count; }
T& operator[](u32 num) const { return *m_array[num]; }
};
template<typename T> struct ScopedPtr
{
private:
@@ -498,4 +85,4 @@ public:
delete m_ptr;
m_ptr = ptr;
}
};
};
+194
View File
@@ -0,0 +1,194 @@
#pragma once
#include "Utilities/GNU.h"
#include <algorithm>
using std::min;
using std::max;
//#define re(val) MemoryBase::Reverse(val)
#define re64(val) MemoryBase::Reverse64(val)
#define re32(val) MemoryBase::Reverse32(val)
#define re16(val) MemoryBase::Reverse16(val)
template<typename T, int size = sizeof(T)> struct se_t;
template<typename T> struct se_t<T, 1> { static __forceinline void func(T& dst, const T src) { (u8&)dst = (u8&)src; } };
template<typename T> struct se_t<T, 2> { static __forceinline void func(T& dst, const T src) { (u16&)dst = _byteswap_ushort((u16&)src); } };
template<typename T> struct se_t<T, 4> { static __forceinline void func(T& dst, const T src) { (u32&)dst = _byteswap_ulong((u32&)src); } };
template<typename T> struct se_t<T, 8> { static __forceinline void func(T& dst, const T src) { (u64&)dst = _byteswap_uint64((u64&)src); } };
template<typename T> T re(const T val) { T res; se_t<T>::func(res, val); return res; }
template<typename T1, typename T2> void re(T1& dst, const T2 val) { se_t<T1>::func(dst, val); }
template<typename T, s64 _value, int size = sizeof(T)> struct const_se_t;
template<typename T, s64 _value> struct const_se_t<T, _value, 1>
{
static const T value = (T)_value;
};
template<typename T, s64 _value> struct const_se_t<T, _value, 2>
{
static const T value = ((_value >> 8) & 0xff) | ((_value << 8) & 0xff00);
};
template<typename T, s64 _value> struct const_se_t<T, _value, 4>
{
static const T value =
((_value >> 24) & 0x000000ff) |
((_value >> 8) & 0x0000ff00) |
((_value << 8) & 0x00ff0000) |
((_value << 24) & 0xff000000);
};
template<typename T, s64 _value> struct const_se_t<T, _value, 8>
{
static const T value =
((_value >> 56) & 0x00000000000000ff) |
((_value >> 40) & 0x000000000000ff00) |
((_value >> 24) & 0x0000000000ff0000) |
((_value >> 8) & 0x00000000ff000000) |
((_value << 8) & 0x000000ff00000000) |
((_value << 24) & 0x0000ff0000000000) |
((_value << 40) & 0x00ff000000000000) |
((_value << 56) & 0xff00000000000000);
};
template<typename T, int size=sizeof(T)>
class be_t
{
static_assert(size == 1 || size == 2 || size == 4 || size == 8, "Bad be_t type");
T m_data;
public:
typedef T type;
#ifdef _WIN32
be_t(){}
#else
be_t() noexcept = default;
#endif
be_t(const be_t<T,size>& value) = default;
be_t(const T& value)
{
FromLE(value);
}
template<typename T1>
explicit be_t(const be_t<T1>& value)
{
FromBE(value.ToBE());
}
const T& ToBE() const
{
return m_data;
}
T ToLE() const
{
T res;
se_t<T>::func(res, m_data);
return res;
}
void FromBE(const T& value)
{
m_data = value;
}
void FromLE(const T& value)
{
se_t<T>::func(m_data, value);
}
static be_t MakeFromLE(const T value)
{
be_t res;
res.FromLE(value);
return res;
}
static be_t MakeFromBE(const T value)
{
be_t res;
res.FromBE(value);
return res;
}
//template<typename T1>
operator const T() const
{
return ToLE();
}
template<typename T1>
operator const be_t<T1>() const
{
be_t<T1> res;
res.FromBE(ToBE());
return res;
}
be_t& operator = (const T& right)
{
FromLE(right);
return *this;
}
be_t<T,size>& operator = (const be_t<T,size>& right) = default;
template<typename T1> be_t& operator += (T1 right) { return *this = T(*this) + right; }
template<typename T1> be_t& operator -= (T1 right) { return *this = T(*this) - right; }
template<typename T1> be_t& operator *= (T1 right) { return *this = T(*this) * right; }
template<typename T1> be_t& operator /= (T1 right) { return *this = T(*this) / right; }
template<typename T1> be_t& operator %= (T1 right) { return *this = T(*this) % right; }
template<typename T1> be_t& operator &= (T1 right) { return *this = T(*this) & right; }
template<typename T1> be_t& operator |= (T1 right) { return *this = T(*this) | right; }
template<typename T1> be_t& operator ^= (T1 right) { return *this = T(*this) ^ right; }
template<typename T1> be_t& operator <<= (T1 right) { return *this = T(*this) << right; }
template<typename T1> be_t& operator >>= (T1 right) { return *this = T(*this) >> right; }
template<typename T1> be_t& operator += (const be_t<T1>& right) { return *this = ToLE() + right.ToLE(); }
template<typename T1> be_t& operator -= (const be_t<T1>& right) { return *this = ToLE() - right.ToLE(); }
template<typename T1> be_t& operator *= (const be_t<T1>& right) { return *this = ToLE() * right.ToLE(); }
template<typename T1> be_t& operator /= (const be_t<T1>& right) { return *this = ToLE() / right.ToLE(); }
template<typename T1> be_t& operator %= (const be_t<T1>& right) { return *this = ToLE() % right.ToLE(); }
template<typename T1> be_t& operator &= (const be_t<T1>& right) { return *this = ToBE() & right.ToBE(); }
template<typename T1> be_t& operator |= (const be_t<T1>& right) { return *this = ToBE() | right.ToBE(); }
template<typename T1> be_t& operator ^= (const be_t<T1>& right) { return *this = ToBE() ^ right.ToBE(); }
template<typename T1> be_t operator & (const be_t<T1>& right) const { be_t<T> res; res.FromBE(ToBE() & right.ToBE()); return res; }
template<typename T1> be_t operator | (const be_t<T1>& right) const { be_t<T> res; res.FromBE(ToBE() | right.ToBE()); return res; }
template<typename T1> be_t operator ^ (const be_t<T1>& right) const { be_t<T> res; res.FromBE(ToBE() ^ right.ToBE()); return res; }
template<typename T1> bool operator == (T1 right) const { return (T1)ToLE() == right; }
template<typename T1> bool operator != (T1 right) const { return !(*this == right); }
template<typename T1> bool operator > (T1 right) const { return (T1)ToLE() > right; }
template<typename T1> bool operator < (T1 right) const { return (T1)ToLE() < right; }
template<typename T1> bool operator >= (T1 right) const { return (T1)ToLE() >= right; }
template<typename T1> bool operator <= (T1 right) const { return (T1)ToLE() <= right; }
template<typename T1> bool operator == (const be_t<T1>& right) const { return ToBE() == right.ToBE(); }
template<typename T1> bool operator != (const be_t<T1>& right) const { return !(*this == right); }
template<typename T1> bool operator > (const be_t<T1>& right) const { return (T1)ToLE() > right.ToLE(); }
template<typename T1> bool operator < (const be_t<T1>& right) const { return (T1)ToLE() < right.ToLE(); }
template<typename T1> bool operator >= (const be_t<T1>& right) const { return (T1)ToLE() >= right.ToLE(); }
template<typename T1> bool operator <= (const be_t<T1>& right) const { return (T1)ToLE() <= right.ToLE(); }
be_t operator++ (int) { be_t res = *this; *this += 1; return res; }
be_t operator-- (int) { be_t res = *this; *this -= 1; return res; }
be_t& operator++ () { *this += 1; return *this; }
be_t& operator-- () { *this -= 1; return *this; }
};
template<typename T, typename T1, T1 value> struct _se : public const_se_t<T, value> {};
template<typename T, typename T1, T1 value> struct _se<be_t<T>, T1, value> : public const_se_t<T, value> {};
#define se(t, x) _se<decltype(t), decltype(x), x>::value
#define se16(x) _se<u16, decltype(x), x>::value
#define se32(x) _se<u32, decltype(x), x>::value
#define se64(x) _se<u64, decltype(x), x>::value
+20
View File
@@ -0,0 +1,20 @@
#include <time.h>
#include <sys/time.h>
#include "GNU.h"
#ifdef __APPLE__
void * _aligned_malloc(size_t size, size_t alignment) {
void *buffer;
posix_memalign(&buffer, alignment, size);
return buffer;
}
int clock_gettime(int foo, struct timespec *ts) {
struct timeval tv;
gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
return(0);
}
#endif /* !__APPLE__ */
+72
View File
@@ -0,0 +1,72 @@
#pragma once
#ifdef _WIN32
#define thread_local __declspec(thread)
#elif __APPLE__
#define thread_local __thread
#endif
#if defined(__GNUG__)
#include <cmath>
#include <stdlib.h>
#include <cstdint>
#ifndef __APPLE__
#include <malloc.h>
#endif
#define _fpclass(x) std::fpclassify(x)
#define __forceinline __attribute__((always_inline))
#define _byteswap_ushort(x) __builtin_bswap16(x)
#define _byteswap_ulong(x) __builtin_bswap32(x)
#define _byteswap_uint64(x) __builtin_bswap64(x)
#define Sleep(x) usleep(x * 1000)
#define mkdir(x) mkdir(x, 0777)
#define INFINITE 0xFFFFFFFF
#define _CRT_ALIGN(x) __attribute__((aligned(x)))
#define InterlockedCompareExchange(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val)
#define InterlockedCompareExchange64(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val)
inline int64_t InterlockedOr64(volatile int64_t *dest, int64_t val)
{
int64_t olderval;
int64_t oldval = *dest;
do
{
olderval = oldval;
oldval = InterlockedCompareExchange64(dest, olderval | val, olderval);
} while (olderval != oldval);
return oldval;
}
inline uint64_t __umulh(uint64_t a, uint64_t b)
{
uint64_t result;
__asm__("mulq %[b]" : "=d" (result) : [a] "a" (a), [b] "rm" (b));
return result;
}
inline int64_t __mulh(int64_t a, int64_t b)
{
int64_t result;
__asm__("imulq %[b]" : "=d" (result) : [a] "a" (a), [b] "rm" (b));
return result;
}
#ifndef __APPLE__
#define _aligned_malloc(size,alignment) memalign(alignment,size)
#else
void * _aligned_malloc(size_t size, size_t alignment);
int clock_gettime(int foo, struct timespec *ts);
#define wxIsNaN(x) ((x) != (x))
#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC 0
#endif /* !CLOCK_MONOTONIC */
#endif /* !__APPLE__ */
#define _aligned_free free
#define DWORD int32_t
#endif
+129 -86
View File
@@ -1,43 +1,90 @@
#pragma once
#include "Array.h"
#include <unordered_map>
#define rID_ANY -1 // was wxID_ANY
typedef u32 ID_TYPE;
class IDData
{
protected:
void* m_ptr;
std::function<void(void*)> m_destr;
public:
IDData(void* ptr, std::function<void(void*)> destr)
: m_ptr(ptr)
, m_destr(destr)
{
}
~IDData()
{
m_destr(m_ptr);
}
template<typename T> T* get()
{
return (T*)m_ptr;
}
template<typename T> const T* get() const
{
return (const T*)m_ptr;
}
};
struct ID
{
bool m_used;
wxString m_name;
u8 m_attr;
void* m_data;
std::string m_name;
u32 m_attr;
IDData* m_data;
ID(bool used = false, const wxString& name = wxEmptyString, void* data = NULL, const u8 attr = 0)
: m_used(used)
, m_name(name)
, m_data(data)
template<typename T>
ID(const std::string& name, T* data, const u32 attr)
: m_name(name)
, m_attr(attr)
{
m_data = new IDData(data, [](void *ptr) -> void { delete (T*)ptr; });
}
ID() : m_data(nullptr)
{
}
ID(ID&& other)
{
m_name = other.m_name;
m_attr = other.m_attr;
m_data = other.m_data;
other.m_data = nullptr;
}
ID& operator=(ID&& other)
{
std::swap(m_name,other.m_name);
std::swap(m_attr,other.m_attr);
std::swap(m_data,other.m_data);
return *this;
}
void Kill()
{
delete m_data;
}
};
class IdManager
{
ArrayF<ID> IDs;
static const ID_TYPE s_first_id = 1;
static const ID_TYPE s_max_id = -1;
static const u64 first_id = 1;
std::unordered_map<ID_TYPE, ID> m_id_map;
std::mutex m_mtx_main;
ID_TYPE m_cur_id;
void Cleanup()
{
while(IDs.GetCount())
{
const u32 num = IDs.GetCount()-1;
ID& id = IDs[num];
if(id.m_used) break;
IDs.RemoveAt(num);
}
}
public:
IdManager()
IdManager() : m_cur_id(s_first_id)
{
}
@@ -45,92 +92,88 @@ public:
{
Clear();
}
static ID_TYPE GetMaxID()
{
return (ID_TYPE)-1;
}
bool CheckID(const u64 id)
{
if(id == 0 || id > (u64)NumToID(IDs.GetCount()-1) || id >= GetMaxID()) return false;
return IDs[IDToNum(id)].m_used;
}
__forceinline const ID_TYPE NumToID(const ID_TYPE num) const
bool CheckID(const ID_TYPE id)
{
return num + first_id;
}
__forceinline const ID_TYPE IDToNum(const ID_TYPE id) const
{
return id - first_id;
std::lock_guard<std::mutex> lock(m_mtx_main);
return m_id_map.find(id) != m_id_map.end();
}
void Clear()
{
IDs.Clear();
}
virtual ID_TYPE GetNewID(const wxString& name = wxEmptyString, void* data = NULL, const u8 attr = 0)
{
for(uint i=0; i<IDs.GetCount(); ++i)
std::lock_guard<std::mutex> lock(m_mtx_main);
for(auto& i : m_id_map)
{
if(IDs[i].m_used) continue;
return NumToID(i);
i.second.Kill();
}
const ID_TYPE pos = IDs.GetCount();
if(NumToID(pos) >= GetMaxID()) return 0;
IDs.Add(new ID(true, name, data, attr));
return NumToID(pos);
m_id_map.clear();
m_cur_id = s_first_id;
}
ID& GetIDData(const ID_TYPE _id)
template<typename T
#ifdef __GNUG__
= char
#endif
>
ID_TYPE GetNewID(const std::string& name = "", T* data = nullptr, const u32 attr = 0)
{
//if(!CheckID(_id)) return IDs.Get(0); //TODO
return IDs[IDToNum(_id)];
}
std::lock_guard<std::mutex> lock(m_mtx_main);
bool GetFirst(ID& dst, ID_TYPE* _id = NULL)
m_id_map[m_cur_id] = ID(name, data, attr);
return m_cur_id++;
}
ID& GetID(const ID_TYPE id)
{
u32 pos = 0;
return GetNext(pos, dst, _id);
std::lock_guard<std::mutex> lock(m_mtx_main);
return m_id_map[id];
}
template<typename T>
bool GetIDData(const ID_TYPE id, T*& result)
{
std::lock_guard<std::mutex> lock(m_mtx_main);
auto f = m_id_map.find(id);
if(f == m_id_map.end())
{
return false;
}
result = f->second.m_data->get<T>();
return true;
}
bool HasID(const s64 id)
{
if(id == wxID_ANY) return IDs.GetCount() != 0;
{
std::lock_guard<std::mutex> lock(m_mtx_main);
if(id == rID_ANY)
return m_id_map.begin() != m_id_map.end();
}
return CheckID(id);
}
bool GetNext(u32& pos, ID& dst, ID_TYPE* _id = NULL)
bool RemoveID(const ID_TYPE id)
{
while(pos < IDs.GetCount())
{
ID& id = IDs[pos++];
if(!id.m_used) continue;
dst = id;
if(_id) *_id = NumToID(pos - 1);
return true;
}
std::lock_guard<std::mutex> lock(m_mtx_main);
return false;
}
auto item = m_id_map.find(id);
if(item == m_id_map.end()) return false;
item->second.Kill();
m_id_map.erase(item);
virtual bool RemoveID(const ID_TYPE _id, bool free_data = true)
{
if(!CheckID(_id)) return false;
ID& id = IDs[IDToNum(_id)];
if(!id.m_used) return false;
id.m_used = false;
id.m_attr = 0;
id.m_name.Clear();
if(free_data) delete id.m_data;
id.m_data = NULL;
if(IDToNum(_id) == IDs.GetCount()-1) Cleanup();
return true;
}
};
};
+42
View File
@@ -0,0 +1,42 @@
#pragma once
template<typename T>
struct BaseInterval
{
static const uint64_t zero = 0ull;
static const uint64_t notz = 0xffffffffffffffffull;
T m_min, m_max;
static BaseInterval<T> make(T min_value, T max_value)
{
BaseInterval<T> res = { min_value, max_value };
return res;
}
static BaseInterval<T> make()
{
return make((T&)zero, (T&)notz);
}
bool getconst(T& result)
{
if (m_min == m_max)
{
result = m_min;
return true;
}
else
{
return false;
}
}
bool isindef()
{
if (T == float)
{
}
}
};
+239
View File
@@ -0,0 +1,239 @@
#include "stdafx.h"
#include "Log.h"
#include <iostream>
#include <string>
#include <cinttypes>
#include <memory>
#include <vector>
#include <mutex>
#include <condition_variable>
#include <thread>
#include <set>
#include <array>
using namespace Log;
LogManager *gLogManager = nullptr;
u32 LogMessage::size()
{
//1 byte for NULL terminator
return sizeof(LogMessage::size_type) + sizeof(LogType) + sizeof(LogSeverity) + sizeof(std::string::value_type)*mText.size() + 1;
}
void LogMessage::serialize(char *output)
{
LogMessage::size_type size = this->size();
memcpy(output, &size, sizeof(LogMessage::size_type));
output += sizeof(LogMessage::size_type);
memcpy(output, &mType, sizeof(LogType));
output += sizeof(LogType);
memcpy(output, &mServerity, sizeof(LogSeverity));
output += sizeof(LogSeverity);
memcpy(output, mText.c_str(), mText.size() );
output += sizeof(std::string::value_type)*mText.size();
*output = '\0';
}
LogMessage LogMessage::deserialize(char *input, u32* size_out)
{
LogMessage msg;
LogMessage::size_type msgSize = *(reinterpret_cast<LogMessage::size_type*>(input));
input += sizeof(LogMessage::size_type);
msg.mType = *(reinterpret_cast<LogType*>(input));
input += sizeof(LogType);
msg.mServerity = *(reinterpret_cast<LogSeverity*>(input));
input += sizeof(LogSeverity);
if (msgSize > 9000)
{
int wtf = 6;
}
msg.mText.append(input, msgSize - 1 - sizeof(LogSeverity) - sizeof(LogType));
if (size_out){(*size_out) = msgSize;}
return msg;
}
LogChannel::LogChannel() : LogChannel("unknown")
{}
LogChannel::LogChannel(const std::string& name) :
name(name)
, mEnabled(true)
, mLogLevel(Warning)
{}
void LogChannel::log(LogMessage msg)
{
std::lock_guard<std::mutex> lock(mListenerLock);
for (auto &listener : mListeners)
{
listener->log(msg);
}
}
void LogChannel::addListener(std::shared_ptr<LogListener> listener)
{
std::lock_guard<std::mutex> lock(mListenerLock);
mListeners.insert(listener);
}
void LogChannel::removeListener(std::shared_ptr<LogListener> listener)
{
std::lock_guard<std::mutex> lock(mListenerLock);
mListeners.erase(listener);
}
struct CoutListener : LogListener
{
void log(LogMessage msg)
{
std::cerr << msg.mText << std::endl;
}
};
struct FileListener : LogListener
{
rFile mFile;
bool mPrependChannelName;
FileListener(const std::string& name = _PRGNAME_, bool prependChannel = true)
: mFile(name + ".log", rFile::write),
mPrependChannelName(prependChannel)
{
if (!mFile.IsOpened())
{
rMessageBox("Can't create log file! (" + name + ".log)", rMessageBoxCaptionStr, rICON_ERROR);
}
}
void log(LogMessage msg)
{
if (mPrependChannelName)
{
msg.mText.insert(0, gTypeNameTable[static_cast<u32>(msg.mType)].mName);
}
mFile.Write(msg.mText);
}
};
LogManager::LogManager()
#ifdef BUFFERED_LOGGING
: mExiting(false), mLogConsumer()
#endif
{
auto it = mChannels.begin();
std::shared_ptr<LogListener> listener(new FileListener());
for (const LogTypeName& name : gTypeNameTable)
{
it->name = name.mName;
it->addListener(listener);
it++;
}
std::shared_ptr<LogListener> TTYListener(new FileListener("TTY",false));
getChannel(TTY).addListener(TTYListener);
#ifdef BUFFERED_LOGGING
mLogConsumer = std::thread(&LogManager::consumeLog, this);
#endif
}
LogManager::~LogManager()
{
#ifdef BUFFERED_LOGGING
mExiting = true;
mBufferReady.notify_all();
mLogConsumer.join();
}
void LogManager::consumeLog()
{
std::unique_lock<std::mutex> lock(mStatusMut);
while (!mExiting)
{
mBufferReady.wait(lock);
mBuffer.lockGet();
size_t size = mBuffer.size();
std::vector<char> local_messages(size);
mBuffer.popN(&local_messages.front(), size);
mBuffer.unlockGet();
u32 cursor = 0;
u32 removed = 0;
while (cursor < size)
{
Log::LogMessage msg = Log::LogMessage::deserialize(local_messages.data() + cursor, &removed);
cursor += removed;
getChannel(msg.mType).log(msg);
}
}
#endif
}
void LogManager::log(LogMessage msg)
{
//don't do any formatting changes or filtering to the TTY output since we
//use the raw output to do diffs with the output of a real PS3 and some
//programs write text in single bytes to the console
if (msg.mType != TTY)
{
std::string prefix;
switch (msg.mServerity)
{
case Success:
prefix = "S ";
break;
case Notice:
prefix = "! ";
break;
case Warning:
prefix = "W ";
break;
case Error:
prefix = "E ";
break;
}
if (NamedThreadBase* thr = GetCurrentNamedThread())
{
prefix += thr->GetThreadName();
}
msg.mText.insert(0, prefix);
msg.mText.append(1,'\n');
}
#ifdef BUFFERED_LOGGING
size_t size = msg.size();
std::vector<char> temp_buffer(size);
msg.serialize(temp_buffer.data());
mBuffer.pushRange(temp_buffer.begin(), temp_buffer.end());
mBufferReady.notify_one();
#else
mChannels[static_cast<u32>(msg.mType)].log(msg);
#endif
}
void LogManager::addListener(std::shared_ptr<LogListener> listener)
{
for (auto& channel : mChannels)
{
channel.addListener(listener);
}
}
void LogManager::removeListener(std::shared_ptr<LogListener> listener)
{
for (auto& channel : mChannels)
{
channel.removeListener(listener);
}
}
LogManager& LogManager::getInstance()
{
if (!gLogManager)
{
gLogManager = new LogManager();
}
return *gLogManager;
}
LogChannel &LogManager::getChannel(LogType type)
{
return mChannels[static_cast<u32>(type)];
}
+148
View File
@@ -0,0 +1,148 @@
#pragma once
#include <iostream>
#include <string>
#include <cinttypes>
#include <memory>
#include <vector>
#include <mutex>
#include <set>
#include <array>
#include "Utilities/MTRingbuffer.h"
//#define BUFFERED_LOGGING 1
//first parameter is of type Log::LogType and text is of type std::string
#define LOG_SUCCESS(logType, text, ...) log_message(logType, Log::Success, text, ##__VA_ARGS__)
#define LOG_NOTICE(logType, text, ...) log_message(logType, Log::Notice, text, ##__VA_ARGS__)
#define LOG_WARNING(logType, text, ...) log_message(logType, Log::Warning, text, ##__VA_ARGS__)
#define LOG_ERROR(logType, text, ...) log_message(logType, Log::Error, text, ##__VA_ARGS__)
namespace Log
{
const unsigned int MAX_LOG_BUFFER_LENGTH = 1024*1024;
const unsigned int gBuffSize = 1000;
enum LogType : u32
{
GENERAL = 0,
LOADER,
MEMORY,
RSX,
HLE,
PPU,
SPU,
TTY,
};
struct LogTypeName
{
LogType mType;
std::string mName;
};
//well I'd love make_array() but alas manually counting is not the end of the world
static const std::array<LogTypeName, 8> gTypeNameTable = { {
{ GENERAL, "G: " },
{ LOADER, "LDR: " },
{ MEMORY, "MEM: " },
{ RSX, "RSX: " },
{ HLE, "HLE: " },
{ PPU, "PPU: " },
{ SPU, "SPU: " },
{ TTY, "TTY: " }
} };
enum LogSeverity : u32
{
Success = 0,
Notice,
Warning,
Error,
};
struct LogMessage
{
using size_type = u32;
LogType mType;
LogSeverity mServerity;
std::string mText;
u32 size();
void serialize(char *output);
static LogMessage deserialize(char *input, u32* size_out=nullptr);
};
struct LogListener
{
virtual ~LogListener() {};
virtual void log(LogMessage msg) = 0;
};
struct LogChannel
{
LogChannel();
LogChannel(const std::string& name);
LogChannel(LogChannel& other) = delete;
LogChannel& operator = (LogChannel& other) = delete;
void log(LogMessage msg);
void addListener(std::shared_ptr<LogListener> listener);
void removeListener(std::shared_ptr<LogListener> listener);
std::string name;
private:
bool mEnabled;
LogSeverity mLogLevel;
std::mutex mListenerLock;
std::set<std::shared_ptr<LogListener>> mListeners;
};
struct LogManager
{
LogManager();
~LogManager();
static LogManager& getInstance();
LogChannel& getChannel(LogType type);
void log(LogMessage msg);
void addListener(std::shared_ptr<LogListener> listener);
void removeListener(std::shared_ptr<LogListener> listener);
#ifdef BUFFERED_LOGGING
void consumeLog();
#endif
private:
#ifdef BUFFERED_LOGGING
MTRingbuffer<char, MAX_LOG_BUFFER_LENGTH> mBuffer;
std::condition_variable mBufferReady;
std::mutex mStatusMut;
std::atomic<bool> mExiting;
std::thread mLogConsumer;
#endif
std::array<LogChannel, std::tuple_size<decltype(gTypeNameTable)>::value> mChannels;
//std::array<LogChannel,gTypeNameTable.size()> mChannels; //TODO: use this once Microsoft sorts their shit out
};
}
static struct { inline operator Log::LogType() { return Log::LogType::GENERAL; } } GENERAL;
static struct { inline operator Log::LogType() { return Log::LogType::LOADER; } } LOADER;
static struct { inline operator Log::LogType() { return Log::LogType::MEMORY; } } MEMORY;
static struct { inline operator Log::LogType() { return Log::LogType::RSX; } } RSX;
static struct { inline operator Log::LogType() { return Log::LogType::HLE; } } HLE;
static struct { inline operator Log::LogType() { return Log::LogType::PPU; } } PPU;
static struct { inline operator Log::LogType() { return Log::LogType::SPU; } } SPU;
static struct { inline operator Log::LogType() { return Log::LogType::TTY; } } TTY;
inline void log_message(Log::LogType type, Log::LogSeverity sev, std::string text)
{
//another msvc bug makes this not work, uncomment this and delete everything else in this function when it's fixed
//Log::LogManager::getInstance().log({logType, severity, text})
Log::LogMessage msg{type, sev, text};
Log::LogManager::getInstance().log(msg);
}
template<typename T, typename ...Ts>
inline void log_message(Log::LogType type, Log::LogSeverity sev, std::string text, T arg, Ts... args)
{
Log::LogMessage msg{type, sev, fmt::Format(text,arg,args...)};
Log::LogManager::getInstance().log(msg);
}
+1 -1
View File
@@ -95,4 +95,4 @@ public:
wxDialog::Close(force);
}
};
};
+159
View File
@@ -0,0 +1,159 @@
#pragma once
#include <thread>
#include <array>
#include <mutex>
#include <algorithm>
//Simple non-resizable FIFO Ringbuffer that can be simultaneously be read from and written to
//if we ever get to use boost please replace this with boost::circular_buffer, there's no reason
//why we would have to keep this amateur attempt at such a fundamental data-structure around
template< typename T, unsigned int MAX_MTRINGBUFFER_BUFFER_SIZE>
class MTRingbuffer{
std::array<T, MAX_MTRINGBUFFER_BUFFER_SIZE> mBuffer;
//this is a recursive mutex because the get methods lock it but the only
//way to be sure that they do not block is to check the size and the only
//way to check the size and use get atomically is to lock this mutex,
//so it goes:
//lock get mutex-->check size-->call get-->lock get mutex-->unlock get mutex-->return from get-->unlock get mutex
std::recursive_mutex mMutGet;
std::mutex mMutPut;
size_t mGet;
size_t mPut;
size_t moveGet(size_t by = 1){ return (mGet + by) % MAX_MTRINGBUFFER_BUFFER_SIZE; }
size_t movePut(size_t by = 1){ return (mPut + by) % MAX_MTRINGBUFFER_BUFFER_SIZE; }
public:
MTRingbuffer() : mGet(0), mPut(0){}
//blocks until there's something to get, so check "spaceLeft()" if you want to avoid blocking
//also lock the get mutex around the spaceLeft() check and the pop if you want to avoid racing
T pop()
{
std::lock_guard<std::recursive_mutex> lock(mMutGet);
while (mGet == mPut)
{
//wait until there's actually something to get
//throwing an exception might be better, blocking here is a little awkward
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
size_t ret = mGet;
mGet = moveGet();
return mBuffer[ret];
}
//blocks if the buffer is full until there's enough room
void push(T &putEle)
{
std::lock_guard<std::mutex> lock(mMutPut);
while (movePut() == mGet)
{
//if this is reached a lot it's time to increase the buffer size
//or implement dynamic re-sizing
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
mBuffer[mPut] = std::forward(putEle);
mPut = movePut();
}
bool empty()
{
return mGet == mPut;
}
//returns the amount of free places, this is the amount of actual free spaces-1
//since mGet==mPut signals an empty buffer we can't actually use the last free
//space, so we shouldn't report it as free.
size_t spaceLeft() //apparently free() is a macro definition in msvc in some conditions
{
if (mGet < mPut)
{
return mBuffer.size() - (mPut - mGet) - 1;
}
else if (mGet > mPut)
{
return mGet - mPut - 1;
}
else
{
return mBuffer.size() - 1;
}
}
size_t size()
{
//the magic -1 is the same magic 1 that is explained in the spaceLeft() function
return mBuffer.size() - spaceLeft() - 1;
}
//takes random access iterator to T
template<typename IteratorType>
void pushRange(IteratorType from, IteratorType until)
{
std::lock_guard<std::mutex> lock(mMutPut);
size_t length = until - from;
//if whatever we're trying to store is greater than the entire buffer the following loop will be infinite
assert(mBuffer.size() > length);
while (spaceLeft() < length)
{
//if this is reached a lot it's time to increase the buffer size
//or implement dynamic re-sizing
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (mPut + length <= mBuffer.size())
{
std::copy(from, until, mBuffer.begin() + mPut);
}
else
{
size_t tillEnd = mBuffer.size() - mPut;
std::copy(from, from + tillEnd, mBuffer.begin() + mPut);
std::copy(from + tillEnd, until, mBuffer.begin());
}
mPut = movePut(length);
}
//takes output iterator to T
template<typename IteratorType>
void popN(IteratorType output, size_t n)
{
std::lock_guard<std::recursive_mutex> lock(mMutGet);
//make sure we're not trying to retrieve more than is in
assert(n <= size());
peekN<IteratorType>(output, n);
mGet = moveGet(n);
}
//takes output iterator to T
template<typename IteratorType>
void peekN(IteratorType output, size_t n)
{
size_t lGet = mGet;
if (lGet + n <= mBuffer.size())
{
std::copy_n(mBuffer.begin() + lGet, n, output);
}
else
{
auto next = std::copy(mBuffer.begin() + lGet, mBuffer.end(), output);
std::copy_n(mBuffer.begin(), n - (mBuffer.size() - lGet), next);
}
}
//well this is just asking for trouble
//but the comment above the declaration of mMutGet explains why it's there
//if there's a better way please remove this
void lockGet()
{
mMutGet.lock();
}
//well this is just asking for trouble
//but the comment above the declaration of mMutGet explains why it's there
//if there's a better way please remove this
void unlockGet()
{
mMutGet.unlock();
}
};
+40
View File
@@ -0,0 +1,40 @@
#include <stdafx.h>
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/CPU/CPUThread.h"
#include "Utilities/SMutex.h"
__forceinline void SM_Sleep()
{
if (NamedThreadBase* t = GetCurrentNamedThread())
{
t->WaitForAnySignal();
}
else
{
Sleep(1);
}
}
thread_local size_t g_this_thread_id = 0;
__forceinline size_t SM_GetCurrentThreadId()
{
return g_this_thread_id ? g_this_thread_id : g_this_thread_id = std::hash<std::thread::id>()(std::this_thread::get_id());
}
__forceinline u32 SM_GetCurrentCPUThreadId()
{
if (CPUThread* t = GetCurrentCPUThread())
{
return t->GetId();
}
return 0;
}
__forceinline be_t<u32> SM_GetCurrentCPUThreadIdBE()
{
return SM_GetCurrentCPUThreadId();
}
+177
View File
@@ -0,0 +1,177 @@
#pragma once
#include "BEType.h"
extern void SM_Sleep();
extern size_t SM_GetCurrentThreadId();
extern u32 SM_GetCurrentCPUThreadId();
extern be_t<u32> SM_GetCurrentCPUThreadIdBE();
enum SMutexResult
{
SMR_OK = 0, // succeeded (lock, trylock, unlock)
SMR_FAILED, // failed (trylock, unlock)
SMR_DEADLOCK, // mutex reached deadlock (lock, trylock)
SMR_SIGNAL = SMR_DEADLOCK, // unlock can be used for signaling specific thread
SMR_PERMITTED, // not owner of the mutex (unlock)
SMR_ABORT, // emulator has been stopped (lock, trylock, unlock)
SMR_DESTROYED, // mutex has been destroyed (lock, trylock, unlock)
SMR_TIMEOUT, // timed out (lock)
};
template
<
typename T,
u64 free_value = 0,
u64 dead_value = 0xffffffff,
void (*wait)() = SM_Sleep
>
class SMutexBase
{
static_assert(sizeof(T) == sizeof(std::atomic<T>), "Invalid SMutexBase type");
std::atomic<T> owner;
public:
SMutexBase()
: owner((T)free_value)
{
}
void initialize()
{
(T&)owner = free_value;
}
~SMutexBase()
{
lock((T)dead_value);
owner = (T)dead_value;
}
__forceinline T GetOwner() const
{
return (T&)owner;
}
__forceinline T GetFreeValue() const
{
return (T)free_value;
}
__forceinline T GetDeadValue() const
{
return (T)dead_value;
}
SMutexResult trylock(T tid)
{
if (Emu.IsStopped())
{
return SMR_ABORT;
}
T old = (T)free_value;
if (!owner.compare_exchange_strong(old, tid))
{
if (old == tid)
{
return SMR_DEADLOCK;
}
if (old == (T)dead_value)
{
return SMR_DESTROYED;
}
return SMR_FAILED;
}
return SMR_OK;
}
SMutexResult unlock(T tid, T to = (T)free_value)
{
if (Emu.IsStopped())
{
return SMR_ABORT;
}
T old = tid;
if (!owner.compare_exchange_strong(old, to))
{
if (old == (T)free_value)
{
return SMR_FAILED;
}
if (old == (T)dead_value)
{
return SMR_DESTROYED;
}
return SMR_PERMITTED;
}
return SMR_OK;
}
SMutexResult lock(T tid, u64 timeout = 0)
{
u64 counter = 0;
while (true)
{
switch (SMutexResult res = trylock(tid))
{
case SMR_FAILED: break;
default: return res;
}
if (wait) wait();
if (timeout && counter++ > timeout)
{
return SMR_TIMEOUT;
}
}
}
};
template<typename T, typename Tid, Tid (get_tid)()>
class SMutexLockerBase
{
T& sm;
public:
const Tid tid;
__forceinline SMutexLockerBase(T& _sm)
: sm(_sm)
, tid(get_tid())
{
if (!tid)
{
if (!Emu.IsStopped())
{
LOG_ERROR(HLE, "SMutexLockerBase: thread id == 0");
Emu.Pause();
}
return;
}
sm.lock(tid);
}
__forceinline ~SMutexLockerBase()
{
if (tid) sm.unlock(tid);
}
};
typedef SMutexBase<size_t>
SMutexGeneral;
typedef SMutexBase<u32>
SMutex;
typedef SMutexBase<be_t<u32>>
SMutexBE;
typedef SMutexLockerBase<SMutexGeneral, size_t, SM_GetCurrentThreadId>
SMutexGeneralLocker;
typedef SMutexLockerBase<SMutex, u32, SM_GetCurrentCPUThreadId>
SMutexLocker;
typedef SMutexLockerBase<SMutexBE, be_t<u32>, SM_GetCurrentCPUThreadIdBE>
SMutexBELocker;
+139
View File
@@ -0,0 +1,139 @@
#pragma once
template<typename T, u32 SQSize = 666>
class SQueue
{
std::mutex m_mutex;
NamedThreadBase* push_waiter;
NamedThreadBase* pop_waiter;
u32 m_pos;
u32 m_count;
T m_data[SQSize];
public:
SQueue()
: m_pos(0)
, m_count(0)
, push_waiter(nullptr)
, pop_waiter(nullptr)
{
}
const u32 GetSize() const
{
return SQSize;
}
bool Push(const T& data)
{
NamedThreadBase* t = GetCurrentNamedThread();
push_waiter = t;
while (true)
{
if (m_count >= SQSize)
{
if (Emu.IsStopped())
{
return false;
}
SM_Sleep();
continue;
}
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count >= SQSize) continue;
if (pop_waiter && !m_count) pop_waiter->Notify();
m_data[(m_pos + m_count++) % SQSize] = data;
push_waiter = nullptr;
return true;
}
}
}
bool Pop(T& data)
{
NamedThreadBase* t = GetCurrentNamedThread();
pop_waiter = t;
while (true)
{
if (!m_count)
{
if (Emu.IsStopped())
{
return false;
}
SM_Sleep();
continue;
}
{
std::lock_guard<std::mutex> lock(m_mutex);
if (!m_count) continue;
if (push_waiter && m_count >= SQSize) push_waiter->Notify();
data = m_data[m_pos];
m_pos = (m_pos + 1) % SQSize;
m_count--;
pop_waiter = nullptr;
return true;
}
}
}
volatile u32 GetCount() // may be thread unsafe
{
return m_count;
}
volatile bool IsEmpty() // may be thread unsafe
{
return !m_count;
}
void Clear()
{
std::lock_guard<std::mutex> lock(m_mutex);
if (push_waiter && m_count >= SQSize) push_waiter->Notify();
m_count = 0;
}
T& Peek(u32 pos = 0)
{
NamedThreadBase* t = GetCurrentNamedThread();
pop_waiter = t;
while (true)
{
if (!m_count)
{
if (Emu.IsStopped())
{
break;
}
SM_Sleep();
continue;
}
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count)
{
pop_waiter = nullptr;
break;
}
}
}
return m_data[(m_pos + pos) % SQSize];
}
};
+87
View File
@@ -0,0 +1,87 @@
#include "stdafx.h"
#include "Utilities/SSemaphore.h"
void SSemaphore::wait()
{
u32 order;
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count && m_out_order == m_in_order)
{
m_count--;
return;
}
order = m_in_order++;
}
std::unique_lock<std::mutex> cv_lock(m_cv_mutex);
while (true)
{
if (Emu.IsStopped())
{
return;
}
m_cond.wait_for(cv_lock, std::chrono::milliseconds(1));
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count)
{
if (m_out_order == order)
{
m_count--;
m_out_order++;
return;
}
else
{
m_cond.notify_one();
}
}
}
}
}
bool SSemaphore::try_wait()
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count && m_in_order == m_out_order)
{
m_count--;
return true;
}
else
{
return false;
}
}
void SSemaphore::post()
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count < m_max)
{
m_count++;
}
else
{
return;
}
m_cond.notify_one();
}
bool SSemaphore::post_and_wait()
{
// TODO: merge these functions? Probably has a race condition.
if (try_wait()) return false;
post();
wait();
return true;
}
+41
View File
@@ -0,0 +1,41 @@
#pragma once
class SSemaphore
{
const u32 m_max;
u32 m_count;
u32 m_in_order;
u32 m_out_order;
std::mutex m_cv_mutex;
std::mutex m_mutex;
std::condition_variable m_cond;
public:
SSemaphore(u32 value, u32 max = 1)
: m_max(max > 0 ? max : 0xffffffff)
, m_count(value > m_max ? m_max : value)
, m_in_order(0)
, m_out_order(0)
{
}
SSemaphore()
: m_max(0xffffffff)
, m_count(0)
, m_in_order(0)
, m_out_order(0)
{
}
~SSemaphore()
{
}
void wait();
bool try_wait();
void post();
bool post_and_wait();
};
+132
View File
@@ -0,0 +1,132 @@
#include "stdafx.h"
#include "StrFmt.h"
extern const std::string fmt::placeholder = "???";
//wrapper to deal with advance sprintf formating options with automatic length finding
//can't take strings by reference because of "va_start", so overload it with char *
std::string fmt::FormatV(const char *fmt, va_list args)
{
size_t length = 256;
std::string str;
for (;;)
{
std::vector<char> buffptr(length);
size_t printlen = vsnprintf(buffptr.data(), length, fmt, args);
if (printlen < length)
{
str = std::string(buffptr.data(), printlen);
break;
}
length *= 2;
}
return str;
}
std::string fmt::FormatV(std::string fmt, va_list args)
{
std::string str = FormatV(fmt.c_str(), args);
return str;
}
std::string replace_first(const std::string& src, const std::string& from, const std::string& to)
{
auto pos = src.find(from);
if (pos == std::string::npos)
{
return src;
}
return (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
}
std::string replace_all(std::string src, const std::string& from, const std::string& to)
{
for (auto pos = src.find(from); pos != std::string::npos; src.find(from, pos + 1))
{
src = (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
pos += to.length();
}
return src;
}
//TODO: move this wx Stuff somewhere else
//convert a wxString to a std::string encoded in utf8
//CAUTION, only use this to interface with wxWidgets classes
std::string fmt::ToUTF8(const wxString& right)
{
auto ret = std::string(((const char *)right.utf8_str()));
return ret;
}
//convert a std::string encoded in utf8 to a wxString
//CAUTION, only use this to interface with wxWidgets classes
wxString fmt::FromUTF8(const std::string& right)
{
auto ret = wxString::FromUTF8(right.c_str());
return ret;
}
//TODO: remove this after every snippet that uses it is gone
//WARNING: not fully compatible with CmpNoCase from wxString
int fmt::CmpNoCase(const std::string& a, const std::string& b)
{
if (a.length() != b.length())
{
return -1;
}
else
{
return std::equal(a.begin(),
a.end(),
b.begin(),
[](const char& a, const char& b){return tolower(a) == tolower(b); })
? 0 : -1;
}
}
//TODO: remove this after every snippet that uses it is gone
//WARNING: not fully compatible with CmpNoCase from wxString
void fmt::Replace(std::string &str, const std::string &searchterm, const std::string& replaceterm)
{
size_t cursor = 0;
do
{
cursor = str.find(searchterm, cursor);
if (cursor != std::string::npos)
{
str.replace(cursor, searchterm.size(), replaceterm);
cursor += replaceterm.size();
}
else
{
break;
}
} while (true);
}
std::vector<std::string> fmt::rSplit(const std::string& source, const std::string& delim)
{
std::vector<std::string> ret;
size_t cursor = 0;
do
{
size_t prevcurs = cursor;
cursor = source.find(delim, cursor);
if (cursor != std::string::npos)
{
ret.push_back(source.substr(prevcurs,cursor-prevcurs));
cursor += delim.size();
}
else
{
ret.push_back(source.substr(prevcurs));
break;
}
} while (true);
return ret;
}
+202
View File
@@ -0,0 +1,202 @@
#pragma once
#include <string>
#include <vector>
#include <ostream>
#include <sstream>
#include <cstdio>
#include <functional>
#if defined(_MSC_VER)
#define snprintf _snprintf
#endif
namespace fmt{
using std::string;
using std::ostream;
using std::ostringstream;
struct empty_t{};
extern const string placeholder;
template <typename T>
std::string AfterLast(const std::string& source, T searchstr)
{
size_t search_pos = source.rfind(searchstr);
search_pos = search_pos == std::string::npos ? 0 : search_pos;
return source.substr(search_pos);
}
template <typename T>
std::string BeforeLast(const std::string& source, T searchstr)
{
size_t search_pos = source.rfind(searchstr);
search_pos = search_pos == std::string::npos ? 0 : search_pos;
return source.substr(0, search_pos);
}
template <typename T>
std::string AfterFirst(const std::string& source, T searchstr)
{
size_t search_pos = source.find(searchstr);
search_pos = search_pos == std::string::npos ? 0 : search_pos;
return source.substr(search_pos);
}
template <typename T>
std::string BeforeFirst(const std::string& source, T searchstr)
{
size_t search_pos = source.find(searchstr);
search_pos = search_pos == std::string::npos ? 0 : search_pos;
return source.substr(0, search_pos);
}
// write `fmt` from `pos` to the first occurence of `fmt::placeholder` to
// the stream `os`. Then write `arg` to to the stream. If there's no
// `fmt::placeholder` after `pos` everything in `fmt` after pos is written
// to `os`. Then `arg` is written to `os` after appending a space character
template<typename T>
empty_t write(const string &fmt, ostream &os, string::size_type &pos, T &&arg)
{
string::size_type ins = fmt.find(placeholder, pos);
if (ins == string::npos)
{
os.write(fmt.data() + pos, fmt.size() - pos);
os << ' ' << arg;
pos = fmt.size();
}
else
{
os.write(fmt.data() + pos, ins - pos);
os << arg;
pos = ins + placeholder.size();
}
return{};
}
// typesafe version of a sprintf-like function. Returns the printed to
// string. To mark positions where the arguments are supposed to be
// inserted use `fmt::placeholder`. If there's not enough placeholders
// the rest of the arguments are appended at the end, seperated by spaces
template<typename ... Args>
string SFormat(const string &fmt, Args&& ... parameters)
{
ostringstream os;
string::size_type pos = 0;
std::initializer_list<empty_t> { write(fmt, os, pos, parameters)... };
if (!fmt.empty())
{
os.write(fmt.data() + pos, fmt.size() - pos);
}
string result = os.str();
return result;
}
//small wrapper used to deal with bitfields
template<typename T>
T by_value(T x) { return x; }
//wrapper to deal with advance sprintf formating options with automatic length finding
//can't take strings by reference because of "va_start", so overload it with char *
string FormatV(const char *fmt, va_list args);
string FormatV(string fmt, va_list args);
//wrapper to deal with advance sprintf formating options with automatic length finding
template<typename ... Args>
string Format(const string &fmt, Args ... parameters)
{
size_t length = 256;
string str;
for (;;)
{
std::vector<char> buffptr(length);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-security"
size_t printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward<Args>(parameters)...);
#pragma clang diagnostic pop
if (printlen < length)
{
str = string(buffptr.data(), printlen);
break;
}
length *= 2;
}
return str;
}
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);
std::string replace_all(std::string src, const std::string& from, const std::string& to);
template<size_t list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::string>(&list)[list_size])
{
for (size_t pos = 0; pos < src.length(); ++pos)
{
for (size_t i = 0; i < list_size; ++i)
{
const size_t comp_length = list[i].first.length();
if (src.length() - pos < comp_length)
continue;
if (src.substr(pos, comp_length) == list[i].first)
{
src = (pos ? src.substr(0, pos) + list[i].second : list[i].second) + std::string(src.c_str() + pos + comp_length);
pos += list[i].second.length() - 1;
break;
}
}
}
return src;
}
template<size_t list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::function<std::string()>>(&list)[list_size])
{
for (size_t pos = 0; pos < src.length(); ++pos)
{
for (size_t i = 0; i < list_size; ++i)
{
const size_t comp_length = list[i].first.length();
if (src.length() - pos < comp_length)
continue;
if (src.substr(pos, comp_length) == list[i].first)
{
src = (pos ? src.substr(0, pos) + list[i].second() : list[i].second()) + std::string(src.c_str() + pos + comp_length);
pos += list[i].second().length() - 1;
break;
}
}
}
return src;
}
//convert a wxString to a std::string encoded in utf8
//CAUTION, only use this to interface with wxWidgets classes
std::string ToUTF8(const wxString& right);
//convert a std::string encoded in utf8 to a wxString
//CAUTION, only use this to interface with wxWidgets classes
wxString FromUTF8(const string& right);
//TODO: remove this after every snippet that uses it is gone
//WARNING: not fully compatible with CmpNoCase from wxString
int CmpNoCase(const std::string& a, const std::string& b);
//TODO: remove this after every snippet that uses it is gone
//WARNING: not fully compatible with Replace from wxString
void Replace(std::string &str, const std::string &searchterm, const std::string& replaceterm);
std::vector<std::string> rSplit(const std::string& source, const std::string& delim);
}
+146 -85
View File
@@ -1,97 +1,158 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Thread.h"
ThreadBase* GetCurrentNamedThread()
thread_local NamedThreadBase* g_tls_this_thread = nullptr;
std::atomic<u32> g_thread_count(0);
NamedThreadBase* GetCurrentNamedThread()
{
ThreadExec* thr = (ThreadExec*)::wxThread::This();
return thr ? thr->m_parent : nullptr;
return g_tls_this_thread;
}
ThreadBase::ThreadBase(bool detached, const wxString& name)
: m_detached(detached)
, m_name(name)
, m_executor(nullptr)
{
}
void ThreadBase::Start()
{
if(m_executor) return;
m_executor = new ThreadExec(m_detached, this);
}
void ThreadBase::Resume()
{
if(m_executor)
{
m_executor->Resume();
}
}
void ThreadBase::Pause()
{
if(m_executor)
{
m_executor->Pause();
}
}
void ThreadBase::Stop(bool wait)
{
if(!m_executor) return;
ThreadExec* exec = m_executor;
m_executor = nullptr;
if(!m_detached)
{
if(wait)
{
exec->Wait();
}
exec->Stop(false);
delete exec;
}
else
{
exec->Stop(wait);
}
}
bool ThreadBase::Wait() const
{
return m_executor != nullptr && m_executor->Wait() != (wxThread::ExitCode)-1;
}
bool ThreadBase::IsRunning() const
{
return m_executor != nullptr && m_executor->IsRunning();
}
bool ThreadBase::IsPaused() const
{
return m_executor != nullptr && m_executor->IsPaused();
}
bool ThreadBase::IsAlive() const
{
return m_executor != nullptr;
}
bool ThreadBase::TestDestroy() const
{
if(!m_executor || !m_executor->m_parent) return true;
return m_executor->TestDestroy();
}
wxString ThreadBase::GetThreadName() const
std::string NamedThreadBase::GetThreadName() const
{
return m_name;
}
void ThreadBase::SetThreadName(const wxString& name)
void NamedThreadBase::SetThreadName(const std::string& name)
{
m_name = name;
}
}
ThreadBase::ThreadBase(const std::string& name)
: NamedThreadBase(name)
, m_executor(nullptr)
, m_destroy(false)
, m_alive(false)
{
}
ThreadBase::~ThreadBase()
{
if(IsAlive())
Stop(false);
safe_delete(m_executor);
}
void ThreadBase::Start()
{
if(m_executor) Stop();
std::lock_guard<std::mutex> lock(m_main_mutex);
m_destroy = false;
m_alive = true;
m_executor = new std::thread(
[this]()
{
g_tls_this_thread = this;
g_thread_count++;
Task();
m_alive = false;
g_thread_count--;
});
}
void ThreadBase::Stop(bool wait, bool send_destroy)
{
std::lock_guard<std::mutex> lock(m_main_mutex);
if (send_destroy)
m_destroy = true;
if(!m_executor)
return;
if(wait && m_executor->joinable() && m_alive)
{
m_executor->join();
}
else
{
m_executor->detach();
}
delete m_executor;
m_executor = nullptr;
}
bool ThreadBase::Join() const
{
std::lock_guard<std::mutex> lock(m_main_mutex);
if(m_executor->joinable() && m_alive && m_executor != nullptr)
{
m_executor->join();
return true;
}
return false;
}
bool ThreadBase::IsAlive() const
{
std::lock_guard<std::mutex> lock(m_main_mutex);
return m_alive;
}
bool ThreadBase::TestDestroy() const
{
return m_destroy;
}
thread::thread(const std::string& name, std::function<void()> func) : m_name(name)
{
start(func);
}
thread::thread(const std::string& name) : m_name(name)
{
}
thread::thread()
{
}
void thread::start(std::function<void()> func)
{
std::string name = m_name;
m_thr = std::thread([func, name]()
{
NamedThreadBase info(name);
g_tls_this_thread = &info;
g_thread_count++;
try
{
func();
}
catch(...)
{
LOG_ERROR(HLE, "Crash :(");
//std::terminate();
}
g_thread_count--;
});
}
void thread::detach()
{
m_thr.detach();
}
void thread::join()
{
m_thr.join();
}
bool thread::joinable() const
{
return m_thr.joinable();
}
+72 -80
View File
@@ -2,94 +2,96 @@
#include "Array.h"
#include <functional>
#include <thread>
#include <vector>
#include <mutex>
#include <atomic>
#include <condition_variable>
#include <Utilities/SSemaphore.h>
class ThreadExec;
class ThreadBase
class NamedThreadBase
{
protected:
wxString m_name;
bool m_detached;
std::string m_name;
std::condition_variable m_signal_cv;
std::mutex m_signal_mtx;
public:
wxMutex m_main_mutex;
protected:
ThreadBase(bool detached = true, const wxString& name = "Unknown ThreadBase");
public:
ThreadExec* m_executor;
virtual void Task()=0;
virtual void Start();
virtual void Resume();
virtual void Pause();
virtual void Stop(bool wait = true);
virtual bool Wait() const;
virtual bool IsRunning() const;
virtual bool IsPaused() const;
virtual bool IsAlive() const;
virtual bool TestDestroy() const;
virtual wxString GetThreadName() const;
virtual void SetThreadName(const wxString& name);
};
ThreadBase* GetCurrentNamedThread();
class ThreadExec : public wxThread
{
wxCriticalSection m_wait_for_exit;
volatile bool m_alive;
public:
ThreadBase* m_parent;
ThreadExec(bool detached, ThreadBase* parent)
: wxThread(detached ? wxTHREAD_DETACHED : wxTHREAD_JOINABLE)
, m_parent(parent)
, m_alive(true)
NamedThreadBase(const std::string& name) : m_name(name)
{
Create();
Run();
}
void Stop(bool wait = true)
NamedThreadBase()
{
if(!m_alive) return;
m_parent = nullptr;
if(wait)
{
Delete();
//wxCriticalSectionLocker lock(m_wait_for_exit);
}
}
ExitCode Entry()
virtual std::string GetThreadName() const;
virtual void SetThreadName(const std::string& name);
void WaitForAnySignal() // wait 1 ms for something
{
//wxCriticalSectionLocker lock(m_wait_for_exit);
m_parent->Task();
m_alive = false;
if(m_parent) m_parent->m_executor = nullptr;
return (ExitCode)0;
std::unique_lock<std::mutex> lock(m_signal_mtx);
m_signal_cv.wait_for(lock, std::chrono::milliseconds(1));
}
void Notify() // wake up waiting thread or nothing
{
m_signal_cv.notify_one();
}
};
//ThreadBase* GetCurrentThread();
NamedThreadBase* GetCurrentNamedThread();
class ThreadBase : public NamedThreadBase
{
protected:
std::atomic<bool> m_destroy;
std::atomic<bool> m_alive;
std::thread* m_executor;
mutable std::mutex m_main_mutex;
ThreadBase(const std::string& name);
~ThreadBase();
public:
void Start();
void Stop(bool wait = true, bool send_destroy = true);
bool Join() const;
bool IsAlive() const;
bool TestDestroy() const;
virtual void Task() = 0;
};
class thread
{
std::string m_name;
std::thread m_thr;
public:
thread(const std::string& name, std::function<void()> func);
thread(const std::string& name);
thread();
public:
void start(std::function<void()> func);
void detach();
void join();
bool joinable() const;
};
template<typename T> class MTPacketBuffer
{
protected:
volatile bool m_busy;
volatile u32 m_put, m_get;
Array<u8> m_buffer;
std::vector<u8> m_buffer;
u32 m_max_buffer_size;
mutable wxCriticalSection m_cs_main;
mutable std::recursive_mutex m_cs_main;
void CheckBusy()
{
@@ -110,9 +112,9 @@ public:
void Flush()
{
wxCriticalSectionLocker lock(m_cs_main);
std::lock_guard<std::recursive_mutex> lock(m_cs_main);
m_put = m_get = 0;
m_buffer.Clear();
m_buffer.clear();
m_busy = false;
}
@@ -123,30 +125,20 @@ private:
public:
void Push(const T& v)
{
wxCriticalSectionLocker lock(m_cs_main);
std::lock_guard<std::recursive_mutex> lock(m_cs_main);
_push(v);
}
T Pop()
{
wxCriticalSectionLocker lock(m_cs_main);
std::lock_guard<std::recursive_mutex> lock(m_cs_main);
return _pop();
}
bool HasNewPacket() const { wxCriticalSectionLocker lock(m_cs_main); return m_put != m_get; }
bool HasNewPacket() const { std::lock_guard<std::recursive_mutex> lock(m_cs_main); return m_put != m_get; }
bool IsBusy() const { return m_busy; }
};
static __forceinline bool SemaphorePostAndWait(wxSemaphore& sem)
{
if(sem.TryWait() != wxSEMA_BUSY) return false;
sem.Post();
sem.Wait();
return true;
}
/*
class StepThread : public ThreadBase
{
@@ -155,7 +147,7 @@ class StepThread : public ThreadBase
volatile bool m_exit;
protected:
StepThread(const wxString& name = "Unknown StepThread")
StepThread(const std::string& name = "Unknown StepThread")
: ThreadBase(true, name)
, m_exit(false)
{
@@ -218,4 +210,4 @@ public:
if(wait) WaitForExit();
}
};
*/
*/
+32 -27
View File
@@ -1,47 +1,52 @@
#pragma once
#include <chrono>
class Timer
{
private:
bool stopped;
double startTimeInMicroSec;
double endTimeInMicroSec;
LARGE_INTEGER frequency;
LARGE_INTEGER startCycle;
LARGE_INTEGER endCycle;
bool m_stopped;
std::chrono::high_resolution_clock::time_point m_start;
std::chrono::high_resolution_clock::time_point m_end;
public:
Timer()
Timer() : m_stopped(false)
{
QueryPerformanceFrequency(&frequency);
startCycle.QuadPart = 0;
endCycle.QuadPart = 0;
stopped = false;
startTimeInMicroSec = 0;
endTimeInMicroSec = 0;
}
void Start()
{
stopped = false;
QueryPerformanceCounter(&startCycle);
m_stopped = false;
m_start = std::chrono::high_resolution_clock::now();
}
void Stop()
{
stopped = true;
QueryPerformanceCounter(&endCycle);
m_stopped = true;
m_end = std::chrono::high_resolution_clock::now();
}
double GetElapsedTimeInSec(){return GetElapsedTimeInMicroSec() / 1000000.0;}
double GetElapsedTimeInMilliSec(){return GetElapsedTimeInMicroSec() / 1000.0;}
double GetElapsedTimeInMicroSec()
double GetElapsedTimeInSec() const
{
if(!stopped) QueryPerformanceCounter(&endCycle);
startTimeInMicroSec = startCycle.QuadPart * (1000000.0 / frequency.QuadPart);
endTimeInMicroSec = endCycle.QuadPart * (1000000.0 / frequency.QuadPart);
return endTimeInMicroSec - startTimeInMicroSec;
return GetElapsedTimeInMicroSec() / 1000000.0;
}
};
double GetElapsedTimeInMilliSec() const
{
return GetElapsedTimeInMicroSec() / 1000.0;
}
double GetElapsedTimeInMicroSec() const
{
std::chrono::high_resolution_clock::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count();
}
double GetElapsedTimeInNanoSec() const
{
std::chrono::high_resolution_clock::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::nanoseconds>(now - m_start).count();
}
};
+73
View File
@@ -0,0 +1,73 @@
@echo off
rem // This program is free software: you can redistribute it and/or modify
rem // it under the terms of the GNU General Public License as published by
rem // the Free Software Foundation, version 2.0 or later versions.
rem // This program is distributed in the hope that it will be useful,
rem // but WITHOUT ANY WARRANTY; without even the implied warranty of
rem // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem // GNU General Public License 2.0 for more details.
rem // A copy of the GPL 2.0 should have been included with the program.
rem // If not, see http://www.gnu.org/licenses/
rem // Official git repository and contact information can be found at
rem // https://github.com/DHrpcs3/rpcs3 and http://rpcs3.net/.
setlocal ENABLEDELAYEDEXPANSION
set GIT_VERSION_FILE=%~p0..\rpcs3\git-version.h
if not defined GIT (
set GIT="git"
)
call %GIT% describe > NUL 2> NUL
if errorlevel 1 (
echo Git not on path, trying default Msysgit paths
set GIT="%ProgramFiles(x86)%\Git\bin\git.exe"
call !GIT! describe > NUL 2> NUL
if errorlevel 1 (
set GIT="%ProgramFiles%\Git\bin\git.exe"
)
)
if exist "%GIT_VERSION_FILE%" (
rem // Skip updating the file if RPCS3_GIT_VERSION_NO_UPDATE is 1.
findstr /B /C:"#define RPCS3_GIT_VERSION_NO_UPDATE 1" "%GIT_VERSION_FILE%" > NUL
if not errorlevel 1 (
goto done
)
)
call %GIT% describe --always > NUL 2> NUL
if errorlevel 1 (
echo Unable to update git-version.h, git not found.
echo If you don't want to add it to your path, set the GIT environment variable.
echo // This is a generated file. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION "unknown" >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"
goto done
)
for /F %%I IN ('call %GIT% describe --always') do set GIT_VERSION=%%I
rem // Don't modify the file if it already has the current version.
if exist "%GIT_VERSION_FILE%" (
findstr /C:"%GIT_VERSION%" "%GIT_VERSION_FILE%" > NUL
if not errorlevel 1 (
goto done
)
)
echo // This is a generated file. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION "%GIT_VERSION%" >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"
:done
+41
View File
@@ -0,0 +1,41 @@
#include "stdafx.h"
rTimer::rTimer()
{
handle = reinterpret_cast<void*>(new wxTimer());
}
rTimer::~rTimer()
{
delete reinterpret_cast<wxTimer*>(handle);
}
void rTimer::Start()
{
reinterpret_cast<wxTimer*>(handle)->Start();
}
void rTimer::Stop()
{
reinterpret_cast<wxTimer*>(handle)->Stop();
}
void rSleep(u32 time)
{
wxSleep(time);
}
void rMicroSleep(u64 time)
{
wxMicroSleep(time);
}
bool rThread::IsMain()
{
return wxThread::IsMain();
}
void rYieldIfNeeded()
{
wxYieldIfNeeded();
}
+22
View File
@@ -0,0 +1,22 @@
#pragma once
struct rTimer
{
rTimer();
rTimer(const rTimer& other) = delete;
~rTimer();
void Start();
void Stop();
private:
void *handle;
};
void rSleep(u32 time);
void rMicroSleep(u64 time);
struct rThread
{
static bool IsMain();
};
void rYieldIfNeeded();
+311
View File
@@ -0,0 +1,311 @@
#include "stdafx.h"
const int rPATH_MKDIR_FULL = wxPATH_MKDIR_FULL;
wxFile::OpenMode convertOpenMode(rFile::OpenMode open)
{
wxFile::OpenMode mode;
switch (open)
{
case rFile::read:
mode = wxFile::read;
break;
case rFile::write:
mode = wxFile::write;
break;
case rFile::read_write:
mode = wxFile::read_write;
break;
case rFile::write_append:
mode = wxFile::write_append;
break;
case rFile::write_excl:
mode = wxFile::write_excl;
break;
}
return mode;
}
rFile::OpenMode rConvertOpenMode(wxFile::OpenMode open)
{
rFile::OpenMode mode;
switch (open)
{
case wxFile::read:
mode = rFile::read;
break;
case wxFile::write:
mode = rFile::write;
break;
case wxFile::read_write:
mode = rFile::read_write;
break;
case wxFile::write_append:
mode = rFile::write_append;
break;
case wxFile::write_excl:
mode = rFile::write_excl;
break;
}
return mode;
}
wxSeekMode convertSeekMode(rSeekMode mode)
{
wxSeekMode ret;
switch (mode)
{
case rFromStart:
ret = wxFromStart;
break;
case rFromCurrent:
ret = wxFromCurrent;
break;
case rFromEnd:
ret = wxFromEnd;
break;
}
return ret;
}
rSeekMode rConvertSeekMode(wxSeekMode mode)
{
rSeekMode ret;
switch (mode)
{
case wxFromStart:
ret = rFromStart;
break;
case wxFromCurrent:
ret = rFromCurrent;
break;
case wxFromEnd:
ret = rFromEnd;
break;
}
return ret;
}
rFile::rFile()
{
handle = reinterpret_cast<void*>(new wxFile());
}
rFile::rFile(const std::string& filename, rFile::OpenMode open)
{
handle = reinterpret_cast<void*>(new wxFile(fmt::FromUTF8(filename), convertOpenMode(open)));
}
rFile::rFile(int fd)
{
handle = reinterpret_cast<void*>(new wxFile(fd));
}
rFile::~rFile()
{
delete reinterpret_cast<wxFile*>(handle);
}
bool rFile::Access(const std::string &filename, rFile::OpenMode mode)
{
return wxFile::Access(fmt::FromUTF8(filename), convertOpenMode(mode));
}
size_t rFile::Write(const void *buffer, size_t count)
{
return reinterpret_cast<wxFile*>(handle)->Write(buffer,count);
}
bool rFile::Write(const std::string &text)
{
return reinterpret_cast<wxFile*>(handle)->Write(reinterpret_cast<const void*>(text.c_str()),text.size());
}
bool rFile::Close()
{
return reinterpret_cast<wxFile*>(handle)->Close();
}
bool rFile::Create(const std::string &filename, bool overwrite, int access)
{
return reinterpret_cast<wxFile*>(handle)->Create(fmt::FromUTF8(filename),overwrite,access);
}
bool rFile::Open(const std::string &filename, rFile::OpenMode mode, int access)
{
return reinterpret_cast<wxFile*>(handle)->Open(fmt::FromUTF8(filename), convertOpenMode(mode), access);
}
bool rFile::Exists(const std::string &file)
{
return wxFile::Exists(fmt::FromUTF8(file));
}
bool rFile::IsOpened() const
{
return reinterpret_cast<wxFile*>(handle)->IsOpened();
}
size_t rFile::Length() const
{
return reinterpret_cast<wxFile*>(handle)->Length();
}
size_t rFile::Read(void *buffer, size_t count)
{
return reinterpret_cast<wxFile*>(handle)->Read(buffer,count);
}
size_t rFile::Seek(size_t ofs, rSeekMode mode)
{
return reinterpret_cast<wxFile*>(handle)->Seek(ofs, convertSeekMode(mode));
}
size_t rFile::Tell() const
{
return reinterpret_cast<wxFile*>(handle)->Tell();
}
std::string rGetCwd()
{
return fmt::ToUTF8(wxGetCwd());
}
bool rMkdir(const std::string &path)
{
return wxMkdir(fmt::FromUTF8(path));
}
bool rRmdir(const std::string &path)
{
return wxRmdir(fmt::FromUTF8(path));
}
bool rDirExists(const std::string &path)
{
return wxDirExists(fmt::FromUTF8(path));
}
bool rFileExists(const std::string &path)
{
return wxFileExists(fmt::FromUTF8(path));
}
bool rRemoveFile(const std::string &path)
{
return wxRemoveFile(fmt::FromUTF8(path));
}
bool rIsWritable(const std::string& path)
{
return wxIsWritable(fmt::FromUTF8(path));
}
bool rIsReadable(const std::string& path)
{
return wxIsReadable(fmt::FromUTF8(path));
}
bool rIsExecutable(const std::string& path)
{
return wxIsExecutable(fmt::FromUTF8(path));
}
rDir::rDir()
{
handle = reinterpret_cast<void*>(new wxDir());
}
rDir::~rDir()
{
delete reinterpret_cast<wxDir*>(handle);
}
rDir::rDir(const std::string &path)
{
handle = reinterpret_cast<void*>(new wxDir(fmt::FromUTF8(path)));
}
bool rDir::Open(const std::string& path)
{
return reinterpret_cast<wxDir*>(handle)->Open(fmt::FromUTF8(path));
}
bool rDir::Exists(const std::string &path)
{
return wxDir::Exists(fmt::FromUTF8(path));
}
bool rDir::GetFirst(std::string *filename) const
{
wxString str;
bool res;
res = reinterpret_cast<wxDir*>(handle)->GetFirst(&str);
*filename = str.ToStdString();
return res;
}
bool rDir::GetNext(std::string *filename) const
{
wxString str;
bool res;
res = reinterpret_cast<wxDir*>(handle)->GetNext(&str);
*filename = str.ToStdString();
return res;
}
rFileName::rFileName()
{
handle = reinterpret_cast<void*>(new wxFileName());
}
rFileName::~rFileName()
{
delete reinterpret_cast<wxFileName*>(handle);
}
rFileName::rFileName(const rFileName& filename)
{
handle = reinterpret_cast<void*>(new wxFileName(*reinterpret_cast<wxFileName*>(filename.handle)));
}
rFileName::rFileName(const std::string& name)
{
handle = reinterpret_cast<void*>(new wxFileName(fmt::FromUTF8(name)));
}
std::string rFileName::GetFullPath()
{
return fmt::ToUTF8(reinterpret_cast<wxFileName*>(handle)->GetFullPath());
}
std::string rFileName::GetPath()
{
return fmt::ToUTF8(reinterpret_cast<wxFileName*>(handle)->GetPath());
}
std::string rFileName::GetName()
{
return fmt::ToUTF8(reinterpret_cast<wxFileName*>(handle)->GetName());
}
std::string rFileName::GetFullName()
{
return fmt::ToUTF8(reinterpret_cast<wxFileName*>(handle)->GetFullName());
}
bool rFileName::Mkdir(const std::string& name, int permissions , int flags )
{
return wxFileName::Mkdir(fmt::FromUTF8(name), permissions, flags);
}
bool rFileName::Normalize()
{
return reinterpret_cast<wxFileName*>(handle)->Normalize();
}
+84
View File
@@ -0,0 +1,84 @@
#pragma once
#include <string>
extern const int rPATH_MKDIR_FULL;
enum rSeekMode
{
rFromStart,
rFromCurrent,
rFromEnd
};
class rFile
{
public:
enum OpenMode
{
read,
write,
read_write,
write_append,
write_excl
};
rFile();
rFile(const rFile& other) = delete;
~rFile();
rFile(const std::string& filename, rFile::OpenMode open = rFile::read);
rFile(int fd);
static bool Access(const std::string &filename, rFile::OpenMode mode);
size_t Write(const void *buffer, size_t count);
bool Write(const std::string &text);
bool Close();
bool Create(const std::string &filename, bool overwrite = false, int access = 0666);
bool Open(const std::string &filename, rFile::OpenMode mode = rFile::read, int access = 0666);
static bool Exists(const std::string&);
bool IsOpened() const;
size_t Length() const;
size_t Read(void *buffer, size_t count);
size_t Seek(size_t ofs, rSeekMode mode = rFromStart);
size_t Tell() const;
void *handle;
};
std::string rGetCwd();
bool rMkdir(const std::string &path);
bool rRmdir(const std::string &path);
bool rDirExists(const std::string &path);
bool rFileExists(const std::string &path);
bool rRemoveFile(const std::string &path);
bool rIsWritable(const std::string& path);
bool rIsReadable(const std::string& path);
bool rIsExecutable(const std::string& path);
struct rDir
{
rDir();
~rDir();
rDir(const rDir& other) = delete;
rDir(const std::string &path);
bool Open(const std::string& path);
static bool Exists(const std::string &path);
bool GetFirst(std::string *filename) const;
bool GetNext(std::string *filename) const;
void *handle;
};
struct rFileName
{
rFileName();
rFileName(const rFileName& other);
~rFileName();
rFileName(const std::string& name);
std::string GetFullPath();
std::string GetPath();
std::string GetName();
std::string GetFullName();
static bool Mkdir(const std::string& name, int permissions=0777, int flags=0);
bool Normalize();
void *handle;
};
+51
View File
@@ -0,0 +1,51 @@
#include "stdafx.h"
std::string rMessageBoxCaptionStr = "Message";
rMessageDialog::rMessageDialog(void *parent, const std::string& msg, const std::string& title , long style )
{
handle = reinterpret_cast<void*>(new wxMessageDialog(
reinterpret_cast<wxWindow*>(parent)
, fmt::FromUTF8(msg)
, fmt::FromUTF8(title)
, style
));
}
rMessageDialog::~rMessageDialog()
{
delete reinterpret_cast<wxMessageDialog*>(handle);
}
long rMessageDialog::ShowModal()
{
return reinterpret_cast<wxMessageDialog*>(handle)->ShowModal();
}
long rMessageBox(const std::string& message, const std::string& title, long style)
{
return wxMessageBox(fmt::FromUTF8(message), fmt::FromUTF8(title),style);
}
std::string dummyApp::GetAppName()
{
if (handle)
{
return fmt::ToUTF8(reinterpret_cast<wxApp*>(handle)->GetAppName());
}
else
{
return "NULL";
}
}
dummyApp::dummyApp() : handle(nullptr)
{
}
static dummyApp app;
dummyApp& rGetApp()
{
return app;
}
+47
View File
@@ -0,0 +1,47 @@
#pragma once
extern std::string rMessageBoxCaptionStr;// = "Message";
enum MsgBoxParams : unsigned long
{
rOK = 0x4
, rYES =0x2//res
, rNO = 0x8 //res
, rID_YES = 5103 //resDialog
, rCANCEL = 0x10
, rYES_NO = 0xA
, rHELP = 0x1000
, rNO_DEFAULT = 0x80
, rCANCEL_DEFAULT = 0x80000000
, rYES_DEFAULT = 0x0
, rOK_DEFAULT = 0x0
, rICON_NONE = 0x40000
, rICON_EXCLAMATION = 0x100
, rICON_ERROR = 0x200
, rICON_HAND = 0x200
, rICON_QUESTION = 0x400
, rICON_INFORMATION = 0x800
, rICON_AUTH_NEEDED = 0x80000
, rSTAY_ON_TOP = 0x8000
, rCENTRE = 0x1
};
struct rMessageDialog
{
rMessageDialog(void *parent, const std::string& msg, const std::string& title = rMessageBoxCaptionStr, long style = rOK | rCENTRE);
rMessageDialog(const rMessageDialog& other) = delete;
~rMessageDialog();
long ShowModal();
void *handle;
};
long rMessageBox(const std::string& message, const std::string& title,long style);
struct dummyApp
{
dummyApp();
std::string GetAppName();
void* handle;
};
dummyApp& rGetApp();
+182
View File
@@ -0,0 +1,182 @@
#include "stdafx.h"
#include <wx/glcanvas.h>
#include "Gui/GLGSFrame.h"
#include "Emu/Io/Null/NullKeyboardHandler.h"
#include "Emu/Io/Windows/WindowsKeyboardHandler.h"
#include "Emu/Io/Null/NullMouseHandler.h"
#include "Emu/Io/Windows/WindowsMouseHandler.h"
#include "Emu/Io/Null/NullPadHandler.h"
#include "Emu/Io/Windows/WindowsPadHandler.h"
#if defined(_WIN32)
#include "Emu/Io/XInput/XInputPadHandler.h"
#endif
rCanvas::rCanvas(void *parent)
{
handle = static_cast<void*>(new wxGLCanvas(static_cast<wxWindow *>(parent),wxID_ANY,NULL));
}
rCanvas::~rCanvas()
{
delete static_cast<wxGLCanvas*>(handle);
}
bool rCanvas::SetCurrent(void *ctx)
{
return static_cast<wxGLCanvas*>(handle)->SetCurrent(*static_cast<wxGLContext *>(ctx));
}
rGLFrame::rGLFrame()
{
handle = static_cast<void*>(new GLGSFrame());
}
rGLFrame::~rGLFrame()
{
delete static_cast<GLGSFrame*>(handle);
}
void rGLFrame::Close()
{
static_cast<GLGSFrame*>(handle)->Close();
}
bool rGLFrame::IsShown()
{
return static_cast<GLGSFrame*>(handle)->IsShown();
}
void rGLFrame::Hide()
{
static_cast<GLGSFrame*>(handle)->Hide();
}
void rGLFrame::Show()
{
static_cast<GLGSFrame*>(handle)->Show();
}
void *rGLFrame::GetNewContext()
{
return static_cast<void *>(new wxGLContext(
static_cast<GLGSFrame*>(handle)->GetCanvas()
));
}
void rGLFrame::Flip(void *ctx)
{
static_cast<GLGSFrame*>(handle)->Flip(
static_cast<wxGLContext*>(ctx));
}
void rGLFrame::SetCurrent(void *ctx)
{
static_cast<GLGSFrame*>(handle)->GetCanvas()->SetCurrent(*static_cast<wxGLContext*>(ctx));
}
rImage::rImage()
{
handle = static_cast<void*>(new wxImage());
}
rImage::~rImage()
{
delete static_cast<wxImage*>(handle);
}
void rImage::Create(int width, int height, void *data, void *alpha)
{
static_cast<wxImage*>(handle)->Create(width, height, static_cast<unsigned char*>(data), static_cast<unsigned char*>(alpha));
}
void rImage::SaveFile(const std::string& name, rImageType type)
{
if (type == rBITMAP_TYPE_PNG)
{
static_cast<wxImage*>(handle)->SaveFile(fmt::FromUTF8(name),wxBITMAP_TYPE_PNG);
}
else
{
throw std::string("unsupported type");
}
}
int rPlatform::getKeyboardHandlerCount()
{
return 2;
}
KeyboardHandlerBase *rPlatform::getKeyboardHandler(int i)
{
switch (i)
{
case 0:
return new NullKeyboardHandler();
break;
case 1:
return new WindowsKeyboardHandler();
break;
default:
return new NullKeyboardHandler();
}
}
int rPlatform::getMouseHandlerCount()
{
return 2;
}
MouseHandlerBase *rPlatform::getMouseHandler(int i)
{
switch (i)
{
case 0:
return new NullMouseHandler();
break;
case 1:
return new WindowsMouseHandler();
break;
default:
return new NullMouseHandler();
}
}
int rPlatform::getPadHandlerCount()
{
#if defined(_WIN32)
return 3;
#else
return 2;
#endif
}
PadHandlerBase *rPlatform::getPadHandler(int i)
{
switch (i)
{
case 0:
return new NullPadHandler();
break;
case 1:
return new WindowsPadHandler();
break;
#if defined(_WIN32)
case 2:
return new XInputPadHandler();
break;
#endif
default:
return new NullPadHandler();
}
}
+88
View File
@@ -0,0 +1,88 @@
#pragma once
#include <vector>
#include <string>
#include "Emu/Io/Null/NullKeyboardHandler.h"
#include "Emu/Io/Null/NullMouseHandler.h"
#include "Emu/Io/Null/NullPadHandler.h"
struct rCanvas
{
rCanvas(void *parent);
rCanvas(const rCanvas &) = delete;
~rCanvas();
/*rGLContext*/void *GetCurrent();
bool SetCurrent(/*rGLContext &*/ void *ctx);
void *handle;
};
struct rGLFrame
{
rGLFrame();
rGLFrame(const rGLFrame &) = delete;
~rGLFrame();
void Close();
bool IsShown();
void Hide();
void Show();
void *handle;
void SetCurrent( void *ctx);
void *GetNewContext();
void Flip(/*rGLContext*/void *ctx);
};
struct rPlatform
{
rGLFrame *getGLGSFrame();
static rPlatform &getPlatform();
static int getKeyboardHandlerCount();
static KeyboardHandlerBase *getKeyboardHandler(int i);
static int getMouseHandlerCount();
static MouseHandlerBase *getMouseHandler(int i);
static int getPadHandlerCount();
static PadHandlerBase *getPadHandler(int i);
};
/**********************************************************************
*********** RSX Debugger
************************************************************************/
struct RSXDebuggerProgram
{
u32 id;
u32 vp_id;
u32 fp_id;
std::string vp_shader;
std::string fp_shader;
bool modified;
RSXDebuggerProgram()
: modified(false)
{
}
};
extern std::vector<RSXDebuggerProgram> m_debug_programs;
/**********************************************************************
*********** Image stuff
************************************************************************/
enum rImageType
{
rBITMAP_TYPE_PNG
};
struct rImage
{
rImage();
rImage(const rImage &) = delete;
~rImage();
void Create(int width , int height, void *data, void *alpha);
void SaveFile(const std::string& name, rImageType type);
void *handle;
};
+231
View File
@@ -0,0 +1,231 @@
#include "stdafx.h"
#include <wx/datetime.h>
std::string rDefaultDateTimeFormat = "%c";
rTimeSpan::rTimeSpan()
{
handle = static_cast<void *>(new wxTimeSpan());
}
rTimeSpan::~rTimeSpan()
{
delete static_cast<wxTimeSpan*>(handle);
}
rTimeSpan::rTimeSpan(const rTimeSpan& other)
{
handle = static_cast<void *>(new wxTimeSpan(*static_cast<wxTimeSpan*>(other.handle)));
}
rTimeSpan::rTimeSpan(int a, int b , int c, int d)
{
handle = static_cast<void *>(new wxTimeSpan(a,b,c,d));
}
rDateSpan::rDateSpan()
{
handle = static_cast<void *>(new wxDateSpan());
}
rDateSpan::~rDateSpan()
{
delete static_cast<wxDateSpan*>(handle);
}
rDateSpan::rDateSpan(const rDateSpan& other)
{
handle = static_cast<void *>(new wxDateSpan(*static_cast<wxDateSpan*>(other.handle)));
}
rDateSpan::rDateSpan(int a, int b, int c, int d)
{
handle = static_cast<void *>(new wxDateSpan(a,b,c,d));
}
rDateTime::rDateTime()
{
handle = static_cast<void *>(new wxDateTime());
}
rDateTime::~rDateTime()
{
delete static_cast<wxDateTime*>(handle);
}
rDateTime::rDateTime(const rDateTime& other)
{
handle = static_cast<void *>(new wxDateTime(*static_cast<wxDateTime*>(other.handle)));
}
rDateTime::rDateTime(const time_t& time)
{
handle = static_cast<void *>(new wxDateTime(time));
}
rDateTime::rDateTime(u16 day, rDateTime::Month month, u16 year, u16 hour, u16 minute, u16 second, u32 millisecond)
{
handle = static_cast<void *>(new wxDateTime(day,(wxDateTime::Month)month,year,hour,minute,second,millisecond));
}
rDateTime rDateTime::UNow()
{
rDateTime time;
delete static_cast<wxDateTime*>(time.handle);
time.handle = static_cast<void *>(new wxDateTime(wxDateTime::UNow()));
return time;
}
rDateTime rDateTime::FromUTC(bool val)
{
rDateTime time(*this);
void *temp = time.handle;
time.handle = static_cast<void *>(new wxDateTime(static_cast<wxDateTime*>(temp)->FromTimezone(wxDateTime::GMT0, val)));
delete static_cast<wxDateTime*>(temp);
return time;
}
rDateTime rDateTime::ToUTC(bool val)
{
rDateTime time(*this);
void *temp = time.handle;
time.handle = static_cast<void *>(new wxDateTime(static_cast<wxDateTime*>(temp)->ToTimezone(wxDateTime::GMT0, val)));
delete static_cast<wxDateTime*>(temp);
return time;
}
time_t rDateTime::GetTicks()
{
return static_cast<wxDateTime*>(handle)->GetTicks();
}
void rDateTime::Add(const rTimeSpan& span)
{
static_cast<wxDateTime*>(handle)->Add(*static_cast<wxTimeSpan*>(span.handle));
}
void rDateTime::Add(const rDateSpan& span)
{
static_cast<wxDateTime*>(handle)->Add(*static_cast<wxDateSpan*>(span.handle));
}
wxDateTime::TimeZone convertTZ(rDateTime::rTimeZone tz)
{
switch (tz)
{
case rDateTime::Local:
return wxDateTime::Local;
case rDateTime::GMT0:
return wxDateTime::GMT0;
case rDateTime::UTC:
return wxDateTime::UTC;
default:
throw std::string("WRONG DATETIME");
}
}
std::string rDateTime::Format(const std::string &format, const rTimeZone &tz) const
{
return fmt::ToUTF8(static_cast<wxDateTime*>(handle)->Format(fmt::FromUTF8(format),convertTZ(tz)));
}
void rDateTime::ParseDateTime(const std::string & format)
{
static_cast<wxDateTime*>(handle)->ParseDateTime(fmt::FromUTF8(format));
}
u32 rDateTime::GetAsDOS()
{
return static_cast<wxDateTime*>(handle)->GetAsDOS();
}
rDateTime &rDateTime::SetFromDOS(u32 fromdos)
{
static_cast<wxDateTime*>(handle)->SetFromDOS(fromdos);
return *this;
}
bool rDateTime::IsLeapYear(int year, rDateTime::Calender cal)
{
if (cal == Gregorian)
{
return wxDateTime::IsLeapYear(year, wxDateTime::Gregorian);
}
else
{
return wxDateTime::IsLeapYear(year, wxDateTime::Julian);
}
}
int rDateTime::GetNumberOfDays(rDateTime::Month month, int year, rDateTime::Calender cal)
{
if (cal == Gregorian)
{
return wxDateTime::GetNumberOfDays(static_cast<wxDateTime::Month>(month), year, wxDateTime::Gregorian);
}
else
{
return wxDateTime::GetNumberOfDays(static_cast<wxDateTime::Month>(month), year, wxDateTime::Julian);
}
}
void rDateTime::SetToWeekDay(rDateTime::WeekDay day, int n, rDateTime::Month month, int year)
{
static_cast<wxDateTime*>(handle)->SetToWeekDay(
static_cast<wxDateTime::WeekDay>(day)
, n
, static_cast<wxDateTime::Month>(month)
, year
);
}
int rDateTime::GetWeekDay()
{
return static_cast<wxDateTime*>(handle)->GetWeekDay();
}
u16 rDateTime::GetYear(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetYear(convertTZ(timezone));
}
u16 rDateTime::GetMonth(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetMonth(convertTZ(timezone));
}
u16 rDateTime::GetDay(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetDay(convertTZ(timezone));
}
u16 rDateTime::GetHour(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetHour(convertTZ(timezone));
}
u16 rDateTime::GetMinute(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetMinute(convertTZ(timezone));
}
u16 rDateTime::GetSecond(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetSecond(convertTZ(timezone));
}
u32 rDateTime::GetMillisecond(rDateTime::TZ timezone)
{
return static_cast<wxDateTime*>(handle)->GetMillisecond(convertTZ(timezone));
}
+102
View File
@@ -0,0 +1,102 @@
#pragma once
extern std::string rDefaultDateTimeFormat;
struct rTimeSpan
{
rTimeSpan();
~rTimeSpan();
rTimeSpan(const rTimeSpan& other);
rTimeSpan(int, int, int, int);
void *handle;
};
struct rDateSpan
{
rDateSpan();
~rDateSpan();
rDateSpan(const rDateSpan& other);
rDateSpan(int, int, int, int);
void *handle;
};
struct rDateTime
{
enum TZ
{
Local, GMT0,UTC
};
enum Calender
{
Gregorian, Julian
};
using rTimeZone = TZ;
enum WeekDay
{
Sun = 0,
Mon,
Tue,
Wed,
Thu,
Fri,
Sat,
Inv_WeekDay
};
enum Month {
Jan = 0,
Feb = 1,
Mar = 2,
Apr = 3,
May = 4,
Jun = 5,
Jul = 6,
Aug = 7,
Sep = 8,
Oct = 9,
Nov = 10,
Dec = 11,
Inv_Month = 12
};
rDateTime();
~rDateTime();
rDateTime(const rDateTime& other);
rDateTime(const time_t &time);
rDateTime(u16 day, rDateTime::Month month, u16 year, u16 hour, u16 minute, u16 second, u32 millisecond);
static rDateTime UNow();
rDateTime FromUTC(bool val);
rDateTime ToUTC(bool val);
time_t GetTicks();
void Add(const rTimeSpan& span);
void Add(const rDateSpan& span);
void Close();
std::string Format(const std::string &format = rDefaultDateTimeFormat, const rTimeZone &tz = Local) const;
void ParseDateTime(const std::string & format);
u32 GetAsDOS();
rDateTime &SetFromDOS(u32 fromdos);
static bool IsLeapYear(int year, rDateTime::Calender cal);
static int GetNumberOfDays(rDateTime::Month month, int year, rDateTime::Calender cal);
void SetToWeekDay(rDateTime::WeekDay day, int n, rDateTime::Month month, int year);
int GetWeekDay();
u16 GetYear( rDateTime::TZ timezone);
u16 GetMonth(rDateTime::TZ timezone);
u16 GetDay(rDateTime::TZ timezone);
u16 GetHour(rDateTime::TZ timezone);
u16 GetMinute(rDateTime::TZ timezone);
u16 GetSecond(rDateTime::TZ timezone);
u32 GetMillisecond(rDateTime::TZ timezone);
void *handle;
};
+115
View File
@@ -0,0 +1,115 @@
#include "stdafx.h"
#include <memory>
#include <wx/xml/xml.h>
rXmlNode::rXmlNode()
{
ownPtr = true;
handle = reinterpret_cast<void *>(new wxXmlNode());
}
rXmlNode::rXmlNode(void *ptr)
{
ownPtr = false;
handle = ptr;
}
rXmlNode::rXmlNode(const rXmlNode& other)
{
ownPtr = true;
handle = reinterpret_cast<void *>(new wxXmlNode(*reinterpret_cast<wxXmlNode*>(other.handle)));
}
rXmlNode &rXmlNode::operator=(const rXmlNode& other)
{
if (ownPtr)
{
delete reinterpret_cast<wxXmlNode*>(handle);
}
handle = reinterpret_cast<void *>(new wxXmlNode(*reinterpret_cast<wxXmlNode*>(other.handle)));
ownPtr = true;
return *this;
}
rXmlNode::~rXmlNode()
{
if (ownPtr)
{
delete reinterpret_cast<wxXmlNode*>(handle);
}
}
std::shared_ptr<rXmlNode> rXmlNode::GetChildren()
{
wxXmlNode* result = reinterpret_cast<wxXmlNode*>(handle)->GetChildren();
if (result)
{
return std::make_shared<rXmlNode>(reinterpret_cast<void*>(result));
}
else
{
return std::shared_ptr<rXmlNode>(nullptr);
}
}
std::shared_ptr<rXmlNode> rXmlNode::GetNext()
{
wxXmlNode* result = reinterpret_cast<wxXmlNode*>(handle)->GetNext();
if (result)
{
return std::make_shared<rXmlNode>(reinterpret_cast<void*>(result));
}
else
{
return std::shared_ptr<rXmlNode>(nullptr);
}
}
std::string rXmlNode::GetName()
{
return fmt::ToUTF8(reinterpret_cast<wxXmlNode*>(handle)->GetName());
}
std::string rXmlNode::GetAttribute(const std::string &name)
{
return fmt::ToUTF8(reinterpret_cast<wxXmlNode*>(handle)->GetAttribute(fmt::FromUTF8(name)));
}
std::string rXmlNode::GetNodeContent()
{
return fmt::ToUTF8(reinterpret_cast<wxXmlNode*>(handle)->GetNodeContent());
}
rXmlDocument::rXmlDocument()
{
handle = reinterpret_cast<void *>(new wxXmlDocument());
}
rXmlDocument::rXmlDocument(const rXmlDocument& other)
{
handle = reinterpret_cast<void *>(new wxXmlDocument(*reinterpret_cast<wxXmlDocument*>(other.handle)));
}
rXmlDocument &rXmlDocument::operator = (const rXmlDocument& other)
{
delete reinterpret_cast<wxXmlDocument*>(handle);
handle = reinterpret_cast<void *>(new wxXmlDocument(*reinterpret_cast<wxXmlDocument*>(other.handle)));
return *this;
}
rXmlDocument::~rXmlDocument()
{
delete reinterpret_cast<wxXmlDocument*>(handle);
}
void rXmlDocument::Load(const std::string & path)
{
reinterpret_cast<wxXmlDocument*>(handle)->Load(fmt::FromUTF8(path));
}
std::shared_ptr<rXmlNode> rXmlDocument::GetRoot()
{
return std::make_shared<rXmlNode>(reinterpret_cast<void*>(reinterpret_cast<wxXmlDocument*>(handle)->GetRoot()));
}
+30
View File
@@ -0,0 +1,30 @@
#pragma once
struct rXmlNode
{
rXmlNode();
rXmlNode(void *);
rXmlNode(const rXmlNode& other);
rXmlNode &operator=(const rXmlNode& other);
~rXmlNode();
std::shared_ptr<rXmlNode> GetChildren();
std::shared_ptr<rXmlNode> GetNext();
std::string GetName();
std::string GetAttribute( const std::string &name);
std::string GetNodeContent();
void *handle;
bool ownPtr;
};
struct rXmlDocument
{
rXmlDocument();
rXmlDocument(const rXmlDocument& other);
rXmlDocument &operator=(const rXmlDocument& other);
~rXmlDocument();
void Load(const std::string & path);
std::shared_ptr<rXmlNode> GetRoot();
void *handle;
};
+539
View File
@@ -0,0 +1,539 @@
/*
* Copyright 2001-2004 Unicode, Inc.
*
* Disclaimer
*
* This source code is provided as is by Unicode, Inc. No claims are
* made as to fitness for any particular purpose. No warranties of any
* kind are expressed or implied. The recipient agrees to determine
* applicability of information provided. If this file has been
* purchased on magnetic or optical media from Unicode, Inc., the
* sole remedy for any claim will be exchange of defective media
* within 90 days of receipt.
*
* Limitations on Rights to Redistribute This Code
*
* Unicode, Inc. hereby grants the right to freely use the information
* supplied in this file in the creation of products supporting the
* Unicode Standard, and to make copies of this file in any form
* for internal or external distribution as long as this notice
* remains attached.
*/
/* ---------------------------------------------------------------------
Conversions between UTF32, UTF-16, and UTF-8. Source code file.
Author: Mark E. Davis, 1994.
Rev History: Rick McGowan, fixes & updates May 2001.
Sept 2001: fixed const & error conditions per
mods suggested by S. Parent & A. Lillich.
June 2002: Tim Dodd added detection and handling of incomplete
source sequences, enhanced error detection, added casts
to eliminate compiler warnings.
July 2003: slight mods to back out aggressive FFFE detection.
Jan 2004: updated switches in from-UTF8 conversions.
Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
See the header file "ConvertUTF.h" for complete documentation.
------------------------------------------------------------------------ */
#include "ConvertUTF.h"
#ifdef CVTUTF_DEBUG
#include <stdio.h>
#endif
static const int halfShift = 10; /* used for shifting by 10 bits */
static const UTF32 halfBase = 0x0010000UL;
static const UTF32 halfMask = 0x3FFUL;
#define UNI_SUR_HIGH_START (UTF32)0xD800
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
#define UNI_SUR_LOW_START (UTF32)0xDC00
#define UNI_SUR_LOW_END (UTF32)0xDFFF
#define false 0
#define true 1
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF32toUTF16 (
const UTF32** sourceStart, const UTF32* sourceEnd,
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF32* source = *sourceStart;
UTF16* target = *targetStart;
while (source < sourceEnd) {
UTF32 ch;
if (target >= targetEnd) {
result = targetExhausted; break;
}
ch = *source++;
if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
/* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
if (flags == strictConversion) {
--source; /* return to the illegal value itself */
result = sourceIllegal;
break;
} else {
*target++ = UNI_REPLACEMENT_CHAR;
}
} else {
*target++ = (UTF16)ch; /* normal case */
}
} else if (ch > UNI_MAX_LEGAL_UTF32) {
if (flags == strictConversion) {
result = sourceIllegal;
} else {
*target++ = UNI_REPLACEMENT_CHAR;
}
} else {
/* target is a character in range 0xFFFF - 0x10FFFF. */
if (target + 1 >= targetEnd) {
--source; /* Back up source pointer! */
result = targetExhausted; break;
}
ch -= halfBase;
*target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
*target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
}
}
*sourceStart = source;
*targetStart = target;
return result;
}
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF16toUTF32 (
const UTF16** sourceStart, const UTF16* sourceEnd,
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF16* source = *sourceStart;
UTF32* target = *targetStart;
UTF32 ch, ch2;
while (source < sourceEnd) {
const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
ch = *source++;
/* If we have a surrogate pair, convert to UTF32 first. */
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
/* If the 16 bits following the high surrogate are in the source buffer... */
if (source < sourceEnd) {
ch2 = *source;
/* If it's a low surrogate, convert to UTF32. */
if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+ (ch2 - UNI_SUR_LOW_START) + halfBase;
++source;
} else if (flags == strictConversion) { /* it's an unpaired high surrogate */
--source; /* return to the illegal value itself */
result = sourceIllegal;
break;
}
} else { /* We don't have the 16 bits following the high surrogate. */
--source; /* return to the high surrogate */
result = sourceExhausted;
break;
}
} else if (flags == strictConversion) {
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
--source; /* return to the illegal value itself */
result = sourceIllegal;
break;
}
}
if (target >= targetEnd) {
source = oldSource; /* Back up source pointer! */
result = targetExhausted; break;
}
*target++ = ch;
}
*sourceStart = source;
*targetStart = target;
#ifdef CVTUTF_DEBUG
if (result == sourceIllegal) {
fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2);
fflush(stderr);
}
#endif
return result;
}
/* --------------------------------------------------------------------- */
/*
* Index into the table below with the first byte of a UTF-8 sequence to
* get the number of trailing bytes that are supposed to follow it.
* Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
* left as-is for anyone who may want to do such conversion, which was
* allowed in earlier algorithms.
*/
static const char trailingBytesForUTF8[256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
};
/*
* Magic values subtracted from a buffer value during UTF8 conversion.
* This table contains as many values as there might be trailing bytes
* in a UTF-8 sequence.
*/
static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
0x03C82080UL, 0xFA082080UL, 0x82082080UL };
/*
* Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
* into the first byte, depending on how many bytes follow. There are
* as many entries in this table as there are UTF-8 sequence types.
* (I.e., one byte sequence, two byte... etc.). Remember that sequencs
* for *legal* UTF-8 will be 4 or fewer bytes total.
*/
static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
/* --------------------------------------------------------------------- */
/* The interface converts a whole buffer to avoid function-call overhead.
* Constants have been gathered. Loops & conditionals have been removed as
* much as possible for efficiency, in favor of drop-through switches.
* (See "Note A" at the bottom of the file for equivalent code.)
* If your compiler supports it, the "isLegalUTF8" call can be turned
* into an inline function.
*/
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF16toUTF8 (
const UTF16** sourceStart, const UTF16* sourceEnd,
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF16* source = *sourceStart;
UTF8* target = *targetStart;
while (source < sourceEnd) {
UTF32 ch;
unsigned short bytesToWrite = 0;
const UTF32 byteMask = 0xBF;
const UTF32 byteMark = 0x80;
const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
ch = *source++;
/* If we have a surrogate pair, convert to UTF32 first. */
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
/* If the 16 bits following the high surrogate are in the source buffer... */
if (source < sourceEnd) {
UTF32 ch2 = *source;
/* If it's a low surrogate, convert to UTF32. */
if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+ (ch2 - UNI_SUR_LOW_START) + halfBase;
++source;
} else if (flags == strictConversion) { /* it's an unpaired high surrogate */
--source; /* return to the illegal value itself */
result = sourceIllegal;
break;
}
} else { /* We don't have the 16 bits following the high surrogate. */
--source; /* return to the high surrogate */
result = sourceExhausted;
break;
}
} else if (flags == strictConversion) {
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
--source; /* return to the illegal value itself */
result = sourceIllegal;
break;
}
}
/* Figure out how many bytes the result will require */
if (ch < (UTF32)0x80) { bytesToWrite = 1;
} else if (ch < (UTF32)0x800) { bytesToWrite = 2;
} else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
} else if (ch < (UTF32)0x110000) { bytesToWrite = 4;
} else { bytesToWrite = 3;
ch = UNI_REPLACEMENT_CHAR;
}
target += bytesToWrite;
if (target > targetEnd) {
source = oldSource; /* Back up source pointer! */
target -= bytesToWrite; result = targetExhausted; break;
}
switch (bytesToWrite) { /* note: everything falls through. */
case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
}
target += bytesToWrite;
}
*sourceStart = source;
*targetStart = target;
return result;
}
/* --------------------------------------------------------------------- */
/*
* Utility routine to tell whether a sequence of bytes is legal UTF-8.
* This must be called with the length pre-determined by the first byte.
* If not calling this from ConvertUTF8to*, then the length can be set by:
* length = trailingBytesForUTF8[*source]+1;
* and the sequence is illegal right away if there aren't that many bytes
* available.
* If presented with a length > 4, this returns false. The Unicode
* definition of UTF-8 goes up to 4-byte sequences.
*/
static Boolean isLegalUTF8(const UTF8 *source, int length) {
UTF8 a;
const UTF8 *srcptr = source+length;
switch (length) {
default: return false;
/* Everything else falls through when "true"... */
case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
case 2: if ((a = (*--srcptr)) > 0xBF) return false;
switch (*source) {
/* no fall-through in this inner switch */
case 0xE0: if (a < 0xA0) return false; break;
case 0xED: if (a > 0x9F) return false; break;
case 0xF0: if (a < 0x90) return false; break;
case 0xF4: if (a > 0x8F) return false; break;
default: if (a < 0x80) return false;
}
case 1: if (*source >= 0x80 && *source < 0xC2) return false;
}
if (*source > 0xF4) return false;
return true;
}
/* --------------------------------------------------------------------- */
/*
* Exported function to return whether a UTF-8 sequence is legal or not.
* This is not used here; it's just exported.
*/
Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
int length = trailingBytesForUTF8[*source]+1;
if (source+length > sourceEnd) {
return false;
}
return isLegalUTF8(source, length);
}
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF8toUTF16 (
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF8* source = *sourceStart;
UTF16* target = *targetStart;
while (source < sourceEnd) {
UTF32 ch = 0;
unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
if (source + extraBytesToRead >= sourceEnd) {
result = sourceExhausted; break;
}
/* Do this check whether lenient or strict */
if (! isLegalUTF8(source, extraBytesToRead+1)) {
result = sourceIllegal;
break;
}
/*
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
case 3: ch += *source++; ch <<= 6;
case 2: ch += *source++; ch <<= 6;
case 1: ch += *source++; ch <<= 6;
case 0: ch += *source++;
}
ch -= offsetsFromUTF8[extraBytesToRead];
if (target >= targetEnd) {
source -= (extraBytesToRead+1); /* Back up source pointer! */
result = targetExhausted; break;
}
if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
if (flags == strictConversion) {
source -= (extraBytesToRead+1); /* return to the illegal value itself */
result = sourceIllegal;
break;
} else {
*target++ = UNI_REPLACEMENT_CHAR;
}
} else {
*target++ = (UTF16)ch; /* normal case */
}
} else if (ch > UNI_MAX_UTF16) {
if (flags == strictConversion) {
result = sourceIllegal;
source -= (extraBytesToRead+1); /* return to the start */
break; /* Bail out; shouldn't continue */
} else {
*target++ = UNI_REPLACEMENT_CHAR;
}
} else {
/* target is a character in range 0xFFFF - 0x10FFFF. */
if (target + 1 >= targetEnd) {
source -= (extraBytesToRead+1); /* Back up source pointer! */
result = targetExhausted; break;
}
ch -= halfBase;
*target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
*target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
}
}
*sourceStart = source;
*targetStart = target;
return result;
}
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF32toUTF8 (
const UTF32** sourceStart, const UTF32* sourceEnd,
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF32* source = *sourceStart;
UTF8* target = *targetStart;
while (source < sourceEnd) {
UTF32 ch;
unsigned short bytesToWrite = 0;
const UTF32 byteMask = 0xBF;
const UTF32 byteMark = 0x80;
ch = *source++;
if (flags == strictConversion ) {
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
--source; /* return to the illegal value itself */
result = sourceIllegal;
break;
}
}
/*
* Figure out how many bytes the result will require. Turn any
* illegally large UTF32 things (> Plane 17) into replacement chars.
*/
if (ch < (UTF32)0x80) { bytesToWrite = 1;
} else if (ch < (UTF32)0x800) { bytesToWrite = 2;
} else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
} else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4;
} else { bytesToWrite = 3;
ch = UNI_REPLACEMENT_CHAR;
result = sourceIllegal;
}
target += bytesToWrite;
if (target > targetEnd) {
--source; /* Back up source pointer! */
target -= bytesToWrite; result = targetExhausted; break;
}
switch (bytesToWrite) { /* note: everything falls through. */
case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
}
target += bytesToWrite;
}
*sourceStart = source;
*targetStart = target;
return result;
}
/* --------------------------------------------------------------------- */
ConversionResult ConvertUTF8toUTF32 (
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
ConversionResult result = conversionOK;
const UTF8* source = *sourceStart;
UTF32* target = *targetStart;
while (source < sourceEnd) {
UTF32 ch = 0;
unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
if (source + extraBytesToRead >= sourceEnd) {
result = sourceExhausted; break;
}
/* Do this check whether lenient or strict */
if (! isLegalUTF8(source, extraBytesToRead+1)) {
result = sourceIllegal;
break;
}
/*
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
case 5: ch += *source++; ch <<= 6;
case 4: ch += *source++; ch <<= 6;
case 3: ch += *source++; ch <<= 6;
case 2: ch += *source++; ch <<= 6;
case 1: ch += *source++; ch <<= 6;
case 0: ch += *source++;
}
ch -= offsetsFromUTF8[extraBytesToRead];
if (target >= targetEnd) {
source -= (extraBytesToRead+1); /* Back up the source pointer! */
result = targetExhausted; break;
}
if (ch <= UNI_MAX_LEGAL_UTF32) {
/*
* UTF-16 surrogate values are illegal in UTF-32, and anything
* over Plane 17 (> 0x10FFFF) is illegal.
*/
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
if (flags == strictConversion) {
source -= (extraBytesToRead+1); /* return to the illegal value itself */
result = sourceIllegal;
break;
} else {
*target++ = UNI_REPLACEMENT_CHAR;
}
} else {
*target++ = ch;
}
} else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
result = sourceIllegal;
*target++ = UNI_REPLACEMENT_CHAR;
}
}
*sourceStart = source;
*targetStart = target;
return result;
}
/* ---------------------------------------------------------------------
Note A.
The fall-through switches in UTF-8 reading code save a
temp variable, some decrements & conditionals. The switches
are equivalent to the following loop:
{
int tmpBytesToRead = extraBytesToRead+1;
do {
ch += *source++;
--tmpBytesToRead;
if (tmpBytesToRead) ch <<= 6;
} while (tmpBytesToRead > 0);
}
In UTF-8 writing code, the switches on "bytesToWrite" are
similarly unrolled loops.
--------------------------------------------------------------------- */
+149
View File
@@ -0,0 +1,149 @@
/*
* Copyright 2001-2004 Unicode, Inc.
*
* Disclaimer
*
* This source code is provided as is by Unicode, Inc. No claims are
* made as to fitness for any particular purpose. No warranties of any
* kind are expressed or implied. The recipient agrees to determine
* applicability of information provided. If this file has been
* purchased on magnetic or optical media from Unicode, Inc., the
* sole remedy for any claim will be exchange of defective media
* within 90 days of receipt.
*
* Limitations on Rights to Redistribute This Code
*
* Unicode, Inc. hereby grants the right to freely use the information
* supplied in this file in the creation of products supporting the
* Unicode Standard, and to make copies of this file in any form
* for internal or external distribution as long as this notice
* remains attached.
*/
/* ---------------------------------------------------------------------
Conversions between UTF32, UTF-16, and UTF-8. Header file.
Several funtions are included here, forming a complete set of
conversions between the three formats. UTF-7 is not included
here, but is handled in a separate source file.
Each of these routines takes pointers to input buffers and output
buffers. The input buffers are const.
Each routine converts the text between *sourceStart and sourceEnd,
putting the result into the buffer between *targetStart and
targetEnd. Note: the end pointers are *after* the last item: e.g.
*(sourceEnd - 1) is the last item.
The return result indicates whether the conversion was successful,
and if not, whether the problem was in the source or target buffers.
(Only the first encountered problem is indicated.)
After the conversion, *sourceStart and *targetStart are both
updated to point to the end of last text successfully converted in
the respective buffers.
Input parameters:
sourceStart - pointer to a pointer to the source buffer.
The contents of this are modified on return so that
it points at the next thing to be converted.
targetStart - similarly, pointer to pointer to the target buffer.
sourceEnd, targetEnd - respectively pointers to the ends of the
two buffers, for overflow checking only.
These conversion functions take a ConversionFlags argument. When this
flag is set to strict, both irregular sequences and isolated surrogates
will cause an error. When the flag is set to lenient, both irregular
sequences and isolated surrogates are converted.
Whether the flag is strict or lenient, all illegal sequences will cause
an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
must check for illegal sequences.
When the flag is set to lenient, characters over 0x10FFFF are converted
to the replacement character; otherwise (when the flag is set to strict)
they constitute an error.
Output parameters:
The value "sourceIllegal" is returned from some routines if the input
sequence is malformed. When "sourceIllegal" is returned, the source
value will point to the illegal value that caused the problem. E.g.,
in UTF-8 when a sequence is malformed, it points to the start of the
malformed sequence.
Author: Mark E. Davis, 1994.
Rev History: Rick McGowan, fixes & updates May 2001.
Fixes & updates, Sept 2001.
------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------
The following 4 definitions are compiler-specific.
The C standard does not guarantee that wchar_t has at least
16 bits, so wchar_t is no less portable than unsigned short!
All should be unsigned values to avoid sign extension during
bit mask & shift operations.
------------------------------------------------------------------------ */
typedef unsigned int UTF32; /* at least 32 bits */
typedef unsigned short UTF16; /* at least 16 bits */
typedef unsigned char UTF8; /* typically 8 bits */
typedef unsigned char Boolean; /* 0 or 1 */
/* Some fundamental constants */
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
#define UNI_MAX_BMP (UTF32)0x0000FFFF
#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
typedef enum {
conversionOK, /* conversion successful */
sourceExhausted, /* partial character in source, but hit end */
targetExhausted, /* insuff. room in target for conversion */
sourceIllegal /* source sequence is illegal/malformed */
} ConversionResult;
typedef enum {
strictConversion = 0,
lenientConversion
} ConversionFlags;
/* This is for C++ and does no harm in C */
#ifdef __cplusplus
extern "C" {
#endif
ConversionResult ConvertUTF8toUTF16 (
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
ConversionResult ConvertUTF16toUTF8 (
const UTF16** sourceStart, const UTF16* sourceEnd,
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
ConversionResult ConvertUTF8toUTF32 (
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
ConversionResult ConvertUTF32toUTF8 (
const UTF32** sourceStart, const UTF32* sourceEnd,
UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
ConversionResult ConvertUTF16toUTF32 (
const UTF16** sourceStart, const UTF16* sourceEnd,
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
ConversionResult ConvertUTF32toUTF16 (
const UTF32** sourceStart, const UTF32* sourceEnd,
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
#ifdef __cplusplus
}
#endif
/* --------------------------------------------------------------------- */
+20
View File
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2006-2013 Brodie Thiesfield
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+150
View File
@@ -0,0 +1,150 @@
simpleini
=========
A cross-platform library that provides a simple API to read and write INI-style configuration files. It supports data files in ASCII, MBCS and Unicode. It is designed explicitly to be portable to any platform and has been tested on Windows, WinCE and Linux. Released as open-source and free using the MIT licence.
# Feature Summary
- MIT Licence allows free use in all software (including GPL and commercial)
- multi-platform (Windows 95/98/ME/NT/2K/XP/2003, Windows CE, Linux, Unix)
- loading and saving of INI-style configuration files
- configuration files can have any newline format on all platforms
- liberal acceptance of file format
* key/values with no section
* removal of whitespace around sections, keys and values
- support for multi-line values (values with embedded newline characters)
- optional support for multiple keys with the same name
- optional case-insensitive sections and keys (for ASCII characters only)
- saves files with sections and keys in the same order as they were loaded
- preserves comments on the file, section and keys where possible.
- supports both char or wchar_t programming interfaces
- supports both MBCS (system locale) and UTF-8 file encodings
- system locale does not need to be UTF-8 on Linux/Unix to load UTF-8 file
- support for non-ASCII characters in section, keys, values and comments
- support for non-standard character types or file encodings via user-written converter classes
- support for adding/modifying values programmatically
- compiles cleanly in the following compilers:
* Windows/VC6 (warning level 3)
* Windows/VC.NET 2003 (warning level 4)
* Windows/VC 2005 (warning level 4)
* Linux/gcc (-Wall)
* Windows/MinGW GCC
# Documentation
Full documentation of the interface is available in doxygen format.
# Examples
These snippets are included with the distribution in the file snippets.cpp.
### SIMPLE USAGE
```c++
CSimpleIniA ini;
ini.SetUnicode();
ini.LoadFile("myfile.ini");
const char * pVal = ini.GetValue("section", "key", "default");
ini.SetValue("section", "key", "newvalue");
```
### LOADING DATA
```c++
// load from a data file
CSimpleIniA ini(a_bIsUtf8, a_bUseMultiKey, a_bUseMultiLine);
SI_Error rc = ini.LoadFile(a_pszFile);
if (rc < 0) return false;
// load from a string
std::string strData;
rc = ini.LoadData(strData.c_str(), strData.size());
if (rc < 0) return false;
```
### GETTING SECTIONS AND KEYS
```c++
// get all sections
CSimpleIniA::TNamesDepend sections;
ini.GetAllSections(sections);
// get all keys in a section
CSimpleIniA::TNamesDepend keys;
ini.GetAllKeys("section-name", keys);
```
### GETTING VALUES
```c++
// get the value of a key
const char * pszValue = ini.GetValue("section-name",
"key-name", NULL /*default*/);
// get the value of a key which may have multiple
// values. If bHasMultipleValues is true, then just
// one value has been returned
bool bHasMultipleValues;
pszValue = ini.GetValue("section-name", "key-name",
NULL /*default*/, &amp;bHasMultipleValues);
// get all values of a key with multiple values
CSimpleIniA::TNamesDepend values;
ini.GetAllValues("section-name", "key-name", values);
// sort the values into the original load order
values.sort(CSimpleIniA::Entry::LoadOrder());
// output all of the items
CSimpleIniA::TNamesDepend::const_iterator i;
for (i = values.begin(); i != values.end(); ++i) {
printf("key-name = '%s'\n", i->pItem);
}
```
### MODIFYING DATA
```c++
// adding a new section
rc = ini.SetValue("new-section", NULL, NULL);
if (rc < 0) return false;
printf("section: %s\n", rc == SI_INSERTED ?
"inserted" : "updated");
// adding a new key ("new-section" will be added
// automatically if it doesn't already exist)
rc = ini.SetValue("new-section", "new-key", "value");
if (rc < 0) return false;
printf("key: %s\n", rc == SI_INSERTED ?
"inserted" : "updated");
// changing the value of a key
rc = ini.SetValue("section", "key", "updated-value");
if (rc < 0) return false;
printf("key: %s\n", rc == SI_INSERTED ?
"inserted" : "updated");
```
### DELETING DATA
```c++
// deleting a key from a section. Optionally the entire
// section may be deleted if it is now empty.
ini.Delete("section-name", "key-name",
true /*delete the section if empty*/);
// deleting an entire section and all keys in it
ini.Delete("section-name", NULL);
```
### SAVING DATA
```c++
// save the data to a string
rc = ini.Save(strData);
if (rc < 0) return false;
// save the data back to the file
rc = ini.SaveFile(a_pszFile);
if (rc < 0) return false;
```
File diff suppressed because it is too large Load Diff
Submodule
+1
Submodule asmjit added at a66efd5460
+174
View File
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\asmjit\src\asmjit\base\assembler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\codegen.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\compiler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\constpool.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\context.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\cpuinfo.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\cputicks.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\error.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\globals.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\logger.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\operand.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\podvector.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\runtime.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\string.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\vmem.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\zone.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\contrib\winremoteruntime.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86assembler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86compiler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86context.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86cpuinfo.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86func.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86inst.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86operand.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86regs.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\asmjit\src\asmjit\base\constpool.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{AC40FF01-426E-4838-A317-66354CEFAE88}</ProjectGuid>
<RootNamespace>asmjit</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)libs\$(Configuration)\</OutDir>
<IntDir>
</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)libs\$(Configuration)\</OutDir>
<IntDir>
</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)libs\$(Configuration)\</OutDir>
<IntDir>
</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)libs\$(Configuration)\</OutDir>
<IntDir>
</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>ASMJIT_STATIC;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>ASMJIT_STATIC;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>ASMJIT_STATIC;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>ASMJIT_STATIC;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\asmjit\src\asmjit\x86\x86assembler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86compiler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86context.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86cpuinfo.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86func.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\contrib\winremoteruntime.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\assembler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\codegen.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\compiler.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\context.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\cpuinfo.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\cputicks.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\error.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\globals.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\logger.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\podvector.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\runtime.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\string.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\vmem.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\zone.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\constpool.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\base\operand.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86inst.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86operand.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86regs.cpp" />
<ClCompile Include="..\asmjit\src\asmjit\x86\x86util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\asmjit\src\asmjit\base\constpool.h" />
</ItemGroup>
</Project>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
+1
View File
@@ -0,0 +1 @@
User
@@ -0,0 +1,6 @@
# Note: This folder has to exist. Once the User Account manager is implemented, make sure it creates this folder in case it's missing and delete this .gitignore file.
# Ignore everything in this directory
*
# Except this file
!.gitignore
@@ -0,0 +1,6 @@
# Note: This folder has to exist. Once the User Account manager is implemented, make sure it creates this folder in case it's missing and delete this .gitignore file.
# Ignore everything in this directory
*
# Except this file
!.gitignore
+6
View File
@@ -0,0 +1,6 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
!cache
!cache/README.txt
+1
View File
@@ -0,0 +1 @@
every Folder in this directory gets cleared when cellSysCacheClear() is called, so don't store important data here
+4
View File
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
Submodule
+1
Submodule ffmpeg added at 8bcaa2485c
+328 -262
View File
@@ -1,262 +1,328 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}"
ProjectSection(ProjectDependencies) = postProject
{3111D679-7796-23C4-BA0C-271F1145DA24} = {3111D679-7796-23C4-BA0C-271F1145DA24}
{5C363C34-4741-7036-861C-2E2279CF552E} = {5C363C34-4741-7036-861C-2E2279CF552E}
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2} = {46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01} = {949C6DB8-E638-6EC6-AB31-BCCFD1379E01}
{99C9EB95-DB4C-1996-490E-5212EFBF07C3} = {99C9EB95-DB4C-1996-490E-5212EFBF07C3}
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9} = {B87216CD-6C64-1DB0-D900-BC6E745C1DF9}
{76169FE8-0814-4F36-6409-699EF1A23001} = {76169FE8-0814-4F36-6409-699EF1A23001}
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
{7047EE97-7F80-A70D-6147-BC11102DB6F4} = {7047EE97-7F80-A70D-6147-BC11102DB6F4}
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA} = {AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wxWidgets", "wxWidgets", "{5812E712-6213-4372-B095-9EB9BAA1F2DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adv", "wxWidgets\build\msw\wx_adv.vcxproj", "{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "wxWidgets\build\msw\wx_aui.vcxproj", "{7047EE97-7F80-A70D-6147-BC11102DB6F4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "wxWidgets\build\msw\wx_base.vcxproj", "{3111D679-7796-23C4-BA0C-271F1145DA24}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "wxWidgets\build\msw\wx_core.vcxproj", "{067D9406-2A93-DACA-9449-93A2D356357D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbgrid", "wxWidgets\build\msw\wx_dbgrid.vcxproj", "{9ED1866B-D4AE-3440-24E4-7A9475B163B2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gl", "wxWidgets\build\msw\wx_gl.vcxproj", "{99C9EB95-DB4C-1996-490E-5212EFBF07C3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "html", "wxWidgets\build\msw\wx_html.vcxproj", "{6EDC3B79-D217-F11A-406F-F11D856493F9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "media", "wxWidgets\build\msw\wx_media.vcxproj", "{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "net", "wxWidgets\build\msw\wx_net.vcxproj", "{CD478F02-7550-58A5-E085-CE4BC0C0AD23}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "odbc", "wxWidgets\build\msw\wx_odbc.vcxproj", "{C051C502-820F-2983-EF97-144C0CD92905}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qa", "wxWidgets\build\msw\wx_qa.vcxproj", "{22B14659-C5B6-B775-868D-A49198FEAD4A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "richtext", "wxWidgets\build\msw\wx_richtext.vcxproj", "{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxexpat", "wxWidgets\build\msw\wx_wxexpat.vcxproj", "{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxjpeg", "wxWidgets\build\msw\wx_wxjpeg.vcxproj", "{5C363C34-4741-7036-861C-2E2279CF552E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxpng", "wxWidgets\build\msw\wx_wxpng.vcxproj", "{76169FE8-0814-4F36-6409-699EF1A23001}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxregex", "wxWidgets\build\msw\wx_wxregex.vcxproj", "{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxtiff", "wxWidgets\build\msw\wx_wxtiff.vcxproj", "{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxzlib", "wxWidgets\build\msw\wx_wxzlib.vcxproj", "{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "wxWidgets\build\msw\wx_xml.vcxproj", "{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "wxWidgets\build\msw\wx_xrc.vcxproj", "{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|Win32.ActiveCfg = Debug|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|Win32.Build.0 = Debug|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.ActiveCfg = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.Build.0 = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|Win32.ActiveCfg = Release|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|Win32.Build.0 = Release|Win32
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.ActiveCfg = Release|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.Build.0 = Release|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|Win32.ActiveCfg = Debug|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|Win32.Build.0 = Debug|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|x64.ActiveCfg = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|x64.Build.0 = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|Win32.ActiveCfg = Release|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|Win32.Build.0 = Release|Win32
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|x64.ActiveCfg = Release|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|x64.Build.0 = Release|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|Win32.ActiveCfg = Debug|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|Win32.Build.0 = Debug|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|x64.ActiveCfg = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|x64.Build.0 = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|Win32.ActiveCfg = Release|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|Win32.Build.0 = Release|Win32
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|x64.ActiveCfg = Release|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|x64.Build.0 = Release|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|Win32.ActiveCfg = Debug|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|Win32.Build.0 = Debug|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|x64.ActiveCfg = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|x64.Build.0 = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|Win32.ActiveCfg = Release|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|Win32.Build.0 = Release|Win32
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|x64.ActiveCfg = Release|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|x64.Build.0 = Release|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|Win32.ActiveCfg = Debug|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|Win32.Build.0 = Debug|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|x64.ActiveCfg = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|x64.Build.0 = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|Win32.ActiveCfg = Release|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|Win32.Build.0 = Release|Win32
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|x64.ActiveCfg = Release|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|x64.Build.0 = Release|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|Win32.ActiveCfg = Debug|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|Win32.Build.0 = Debug|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|x64.ActiveCfg = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|x64.Build.0 = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|Win32.ActiveCfg = Release|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|Win32.Build.0 = Release|Win32
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|x64.ActiveCfg = Release|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|x64.Build.0 = Release|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|Win32.ActiveCfg = Debug|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|Win32.Build.0 = Debug|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|x64.ActiveCfg = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|x64.Build.0 = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|Win32.ActiveCfg = Release|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|Win32.Build.0 = Release|Win32
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|x64.ActiveCfg = Release|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|x64.Build.0 = Release|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|Win32.ActiveCfg = Debug|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|Win32.Build.0 = Debug|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|x64.ActiveCfg = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|x64.Build.0 = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|Win32.ActiveCfg = Release|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|Win32.Build.0 = Release|Win32
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|x64.ActiveCfg = Release|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|x64.Build.0 = Release|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|Win32.ActiveCfg = Debug|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|Win32.Build.0 = Debug|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|x64.ActiveCfg = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|x64.Build.0 = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|Win32.ActiveCfg = Release|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|Win32.Build.0 = Release|Win32
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|x64.ActiveCfg = Release|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|x64.Build.0 = Release|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|Win32.ActiveCfg = Debug|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|Win32.Build.0 = Debug|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|x64.ActiveCfg = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|x64.Build.0 = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|Win32.ActiveCfg = Release|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|Win32.Build.0 = Release|Win32
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|x64.ActiveCfg = Release|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|x64.Build.0 = Release|x64
{C051C502-820F-2983-EF97-144C0CD92905}.Debug|Win32.ActiveCfg = Debug|Win32
{C051C502-820F-2983-EF97-144C0CD92905}.Debug|Win32.Build.0 = Debug|Win32
{C051C502-820F-2983-EF97-144C0CD92905}.Debug|x64.ActiveCfg = Debug|x64
{C051C502-820F-2983-EF97-144C0CD92905}.Debug|x64.Build.0 = Debug|x64
{C051C502-820F-2983-EF97-144C0CD92905}.Release|Win32.ActiveCfg = Release|Win32
{C051C502-820F-2983-EF97-144C0CD92905}.Release|Win32.Build.0 = Release|Win32
{C051C502-820F-2983-EF97-144C0CD92905}.Release|x64.ActiveCfg = Release|x64
{C051C502-820F-2983-EF97-144C0CD92905}.Release|x64.Build.0 = Release|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|Win32.ActiveCfg = Debug|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|Win32.Build.0 = Debug|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|x64.ActiveCfg = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|x64.Build.0 = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|Win32.ActiveCfg = Release|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|Win32.Build.0 = Release|Win32
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|x64.ActiveCfg = Release|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|x64.Build.0 = Release|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|Win32.ActiveCfg = Debug|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|Win32.Build.0 = Debug|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|x64.ActiveCfg = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|x64.Build.0 = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|Win32.ActiveCfg = Release|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|Win32.Build.0 = Release|Win32
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|x64.ActiveCfg = Release|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|x64.Build.0 = Release|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|Win32.ActiveCfg = Debug|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|Win32.Build.0 = Debug|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|x64.ActiveCfg = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|x64.Build.0 = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|Win32.ActiveCfg = Release|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|Win32.Build.0 = Release|Win32
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|x64.ActiveCfg = Release|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|x64.Build.0 = Release|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|Win32.ActiveCfg = Debug|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|Win32.Build.0 = Debug|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|x64.ActiveCfg = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|x64.Build.0 = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|Win32.ActiveCfg = Release|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|Win32.Build.0 = Release|Win32
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|x64.ActiveCfg = Release|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|x64.Build.0 = Release|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|Win32.ActiveCfg = Debug|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|Win32.Build.0 = Debug|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|x64.ActiveCfg = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|x64.Build.0 = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|Win32.ActiveCfg = Release|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|Win32.Build.0 = Release|Win32
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|x64.ActiveCfg = Release|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|x64.Build.0 = Release|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|Win32.ActiveCfg = Debug|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|Win32.Build.0 = Debug|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|x64.ActiveCfg = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|x64.Build.0 = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|Win32.ActiveCfg = Release|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|Win32.Build.0 = Release|Win32
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|x64.ActiveCfg = Release|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|x64.Build.0 = Release|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|Win32.ActiveCfg = Debug|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|Win32.Build.0 = Debug|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|x64.ActiveCfg = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|x64.Build.0 = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|Win32.ActiveCfg = Release|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|Win32.Build.0 = Release|Win32
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|x64.ActiveCfg = Release|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|x64.Build.0 = Release|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|Win32.ActiveCfg = Debug|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|Win32.Build.0 = Debug|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|x64.ActiveCfg = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|x64.Build.0 = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|Win32.ActiveCfg = Release|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|Win32.Build.0 = Release|Win32
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|x64.ActiveCfg = Release|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|x64.Build.0 = Release|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|Win32.ActiveCfg = Debug|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|Win32.Build.0 = Debug|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|x64.ActiveCfg = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|x64.Build.0 = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|Win32.ActiveCfg = Release|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|Win32.Build.0 = Release|Win32
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|x64.ActiveCfg = Release|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|x64.Build.0 = Release|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|Win32.ActiveCfg = Debug|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|Win32.Build.0 = Debug|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|x64.ActiveCfg = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|x64.Build.0 = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|Win32.ActiveCfg = Release|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|Win32.Build.0 = Release|Win32
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|x64.ActiveCfg = Release|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{7047EE97-7F80-A70D-6147-BC11102DB6F4} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{3111D679-7796-23C4-BA0C-271F1145DA24} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{067D9406-2A93-DACA-9449-93A2D356357D} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{9ED1866B-D4AE-3440-24E4-7A9475B163B2} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{99C9EB95-DB4C-1996-490E-5212EFBF07C3} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{6EDC3B79-D217-F11A-406F-F11D856493F9} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{CD478F02-7550-58A5-E085-CE4BC0C0AD23} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{C051C502-820F-2983-EF97-144C0CD92905} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{22B14659-C5B6-B775-868D-A49198FEAD4A} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{5C363C34-4741-7036-861C-2E2279CF552E} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{76169FE8-0814-4F36-6409-699EF1A23001} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}"
ProjectSection(ProjectDependencies) = postProject
{AC40FF01-426E-4838-A317-66354CEFAE88} = {AC40FF01-426E-4838-A317-66354CEFAE88}
{CD478F02-7550-58A5-E085-CE4BC0C0AD23} = {CD478F02-7550-58A5-E085-CE4BC0C0AD23}
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
{C4A10229-4712-4BD2-B63E-50D93C67A038} = {C4A10229-4712-4BD2-B63E-50D93C67A038}
{5C363C34-4741-7036-861C-2E2279CF552E} = {5C363C34-4741-7036-861C-2E2279CF552E}
{23E1C437-A951-5943-8639-A17F3CF2E606} = {23E1C437-A951-5943-8639-A17F3CF2E606}
{22B14659-C5B6-B775-868D-A49198FEAD4A} = {22B14659-C5B6-B775-868D-A49198FEAD4A}
{9ED1866B-D4AE-3440-24E4-7A9475B163B2} = {9ED1866B-D4AE-3440-24E4-7A9475B163B2}
{6EDC3B79-D217-F11A-406F-F11D856493F9} = {6EDC3B79-D217-F11A-406F-F11D856493F9}
{3111D679-7796-23C4-BA0C-271F1145DA24} = {3111D679-7796-23C4-BA0C-271F1145DA24}
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA} = {AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774} = {FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6} = {8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}
{99C9EB95-DB4C-1996-490E-5212EFBF07C3} = {99C9EB95-DB4C-1996-490E-5212EFBF07C3}
{7047EE97-7F80-A70D-6147-BC11102DB6F4} = {7047EE97-7F80-A70D-6147-BC11102DB6F4}
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D} = {87B42A9C-3F5C-53D7-9017-2B1CAE39457D}
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01} = {949C6DB8-E638-6EC6-AB31-BCCFD1379E01}
{74827EBD-93DC-5110-BA95-3F2AB029B6B0} = {74827EBD-93DC-5110-BA95-3F2AB029B6B0}
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2} = {46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9} = {B87216CD-6C64-1DB0-D900-BC6E745C1DF9}
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} = {6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}
{76169FE8-0814-4F36-6409-699EF1A23001} = {76169FE8-0814-4F36-6409-699EF1A23001}
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25} = {A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wxWidgets", "wxWidgets", "{5812E712-6213-4372-B095-9EB9BAA1F2DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adv", "wxWidgets\build\msw\wx_vc10_adv.vcxproj", "{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "wxWidgets\build\msw\wx_vc10_aui.vcxproj", "{7047EE97-7F80-A70D-6147-BC11102DB6F4}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
{6EDC3B79-D217-F11A-406F-F11D856493F9} = {6EDC3B79-D217-F11A-406F-F11D856493F9}
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "wxWidgets\build\msw\wx_vc10_base.vcxproj", "{3111D679-7796-23C4-BA0C-271F1145DA24}"
ProjectSection(ProjectDependencies) = postProject
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA} = {AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01} = {949C6DB8-E638-6EC6-AB31-BCCFD1379E01}
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2} = {46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "wxWidgets\build\msw\wx_vc10_core.vcxproj", "{067D9406-2A93-DACA-9449-93A2D356357D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "propgrid", "wxWidgets\build\msw\wx_vc10_propgrid.vcxproj", "{9ED1866B-D4AE-3440-24E4-7A9475B163B2}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gl", "wxWidgets\build\msw\wx_vc10_gl.vcxproj", "{99C9EB95-DB4C-1996-490E-5212EFBF07C3}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "html", "wxWidgets\build\msw\wx_vc10_html.vcxproj", "{6EDC3B79-D217-F11A-406F-F11D856493F9}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "media", "wxWidgets\build\msw\wx_vc10_media.vcxproj", "{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "net", "wxWidgets\build\msw\wx_vc10_net.vcxproj", "{CD478F02-7550-58A5-E085-CE4BC0C0AD23}"
ProjectSection(ProjectDependencies) = postProject
{3111D679-7796-23C4-BA0C-271F1145DA24} = {3111D679-7796-23C4-BA0C-271F1145DA24}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qa", "wxWidgets\build\msw\wx_vc10_qa.vcxproj", "{22B14659-C5B6-B775-868D-A49198FEAD4A}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} = {6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "richtext", "wxWidgets\build\msw\wx_vc10_richtext.vcxproj", "{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}"
ProjectSection(ProjectDependencies) = postProject
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} = {6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxexpat", "wxWidgets\build\msw\wx_vc10_wxexpat.vcxproj", "{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxjpeg", "wxWidgets\build\msw\wx_vc10_wxjpeg.vcxproj", "{5C363C34-4741-7036-861C-2E2279CF552E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxpng", "wxWidgets\build\msw\wx_vc10_wxpng.vcxproj", "{76169FE8-0814-4F36-6409-699EF1A23001}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxregex", "wxWidgets\build\msw\wx_vc10_wxregex.vcxproj", "{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxtiff", "wxWidgets\build\msw\wx_vc10_wxtiff.vcxproj", "{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxzlib", "wxWidgets\build\msw\wx_vc10_wxzlib.vcxproj", "{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "wxWidgets\build\msw\wx_vc10_xml.vcxproj", "{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}"
ProjectSection(ProjectDependencies) = postProject
{3111D679-7796-23C4-BA0C-271F1145DA24} = {3111D679-7796-23C4-BA0C-271F1145DA24}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "wxWidgets\build\msw\wx_vc10_xrc.vcxproj", "{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}"
ProjectSection(ProjectDependencies) = postProject
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} = {6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "stblib", "stblib", "{9D839DFB-76E6-4F10-8EED-BA2AC7CC3FB6}"
ProjectSection(SolutionItems) = preProject
stblib\stb_image.c = stblib\stb_image.c
stblib\stb_image.h = stblib\stb_image.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ribbon", "wxWidgets\build\msw\wx_vc10_ribbon.vcxproj", "{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stc", "wxWidgets\build\msw\wx_vc10_stc.vcxproj", "{23E1C437-A951-5943-8639-A17F3CF2E606}"
ProjectSection(ProjectDependencies) = postProject
{067D9406-2A93-DACA-9449-93A2D356357D} = {067D9406-2A93-DACA-9449-93A2D356357D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxscintilla", "wxWidgets\build\msw\wx_vc10_wxscintilla.vcxproj", "{74827EBD-93DC-5110-BA95-3F2AB029B6B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asmjit", "asmjitsrc\asmjit.vcxproj", "{AC40FF01-426E-4838-A317-66354CEFAE88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "asmjit", "asmjit", "{E2A982F2-4B1A-48B1-8D77-A17A589C58D7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emucore", "rpcs3\emucore.vcxproj", "{C4A10229-4712-4BD2-B63E-50D93C67A038}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - MemLeak|x64 = Debug - MemLeak|x64
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug - MemLeak|x64.ActiveCfg = Debug - MemLeak|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug - MemLeak|x64.Build.0 = Debug - MemLeak|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.ActiveCfg = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.Build.0 = Debug|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.ActiveCfg = Release|x64
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.Build.0 = Release|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug - MemLeak|x64.Build.0 = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|x64.ActiveCfg = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Debug|x64.Build.0 = Debug|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|x64.ActiveCfg = Release|x64
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82}.Release|x64.Build.0 = Release|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug - MemLeak|x64.Build.0 = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|x64.ActiveCfg = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Debug|x64.Build.0 = Debug|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|x64.ActiveCfg = Release|x64
{7047EE97-7F80-A70D-6147-BC11102DB6F4}.Release|x64.Build.0 = Release|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug - MemLeak|x64.Build.0 = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|x64.ActiveCfg = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Debug|x64.Build.0 = Debug|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|x64.ActiveCfg = Release|x64
{3111D679-7796-23C4-BA0C-271F1145DA24}.Release|x64.Build.0 = Release|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug - MemLeak|x64.Build.0 = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|x64.ActiveCfg = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Debug|x64.Build.0 = Debug|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|x64.ActiveCfg = Release|x64
{067D9406-2A93-DACA-9449-93A2D356357D}.Release|x64.Build.0 = Release|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug - MemLeak|x64.Build.0 = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|x64.ActiveCfg = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Debug|x64.Build.0 = Debug|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|x64.ActiveCfg = Release|x64
{9ED1866B-D4AE-3440-24E4-7A9475B163B2}.Release|x64.Build.0 = Release|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug - MemLeak|x64.Build.0 = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|x64.ActiveCfg = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Debug|x64.Build.0 = Debug|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|x64.ActiveCfg = Release|x64
{99C9EB95-DB4C-1996-490E-5212EFBF07C3}.Release|x64.Build.0 = Release|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug - MemLeak|x64.Build.0 = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug - MemLeak|x64.Deploy.0 = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|x64.ActiveCfg = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Debug|x64.Build.0 = Debug|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|x64.ActiveCfg = Release|x64
{6EDC3B79-D217-F11A-406F-F11D856493F9}.Release|x64.Build.0 = Release|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug - MemLeak|x64.Build.0 = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|x64.ActiveCfg = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Debug|x64.Build.0 = Debug|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|x64.ActiveCfg = Release|x64
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25}.Release|x64.Build.0 = Release|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug - MemLeak|x64.Build.0 = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|x64.ActiveCfg = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Debug|x64.Build.0 = Debug|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|x64.ActiveCfg = Release|x64
{CD478F02-7550-58A5-E085-CE4BC0C0AD23}.Release|x64.Build.0 = Release|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug - MemLeak|x64.Build.0 = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|x64.ActiveCfg = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Debug|x64.Build.0 = Debug|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|x64.ActiveCfg = Release|x64
{22B14659-C5B6-B775-868D-A49198FEAD4A}.Release|x64.Build.0 = Release|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug - MemLeak|x64.Build.0 = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|x64.ActiveCfg = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Debug|x64.Build.0 = Debug|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|x64.ActiveCfg = Release|x64
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774}.Release|x64.Build.0 = Release|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug - MemLeak|x64.Build.0 = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|x64.ActiveCfg = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Debug|x64.Build.0 = Debug|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|x64.ActiveCfg = Release|x64
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2}.Release|x64.Build.0 = Release|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug - MemLeak|x64.Build.0 = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|x64.ActiveCfg = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Debug|x64.Build.0 = Debug|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|x64.ActiveCfg = Release|x64
{5C363C34-4741-7036-861C-2E2279CF552E}.Release|x64.Build.0 = Release|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug - MemLeak|x64.Build.0 = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|x64.ActiveCfg = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Debug|x64.Build.0 = Debug|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|x64.ActiveCfg = Release|x64
{76169FE8-0814-4F36-6409-699EF1A23001}.Release|x64.Build.0 = Release|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug - MemLeak|x64.Build.0 = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|x64.ActiveCfg = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Debug|x64.Build.0 = Debug|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|x64.ActiveCfg = Release|x64
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01}.Release|x64.Build.0 = Release|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug - MemLeak|x64.Build.0 = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|x64.ActiveCfg = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Debug|x64.Build.0 = Debug|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|x64.ActiveCfg = Release|x64
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9}.Release|x64.Build.0 = Release|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug - MemLeak|x64.Build.0 = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|x64.ActiveCfg = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Debug|x64.Build.0 = Debug|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|x64.ActiveCfg = Release|x64
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA}.Release|x64.Build.0 = Release|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug - MemLeak|x64.Build.0 = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|x64.ActiveCfg = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Debug|x64.Build.0 = Debug|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|x64.ActiveCfg = Release|x64
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF}.Release|x64.Build.0 = Release|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug - MemLeak|x64.Build.0 = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|x64.ActiveCfg = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Debug|x64.Build.0 = Debug|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|x64.ActiveCfg = Release|x64
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6}.Release|x64.Build.0 = Release|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug - MemLeak|x64.Build.0 = Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug|x64.ActiveCfg = Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Debug|x64.Build.0 = Debug|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Release|x64.ActiveCfg = Release|x64
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}.Release|x64.Build.0 = Release|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug - MemLeak|x64.Build.0 = Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug|x64.ActiveCfg = Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Debug|x64.Build.0 = Debug|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Release|x64.ActiveCfg = Release|x64
{23E1C437-A951-5943-8639-A17F3CF2E606}.Release|x64.Build.0 = Release|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug - MemLeak|x64.Build.0 = Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug|x64.ActiveCfg = Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Debug|x64.Build.0 = Debug|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Release|x64.ActiveCfg = Release|x64
{74827EBD-93DC-5110-BA95-3F2AB029B6B0}.Release|x64.Build.0 = Release|x64
{AC40FF01-426E-4838-A317-66354CEFAE88}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{AC40FF01-426E-4838-A317-66354CEFAE88}.Debug|x64.ActiveCfg = Debug|x64
{AC40FF01-426E-4838-A317-66354CEFAE88}.Debug|x64.Build.0 = Debug|x64
{AC40FF01-426E-4838-A317-66354CEFAE88}.Release|x64.ActiveCfg = Release|x64
{AC40FF01-426E-4838-A317-66354CEFAE88}.Release|x64.Build.0 = Release|x64
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug - MemLeak|x64.ActiveCfg = Debug - MemLeak|x64
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug - MemLeak|x64.Build.0 = Debug - MemLeak|x64
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug|x64.ActiveCfg = Debug|x64
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug|x64.Build.0 = Debug|x64
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Release|x64.ActiveCfg = Release|x64
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{7047EE97-7F80-A70D-6147-BC11102DB6F4} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{3111D679-7796-23C4-BA0C-271F1145DA24} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{067D9406-2A93-DACA-9449-93A2D356357D} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{9ED1866B-D4AE-3440-24E4-7A9475B163B2} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{99C9EB95-DB4C-1996-490E-5212EFBF07C3} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{6EDC3B79-D217-F11A-406F-F11D856493F9} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{CD478F02-7550-58A5-E085-CE4BC0C0AD23} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{22B14659-C5B6-B775-868D-A49198FEAD4A} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{FAF0CB93-F7CE-A6B8-8342-19CE99BAF774} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{5C363C34-4741-7036-861C-2E2279CF552E} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{76169FE8-0814-4F36-6409-699EF1A23001} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{949C6DB8-E638-6EC6-AB31-BCCFD1379E01} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{B87216CD-6C64-1DB0-D900-BC6E745C1DF9} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{AFF2C68B-B867-DD50-6AC5-74B09D41F8EA} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{87B42A9C-3F5C-53D7-9017-2B1CAE39457D} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{23E1C437-A951-5943-8639-A17F3CF2E606} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{74827EBD-93DC-5110-BA95-3F2AB029B6B0} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{AC40FF01-426E-4838-A317-66354CEFAE88} = {E2A982F2-4B1A-48B1-8D77-A17A589C58D7}
EndGlobalSection
EndGlobal
-32
View File
@@ -1,32 +0,0 @@
#include "stdafx.h"
#include "AppConnector.h"
AppConnector::~AppConnector()
{
for(uint i=0; i<m_connect_arr.GetCount(); ++i)
{
wxGetApp().Disconnect(
m_connect_arr[i].winid,
m_connect_arr[i].lastId,
m_connect_arr[i].eventType,
m_connect_arr[i].func,
m_connect_arr[i].userData,
m_connect_arr[i].eventSink);
}
}
void AppConnector::Connect(int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject* userData, wxEvtHandler* eventSink)
{
m_connect_arr.Move(new ConnectInfo(winid, lastId, eventType, func, userData, eventSink));
wxGetApp().Connect(winid, lastId, eventType, func, userData, eventSink);
}
void AppConnector::Connect(int winid, int eventType, wxObjectEventFunction func, wxObject* userData, wxEvtHandler* eventSink)
{
Connect(winid, wxID_ANY, eventType, func, userData, eventSink);
}
void AppConnector::Connect(int eventType, wxObjectEventFunction func, wxObject* userData, wxEvtHandler* eventSink)
{
Connect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink);
}
-33
View File
@@ -1,33 +0,0 @@
#pragma once
class AppConnector
{
struct ConnectInfo
{
int winid;
int lastId;
int eventType;
wxObjectEventFunction func;
wxObject* userData;
wxEvtHandler* eventSink;
ConnectInfo(int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject* userData, wxEvtHandler* eventSink)
: winid(winid)
, lastId(lastId)
, eventType(eventType)
, func(func)
, userData(userData)
, eventSink(eventSink)
{
}
};
Array<ConnectInfo> m_connect_arr;
public:
~AppConnector();
void Connect(int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject* userData = nullptr, wxEvtHandler* eventSink = nullptr);
void Connect(int winid, int eventType, wxObjectEventFunction func, wxObject* userData = nullptr, wxEvtHandler* eventSink = nullptr);
void Connect(int eventType, wxObjectEventFunction func, wxObject* userData = nullptr, wxEvtHandler* eventSink = nullptr);
};
+104
View File
@@ -0,0 +1,104 @@
cmake_minimum_required(VERSION 2.8)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/rpcs3/cmake_modules")
include(cotire)
project(rpcs3)
if (CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
add_definitions(-DwxGUI)
#add_definitions(-D__WXGTK__)
#add_definitions(-Wfatal-errors)
add_definitions(-w) # TODO: remove me
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
add_definitions(-fpermissive) # TODO: remove me
add_definitions(-g) # Debugging!!
add_definitions(-msse2)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions(-DwxGUI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
endif()
If( NOT RPCS3_SRC_DIR)
SET(RPCS3_SRC_DIR ${CMAKE_CURRENT_LIST_DIR})
Message("-- Initializing RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
Else()
Message("-- Using Custom RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
EndIf()
set(CMAKE_MODULE_PATH "${RPCS3_SRC_DIR}/cmake_modules")
# TODO: do real installation, including copying directory structure
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/../bin")
#include(cotire)
add_definitions(-DGL_GLEXT_PROTOTYPES)
add_definitions(-DGLX_GLXEXT_PROTOTYPES)
find_package(wxWidgets COMPONENTS core base net aui gl xml REQUIRED)
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenAL REQUIRED)
include("${wxWidgets_USE_FILE}")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
if(APPLE)
set(PLATFORM_ARCH "macosx/x86_64")
elseif(WIN32)
set(PLATFORM_ARCH "Windows/x86_64")
else()
set(PLATFORM_ARCH "linux/x86_64")
endif()
include_directories(
${wxWidgets_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
"${RPCS3_SRC_DIR}/../ffmpeg/${PLATFORM_ARCH}/include"
"${RPCS3_SRC_DIR}"
"${RPCS3_SRC_DIR}/Emu"
"${RPCS3_SRC_DIR}/Gui"
"${RPCS3_SRC_DIR}/Loader"
"${RPCS3_SRC_DIR}/Crypto"
"${RPCS3_SRC_DIR}/.."
"${RPCS3_SRC_DIR}/../asmjit/src/asmjit"
)
link_directories("${RPCS3_SRC_DIR}/../ffmpeg/${PLATFORM_ARCH}/lib")
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "dir='${dir}'")
endforeach()
file(
GLOB_RECURSE
RPCS3_SRC
"${RPCS3_SRC_DIR}/rpcs3.cpp"
"${RPCS3_SRC_DIR}/Ini.cpp"
"${RPCS3_SRC_DIR}/../Utilities/GNU.cpp"
"${RPCS3_SRC_DIR}/Emu/*"
"${RPCS3_SRC_DIR}/Gui/*"
"${RPCS3_SRC_DIR}/Loader/*"
"${RPCS3_SRC_DIR}/Crypto/*"
"${RPCS3_SRC_DIR}/../Utilities/*"
)
add_executable(rpcs3 ${RPCS3_SRC})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_CURRENT_BINARY_DIR}/../asmjit/") #hack because the asmjit cmake file force fno exceptions
target_link_libraries(rpcs3 asmjit.a ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES})
set_target_properties(rpcs3 PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h")
cotire(rpcs3)
+975
View File
@@ -0,0 +1,975 @@
/*
* FIPS-197 compliant AES implementation
*
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* The AES block cipher was designed by Vincent Rijmen and Joan Daemen.
*
* http://csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf
* http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
*/
#include "stdafx.h"
#include "aes.h"
/*
* 32-bit integer manipulation macros (little endian)
*/
#ifndef GET_UINT32_LE
#define GET_UINT32_LE(n,b,i) \
{ \
(n) = ( (uint32_t) (b)[(i) ] ) \
| ( (uint32_t) (b)[(i) + 1] << 8 ) \
| ( (uint32_t) (b)[(i) + 2] << 16 ) \
| ( (uint32_t) (b)[(i) + 3] << 24 ); \
}
#endif
#ifndef PUT_UINT32_LE
#define PUT_UINT32_LE(n,b,i) \
{ \
(b)[(i) ] = (unsigned char) ( (n) ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
}
#endif
#if defined(POLARSSL_AES_ROM_TABLES)
/*
* Forward S-box
*/
static const unsigned char FSb[256] =
{
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5,
0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0,
0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC,
0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A,
0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0,
0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B,
0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85,
0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5,
0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17,
0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88,
0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C,
0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9,
0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6,
0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E,
0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94,
0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68,
0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
};
/*
* Forward tables
*/
#define FT \
\
V(A5,63,63,C6), V(84,7C,7C,F8), V(99,77,77,EE), V(8D,7B,7B,F6), \
V(0D,F2,F2,FF), V(BD,6B,6B,D6), V(B1,6F,6F,DE), V(54,C5,C5,91), \
V(50,30,30,60), V(03,01,01,02), V(A9,67,67,CE), V(7D,2B,2B,56), \
V(19,FE,FE,E7), V(62,D7,D7,B5), V(E6,AB,AB,4D), V(9A,76,76,EC), \
V(45,CA,CA,8F), V(9D,82,82,1F), V(40,C9,C9,89), V(87,7D,7D,FA), \
V(15,FA,FA,EF), V(EB,59,59,B2), V(C9,47,47,8E), V(0B,F0,F0,FB), \
V(EC,AD,AD,41), V(67,D4,D4,B3), V(FD,A2,A2,5F), V(EA,AF,AF,45), \
V(BF,9C,9C,23), V(F7,A4,A4,53), V(96,72,72,E4), V(5B,C0,C0,9B), \
V(C2,B7,B7,75), V(1C,FD,FD,E1), V(AE,93,93,3D), V(6A,26,26,4C), \
V(5A,36,36,6C), V(41,3F,3F,7E), V(02,F7,F7,F5), V(4F,CC,CC,83), \
V(5C,34,34,68), V(F4,A5,A5,51), V(34,E5,E5,D1), V(08,F1,F1,F9), \
V(93,71,71,E2), V(73,D8,D8,AB), V(53,31,31,62), V(3F,15,15,2A), \
V(0C,04,04,08), V(52,C7,C7,95), V(65,23,23,46), V(5E,C3,C3,9D), \
V(28,18,18,30), V(A1,96,96,37), V(0F,05,05,0A), V(B5,9A,9A,2F), \
V(09,07,07,0E), V(36,12,12,24), V(9B,80,80,1B), V(3D,E2,E2,DF), \
V(26,EB,EB,CD), V(69,27,27,4E), V(CD,B2,B2,7F), V(9F,75,75,EA), \
V(1B,09,09,12), V(9E,83,83,1D), V(74,2C,2C,58), V(2E,1A,1A,34), \
V(2D,1B,1B,36), V(B2,6E,6E,DC), V(EE,5A,5A,B4), V(FB,A0,A0,5B), \
V(F6,52,52,A4), V(4D,3B,3B,76), V(61,D6,D6,B7), V(CE,B3,B3,7D), \
V(7B,29,29,52), V(3E,E3,E3,DD), V(71,2F,2F,5E), V(97,84,84,13), \
V(F5,53,53,A6), V(68,D1,D1,B9), V(00,00,00,00), V(2C,ED,ED,C1), \
V(60,20,20,40), V(1F,FC,FC,E3), V(C8,B1,B1,79), V(ED,5B,5B,B6), \
V(BE,6A,6A,D4), V(46,CB,CB,8D), V(D9,BE,BE,67), V(4B,39,39,72), \
V(DE,4A,4A,94), V(D4,4C,4C,98), V(E8,58,58,B0), V(4A,CF,CF,85), \
V(6B,D0,D0,BB), V(2A,EF,EF,C5), V(E5,AA,AA,4F), V(16,FB,FB,ED), \
V(C5,43,43,86), V(D7,4D,4D,9A), V(55,33,33,66), V(94,85,85,11), \
V(CF,45,45,8A), V(10,F9,F9,E9), V(06,02,02,04), V(81,7F,7F,FE), \
V(F0,50,50,A0), V(44,3C,3C,78), V(BA,9F,9F,25), V(E3,A8,A8,4B), \
V(F3,51,51,A2), V(FE,A3,A3,5D), V(C0,40,40,80), V(8A,8F,8F,05), \
V(AD,92,92,3F), V(BC,9D,9D,21), V(48,38,38,70), V(04,F5,F5,F1), \
V(DF,BC,BC,63), V(C1,B6,B6,77), V(75,DA,DA,AF), V(63,21,21,42), \
V(30,10,10,20), V(1A,FF,FF,E5), V(0E,F3,F3,FD), V(6D,D2,D2,BF), \
V(4C,CD,CD,81), V(14,0C,0C,18), V(35,13,13,26), V(2F,EC,EC,C3), \
V(E1,5F,5F,BE), V(A2,97,97,35), V(CC,44,44,88), V(39,17,17,2E), \
V(57,C4,C4,93), V(F2,A7,A7,55), V(82,7E,7E,FC), V(47,3D,3D,7A), \
V(AC,64,64,C8), V(E7,5D,5D,BA), V(2B,19,19,32), V(95,73,73,E6), \
V(A0,60,60,C0), V(98,81,81,19), V(D1,4F,4F,9E), V(7F,DC,DC,A3), \
V(66,22,22,44), V(7E,2A,2A,54), V(AB,90,90,3B), V(83,88,88,0B), \
V(CA,46,46,8C), V(29,EE,EE,C7), V(D3,B8,B8,6B), V(3C,14,14,28), \
V(79,DE,DE,A7), V(E2,5E,5E,BC), V(1D,0B,0B,16), V(76,DB,DB,AD), \
V(3B,E0,E0,DB), V(56,32,32,64), V(4E,3A,3A,74), V(1E,0A,0A,14), \
V(DB,49,49,92), V(0A,06,06,0C), V(6C,24,24,48), V(E4,5C,5C,B8), \
V(5D,C2,C2,9F), V(6E,D3,D3,BD), V(EF,AC,AC,43), V(A6,62,62,C4), \
V(A8,91,91,39), V(A4,95,95,31), V(37,E4,E4,D3), V(8B,79,79,F2), \
V(32,E7,E7,D5), V(43,C8,C8,8B), V(59,37,37,6E), V(B7,6D,6D,DA), \
V(8C,8D,8D,01), V(64,D5,D5,B1), V(D2,4E,4E,9C), V(E0,A9,A9,49), \
V(B4,6C,6C,D8), V(FA,56,56,AC), V(07,F4,F4,F3), V(25,EA,EA,CF), \
V(AF,65,65,CA), V(8E,7A,7A,F4), V(E9,AE,AE,47), V(18,08,08,10), \
V(D5,BA,BA,6F), V(88,78,78,F0), V(6F,25,25,4A), V(72,2E,2E,5C), \
V(24,1C,1C,38), V(F1,A6,A6,57), V(C7,B4,B4,73), V(51,C6,C6,97), \
V(23,E8,E8,CB), V(7C,DD,DD,A1), V(9C,74,74,E8), V(21,1F,1F,3E), \
V(DD,4B,4B,96), V(DC,BD,BD,61), V(86,8B,8B,0D), V(85,8A,8A,0F), \
V(90,70,70,E0), V(42,3E,3E,7C), V(C4,B5,B5,71), V(AA,66,66,CC), \
V(D8,48,48,90), V(05,03,03,06), V(01,F6,F6,F7), V(12,0E,0E,1C), \
V(A3,61,61,C2), V(5F,35,35,6A), V(F9,57,57,AE), V(D0,B9,B9,69), \
V(91,86,86,17), V(58,C1,C1,99), V(27,1D,1D,3A), V(B9,9E,9E,27), \
V(38,E1,E1,D9), V(13,F8,F8,EB), V(B3,98,98,2B), V(33,11,11,22), \
V(BB,69,69,D2), V(70,D9,D9,A9), V(89,8E,8E,07), V(A7,94,94,33), \
V(B6,9B,9B,2D), V(22,1E,1E,3C), V(92,87,87,15), V(20,E9,E9,C9), \
V(49,CE,CE,87), V(FF,55,55,AA), V(78,28,28,50), V(7A,DF,DF,A5), \
V(8F,8C,8C,03), V(F8,A1,A1,59), V(80,89,89,09), V(17,0D,0D,1A), \
V(DA,BF,BF,65), V(31,E6,E6,D7), V(C6,42,42,84), V(B8,68,68,D0), \
V(C3,41,41,82), V(B0,99,99,29), V(77,2D,2D,5A), V(11,0F,0F,1E), \
V(CB,B0,B0,7B), V(FC,54,54,A8), V(D6,BB,BB,6D), V(3A,16,16,2C)
#define V(a,b,c,d) 0x##a##b##c##d
static const uint32_t FT0[256] = { FT };
#undef V
#define V(a,b,c,d) 0x##b##c##d##a
static const uint32_t FT1[256] = { FT };
#undef V
#define V(a,b,c,d) 0x##c##d##a##b
static const uint32_t FT2[256] = { FT };
#undef V
#define V(a,b,c,d) 0x##d##a##b##c
static const uint32_t FT3[256] = { FT };
#undef V
#undef FT
/*
* Reverse S-box
*/
static const unsigned char RSb[256] =
{
0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38,
0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87,
0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D,
0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2,
0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16,
0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA,
0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A,
0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02,
0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA,
0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85,
0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89,
0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20,
0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31,
0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D,
0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0,
0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26,
0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
};
/*
* Reverse tables
*/
#define RT \
\
V(50,A7,F4,51), V(53,65,41,7E), V(C3,A4,17,1A), V(96,5E,27,3A), \
V(CB,6B,AB,3B), V(F1,45,9D,1F), V(AB,58,FA,AC), V(93,03,E3,4B), \
V(55,FA,30,20), V(F6,6D,76,AD), V(91,76,CC,88), V(25,4C,02,F5), \
V(FC,D7,E5,4F), V(D7,CB,2A,C5), V(80,44,35,26), V(8F,A3,62,B5), \
V(49,5A,B1,DE), V(67,1B,BA,25), V(98,0E,EA,45), V(E1,C0,FE,5D), \
V(02,75,2F,C3), V(12,F0,4C,81), V(A3,97,46,8D), V(C6,F9,D3,6B), \
V(E7,5F,8F,03), V(95,9C,92,15), V(EB,7A,6D,BF), V(DA,59,52,95), \
V(2D,83,BE,D4), V(D3,21,74,58), V(29,69,E0,49), V(44,C8,C9,8E), \
V(6A,89,C2,75), V(78,79,8E,F4), V(6B,3E,58,99), V(DD,71,B9,27), \
V(B6,4F,E1,BE), V(17,AD,88,F0), V(66,AC,20,C9), V(B4,3A,CE,7D), \
V(18,4A,DF,63), V(82,31,1A,E5), V(60,33,51,97), V(45,7F,53,62), \
V(E0,77,64,B1), V(84,AE,6B,BB), V(1C,A0,81,FE), V(94,2B,08,F9), \
V(58,68,48,70), V(19,FD,45,8F), V(87,6C,DE,94), V(B7,F8,7B,52), \
V(23,D3,73,AB), V(E2,02,4B,72), V(57,8F,1F,E3), V(2A,AB,55,66), \
V(07,28,EB,B2), V(03,C2,B5,2F), V(9A,7B,C5,86), V(A5,08,37,D3), \
V(F2,87,28,30), V(B2,A5,BF,23), V(BA,6A,03,02), V(5C,82,16,ED), \
V(2B,1C,CF,8A), V(92,B4,79,A7), V(F0,F2,07,F3), V(A1,E2,69,4E), \
V(CD,F4,DA,65), V(D5,BE,05,06), V(1F,62,34,D1), V(8A,FE,A6,C4), \
V(9D,53,2E,34), V(A0,55,F3,A2), V(32,E1,8A,05), V(75,EB,F6,A4), \
V(39,EC,83,0B), V(AA,EF,60,40), V(06,9F,71,5E), V(51,10,6E,BD), \
V(F9,8A,21,3E), V(3D,06,DD,96), V(AE,05,3E,DD), V(46,BD,E6,4D), \
V(B5,8D,54,91), V(05,5D,C4,71), V(6F,D4,06,04), V(FF,15,50,60), \
V(24,FB,98,19), V(97,E9,BD,D6), V(CC,43,40,89), V(77,9E,D9,67), \
V(BD,42,E8,B0), V(88,8B,89,07), V(38,5B,19,E7), V(DB,EE,C8,79), \
V(47,0A,7C,A1), V(E9,0F,42,7C), V(C9,1E,84,F8), V(00,00,00,00), \
V(83,86,80,09), V(48,ED,2B,32), V(AC,70,11,1E), V(4E,72,5A,6C), \
V(FB,FF,0E,FD), V(56,38,85,0F), V(1E,D5,AE,3D), V(27,39,2D,36), \
V(64,D9,0F,0A), V(21,A6,5C,68), V(D1,54,5B,9B), V(3A,2E,36,24), \
V(B1,67,0A,0C), V(0F,E7,57,93), V(D2,96,EE,B4), V(9E,91,9B,1B), \
V(4F,C5,C0,80), V(A2,20,DC,61), V(69,4B,77,5A), V(16,1A,12,1C), \
V(0A,BA,93,E2), V(E5,2A,A0,C0), V(43,E0,22,3C), V(1D,17,1B,12), \
V(0B,0D,09,0E), V(AD,C7,8B,F2), V(B9,A8,B6,2D), V(C8,A9,1E,14), \
V(85,19,F1,57), V(4C,07,75,AF), V(BB,DD,99,EE), V(FD,60,7F,A3), \
V(9F,26,01,F7), V(BC,F5,72,5C), V(C5,3B,66,44), V(34,7E,FB,5B), \
V(76,29,43,8B), V(DC,C6,23,CB), V(68,FC,ED,B6), V(63,F1,E4,B8), \
V(CA,DC,31,D7), V(10,85,63,42), V(40,22,97,13), V(20,11,C6,84), \
V(7D,24,4A,85), V(F8,3D,BB,D2), V(11,32,F9,AE), V(6D,A1,29,C7), \
V(4B,2F,9E,1D), V(F3,30,B2,DC), V(EC,52,86,0D), V(D0,E3,C1,77), \
V(6C,16,B3,2B), V(99,B9,70,A9), V(FA,48,94,11), V(22,64,E9,47), \
V(C4,8C,FC,A8), V(1A,3F,F0,A0), V(D8,2C,7D,56), V(EF,90,33,22), \
V(C7,4E,49,87), V(C1,D1,38,D9), V(FE,A2,CA,8C), V(36,0B,D4,98), \
V(CF,81,F5,A6), V(28,DE,7A,A5), V(26,8E,B7,DA), V(A4,BF,AD,3F), \
V(E4,9D,3A,2C), V(0D,92,78,50), V(9B,CC,5F,6A), V(62,46,7E,54), \
V(C2,13,8D,F6), V(E8,B8,D8,90), V(5E,F7,39,2E), V(F5,AF,C3,82), \
V(BE,80,5D,9F), V(7C,93,D0,69), V(A9,2D,D5,6F), V(B3,12,25,CF), \
V(3B,99,AC,C8), V(A7,7D,18,10), V(6E,63,9C,E8), V(7B,BB,3B,DB), \
V(09,78,26,CD), V(F4,18,59,6E), V(01,B7,9A,EC), V(A8,9A,4F,83), \
V(65,6E,95,E6), V(7E,E6,FF,AA), V(08,CF,BC,21), V(E6,E8,15,EF), \
V(D9,9B,E7,BA), V(CE,36,6F,4A), V(D4,09,9F,EA), V(D6,7C,B0,29), \
V(AF,B2,A4,31), V(31,23,3F,2A), V(30,94,A5,C6), V(C0,66,A2,35), \
V(37,BC,4E,74), V(A6,CA,82,FC), V(B0,D0,90,E0), V(15,D8,A7,33), \
V(4A,98,04,F1), V(F7,DA,EC,41), V(0E,50,CD,7F), V(2F,F6,91,17), \
V(8D,D6,4D,76), V(4D,B0,EF,43), V(54,4D,AA,CC), V(DF,04,96,E4), \
V(E3,B5,D1,9E), V(1B,88,6A,4C), V(B8,1F,2C,C1), V(7F,51,65,46), \
V(04,EA,5E,9D), V(5D,35,8C,01), V(73,74,87,FA), V(2E,41,0B,FB), \
V(5A,1D,67,B3), V(52,D2,DB,92), V(33,56,10,E9), V(13,47,D6,6D), \
V(8C,61,D7,9A), V(7A,0C,A1,37), V(8E,14,F8,59), V(89,3C,13,EB), \
V(EE,27,A9,CE), V(35,C9,61,B7), V(ED,E5,1C,E1), V(3C,B1,47,7A), \
V(59,DF,D2,9C), V(3F,73,F2,55), V(79,CE,14,18), V(BF,37,C7,73), \
V(EA,CD,F7,53), V(5B,AA,FD,5F), V(14,6F,3D,DF), V(86,DB,44,78), \
V(81,F3,AF,CA), V(3E,C4,68,B9), V(2C,34,24,38), V(5F,40,A3,C2), \
V(72,C3,1D,16), V(0C,25,E2,BC), V(8B,49,3C,28), V(41,95,0D,FF), \
V(71,01,A8,39), V(DE,B3,0C,08), V(9C,E4,B4,D8), V(90,C1,56,64), \
V(61,84,CB,7B), V(70,B6,32,D5), V(74,5C,6C,48), V(42,57,B8,D0)
#define V(a,b,c,d) 0x##a##b##c##d
static const uint32_t RT0[256] = { RT };
#undef V
#define V(a,b,c,d) 0x##b##c##d##a
static const uint32_t RT1[256] = { RT };
#undef V
#define V(a,b,c,d) 0x##c##d##a##b
static const uint32_t RT2[256] = { RT };
#undef V
#define V(a,b,c,d) 0x##d##a##b##c
static const uint32_t RT3[256] = { RT };
#undef V
#undef RT
/*
* Round constants
*/
static const uint32_t RCON[10] =
{
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080,
0x0000001B, 0x00000036
};
#else
/*
* Forward S-box & tables
*/
static unsigned char FSb[256];
static uint32_t FT0[256];
static uint32_t FT1[256];
static uint32_t FT2[256];
static uint32_t FT3[256];
/*
* Reverse S-box & tables
*/
static unsigned char RSb[256];
static uint32_t RT0[256];
static uint32_t RT1[256];
static uint32_t RT2[256];
static uint32_t RT3[256];
/*
* Round constants
*/
static uint32_t RCON[10];
/*
* Tables generation code
*/
#define ROTL8(x) ( ( x << 8 ) & 0xFFFFFFFF ) | ( x >> 24 )
#define XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) )
#define MUL(x,y) ( ( x && y ) ? pow[(log[x]+log[y]) % 255] : 0 )
static int aes_init_done = 0;
static void aes_gen_tables( void )
{
int i, x, y, z;
int pow[256];
int log[256];
/*
* compute pow and log tables over GF(2^8)
*/
for( i = 0, x = 1; i < 256; i++ )
{
pow[i] = x;
log[x] = i;
x = ( x ^ XTIME( x ) ) & 0xFF;
}
/*
* calculate the round constants
*/
for( i = 0, x = 1; i < 10; i++ )
{
RCON[i] = (uint32_t) x;
x = XTIME( x ) & 0xFF;
}
/*
* generate the forward and reverse S-boxes
*/
FSb[0x00] = 0x63;
RSb[0x63] = 0x00;
for( i = 1; i < 256; i++ )
{
x = pow[255 - log[i]];
y = x; y = ( (y << 1) | (y >> 7) ) & 0xFF;
x ^= y; y = ( (y << 1) | (y >> 7) ) & 0xFF;
x ^= y; y = ( (y << 1) | (y >> 7) ) & 0xFF;
x ^= y; y = ( (y << 1) | (y >> 7) ) & 0xFF;
x ^= y ^ 0x63;
FSb[i] = (unsigned char) x;
RSb[x] = (unsigned char) i;
}
/*
* generate the forward and reverse tables
*/
for( i = 0; i < 256; i++ )
{
x = FSb[i];
y = XTIME( x ) & 0xFF;
z = ( y ^ x ) & 0xFF;
FT0[i] = ( (uint32_t) y ) ^
( (uint32_t) x << 8 ) ^
( (uint32_t) x << 16 ) ^
( (uint32_t) z << 24 );
FT1[i] = ROTL8( FT0[i] );
FT2[i] = ROTL8( FT1[i] );
FT3[i] = ROTL8( FT2[i] );
x = RSb[i];
RT0[i] = ( (uint32_t) MUL( 0x0E, x ) ) ^
( (uint32_t) MUL( 0x09, x ) << 8 ) ^
( (uint32_t) MUL( 0x0D, x ) << 16 ) ^
( (uint32_t) MUL( 0x0B, x ) << 24 );
RT1[i] = ROTL8( RT0[i] );
RT2[i] = ROTL8( RT1[i] );
RT3[i] = ROTL8( RT2[i] );
}
}
#endif
/*
* AES key schedule (encryption)
*/
int aes_setkey_enc( aes_context *ctx, const unsigned char *key, unsigned int keysize )
{
unsigned int i;
uint32_t *RK;
#if !defined(POLARSSL_AES_ROM_TABLES)
if( aes_init_done == 0 )
{
aes_gen_tables();
aes_init_done = 1;
}
#endif
switch( keysize )
{
case 128: ctx->nr = 10; break;
case 192: ctx->nr = 12; break;
case 256: ctx->nr = 14; break;
default : return( POLARSSL_ERR_AES_INVALID_KEY_LENGTH );
}
ctx->rk = RK = ctx->buf;
for( i = 0; i < (keysize >> 5); i++ )
{
GET_UINT32_LE( RK[i], key, i << 2 );
}
switch( ctx->nr )
{
case 10:
for( i = 0; i < 10; i++, RK += 4 )
{
RK[4] = RK[0] ^ RCON[i] ^
( (uint32_t) FSb[ ( RK[3] >> 8 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( RK[3] >> 16 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( RK[3] >> 24 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( RK[3] ) & 0xFF ] << 24 );
RK[5] = RK[1] ^ RK[4];
RK[6] = RK[2] ^ RK[5];
RK[7] = RK[3] ^ RK[6];
}
break;
case 12:
for( i = 0; i < 8; i++, RK += 6 )
{
RK[6] = RK[0] ^ RCON[i] ^
( (uint32_t) FSb[ ( RK[5] >> 8 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( RK[5] >> 16 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( RK[5] >> 24 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( RK[5] ) & 0xFF ] << 24 );
RK[7] = RK[1] ^ RK[6];
RK[8] = RK[2] ^ RK[7];
RK[9] = RK[3] ^ RK[8];
RK[10] = RK[4] ^ RK[9];
RK[11] = RK[5] ^ RK[10];
}
break;
case 14:
for( i = 0; i < 7; i++, RK += 8 )
{
RK[8] = RK[0] ^ RCON[i] ^
( (uint32_t) FSb[ ( RK[7] >> 8 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( RK[7] >> 16 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( RK[7] >> 24 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( RK[7] ) & 0xFF ] << 24 );
RK[9] = RK[1] ^ RK[8];
RK[10] = RK[2] ^ RK[9];
RK[11] = RK[3] ^ RK[10];
RK[12] = RK[4] ^
( (uint32_t) FSb[ ( RK[11] ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( RK[11] >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( RK[11] >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( RK[11] >> 24 ) & 0xFF ] << 24 );
RK[13] = RK[5] ^ RK[12];
RK[14] = RK[6] ^ RK[13];
RK[15] = RK[7] ^ RK[14];
}
break;
default:
break;
}
return( 0 );
}
/*
* AES key schedule (decryption)
*/
int aes_setkey_dec( aes_context *ctx, const unsigned char *key, unsigned int keysize )
{
int i, j;
aes_context cty;
uint32_t *RK;
uint32_t *SK;
int ret;
switch( keysize )
{
case 128: ctx->nr = 10; break;
case 192: ctx->nr = 12; break;
case 256: ctx->nr = 14; break;
default : return( POLARSSL_ERR_AES_INVALID_KEY_LENGTH );
}
ctx->rk = RK = ctx->buf;
ret = aes_setkey_enc( &cty, key, keysize );
if( ret != 0 )
return( ret );
SK = cty.rk + cty.nr * 4;
*RK++ = *SK++;
*RK++ = *SK++;
*RK++ = *SK++;
*RK++ = *SK++;
for( i = ctx->nr - 1, SK -= 8; i > 0; i--, SK -= 8 )
{
for( j = 0; j < 4; j++, SK++ )
{
*RK++ = RT0[ FSb[ ( *SK ) & 0xFF ] ] ^
RT1[ FSb[ ( *SK >> 8 ) & 0xFF ] ] ^
RT2[ FSb[ ( *SK >> 16 ) & 0xFF ] ] ^
RT3[ FSb[ ( *SK >> 24 ) & 0xFF ] ];
}
}
*RK++ = *SK++;
*RK++ = *SK++;
*RK++ = *SK++;
*RK++ = *SK++;
memset( &cty, 0, sizeof( aes_context ) );
return( 0 );
}
#define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \
{ \
X0 = *RK++ ^ FT0[ ( Y0 ) & 0xFF ] ^ \
FT1[ ( Y1 >> 8 ) & 0xFF ] ^ \
FT2[ ( Y2 >> 16 ) & 0xFF ] ^ \
FT3[ ( Y3 >> 24 ) & 0xFF ]; \
\
X1 = *RK++ ^ FT0[ ( Y1 ) & 0xFF ] ^ \
FT1[ ( Y2 >> 8 ) & 0xFF ] ^ \
FT2[ ( Y3 >> 16 ) & 0xFF ] ^ \
FT3[ ( Y0 >> 24 ) & 0xFF ]; \
\
X2 = *RK++ ^ FT0[ ( Y2 ) & 0xFF ] ^ \
FT1[ ( Y3 >> 8 ) & 0xFF ] ^ \
FT2[ ( Y0 >> 16 ) & 0xFF ] ^ \
FT3[ ( Y1 >> 24 ) & 0xFF ]; \
\
X3 = *RK++ ^ FT0[ ( Y3 ) & 0xFF ] ^ \
FT1[ ( Y0 >> 8 ) & 0xFF ] ^ \
FT2[ ( Y1 >> 16 ) & 0xFF ] ^ \
FT3[ ( Y2 >> 24 ) & 0xFF ]; \
}
#define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \
{ \
X0 = *RK++ ^ RT0[ ( Y0 ) & 0xFF ] ^ \
RT1[ ( Y3 >> 8 ) & 0xFF ] ^ \
RT2[ ( Y2 >> 16 ) & 0xFF ] ^ \
RT3[ ( Y1 >> 24 ) & 0xFF ]; \
\
X1 = *RK++ ^ RT0[ ( Y1 ) & 0xFF ] ^ \
RT1[ ( Y0 >> 8 ) & 0xFF ] ^ \
RT2[ ( Y3 >> 16 ) & 0xFF ] ^ \
RT3[ ( Y2 >> 24 ) & 0xFF ]; \
\
X2 = *RK++ ^ RT0[ ( Y2 ) & 0xFF ] ^ \
RT1[ ( Y1 >> 8 ) & 0xFF ] ^ \
RT2[ ( Y0 >> 16 ) & 0xFF ] ^ \
RT3[ ( Y3 >> 24 ) & 0xFF ]; \
\
X3 = *RK++ ^ RT0[ ( Y3 ) & 0xFF ] ^ \
RT1[ ( Y2 >> 8 ) & 0xFF ] ^ \
RT2[ ( Y1 >> 16 ) & 0xFF ] ^ \
RT3[ ( Y0 >> 24 ) & 0xFF ]; \
}
/*
* AES-ECB block encryption/decryption
*/
int aes_crypt_ecb( aes_context *ctx,
int mode,
const unsigned char input[16],
unsigned char output[16] )
{
int i;
uint32_t *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;
RK = ctx->rk;
GET_UINT32_LE( X0, input, 0 ); X0 ^= *RK++;
GET_UINT32_LE( X1, input, 4 ); X1 ^= *RK++;
GET_UINT32_LE( X2, input, 8 ); X2 ^= *RK++;
GET_UINT32_LE( X3, input, 12 ); X3 ^= *RK++;
if( mode == AES_DECRYPT )
{
for( i = (ctx->nr >> 1) - 1; i > 0; i-- )
{
AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 );
}
AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
X0 = *RK++ ^ \
( (uint32_t) RSb[ ( Y0 ) & 0xFF ] ) ^
( (uint32_t) RSb[ ( Y3 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) RSb[ ( Y2 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) RSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );
X1 = *RK++ ^ \
( (uint32_t) RSb[ ( Y1 ) & 0xFF ] ) ^
( (uint32_t) RSb[ ( Y0 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) RSb[ ( Y3 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) RSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );
X2 = *RK++ ^ \
( (uint32_t) RSb[ ( Y2 ) & 0xFF ] ) ^
( (uint32_t) RSb[ ( Y1 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) RSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) RSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );
X3 = *RK++ ^ \
( (uint32_t) RSb[ ( Y3 ) & 0xFF ] ) ^
( (uint32_t) RSb[ ( Y2 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) RSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) RSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );
}
else /* AES_ENCRYPT */
{
for( i = (ctx->nr >> 1) - 1; i > 0; i-- )
{
AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 );
}
AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
X0 = *RK++ ^ \
( (uint32_t) FSb[ ( Y0 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( Y1 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( Y2 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );
X1 = *RK++ ^ \
( (uint32_t) FSb[ ( Y1 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( Y2 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( Y3 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );
X2 = *RK++ ^ \
( (uint32_t) FSb[ ( Y2 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( Y3 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );
X3 = *RK++ ^ \
( (uint32_t) FSb[ ( Y3 ) & 0xFF ] ) ^
( (uint32_t) FSb[ ( Y0 >> 8 ) & 0xFF ] << 8 ) ^
( (uint32_t) FSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^
( (uint32_t) FSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );
}
PUT_UINT32_LE( X0, output, 0 );
PUT_UINT32_LE( X1, output, 4 );
PUT_UINT32_LE( X2, output, 8 );
PUT_UINT32_LE( X3, output, 12 );
return( 0 );
}
/*
* AES-CBC buffer encryption/decryption
*/
int aes_crypt_cbc( aes_context *ctx,
int mode,
size_t length,
unsigned char iv[16],
const unsigned char *input,
unsigned char *output )
{
int i;
unsigned char temp[16];
if( length % 16 )
return( POLARSSL_ERR_AES_INVALID_INPUT_LENGTH );
if( mode == AES_DECRYPT )
{
while( length > 0 )
{
memcpy( temp, input, 16 );
aes_crypt_ecb( ctx, mode, input, output );
for( i = 0; i < 16; i++ )
output[i] = (unsigned char)( output[i] ^ iv[i] );
memcpy( iv, temp, 16 );
input += 16;
output += 16;
length -= 16;
}
}
else
{
while( length > 0 )
{
for( i = 0; i < 16; i++ )
output[i] = (unsigned char)( input[i] ^ iv[i] );
aes_crypt_ecb( ctx, mode, output, output );
memcpy( iv, output, 16 );
input += 16;
output += 16;
length -= 16;
}
}
return( 0 );
}
/*
* AES-CFB128 buffer encryption/decryption
*/
int aes_crypt_cfb128( aes_context *ctx,
int mode,
size_t length,
size_t *iv_off,
unsigned char iv[16],
const unsigned char *input,
unsigned char *output )
{
int c;
size_t n = *iv_off;
if( mode == AES_DECRYPT )
{
while( length-- )
{
if( n == 0 )
aes_crypt_ecb( ctx, AES_ENCRYPT, iv, iv );
c = *input++;
*output++ = (unsigned char)( c ^ iv[n] );
iv[n] = (unsigned char) c;
n = (n + 1) & 0x0F;
}
}
else
{
while( length-- )
{
if( n == 0 )
aes_crypt_ecb( ctx, AES_ENCRYPT, iv, iv );
iv[n] = *output++ = (unsigned char)( iv[n] ^ *input++ );
n = (n + 1) & 0x0F;
}
}
*iv_off = n;
return( 0 );
}
/*
* AES-CTR buffer encryption/decryption
*/
int aes_crypt_ctr( aes_context *ctx,
size_t length,
size_t *nc_off,
unsigned char nonce_counter[16],
unsigned char stream_block[16],
const unsigned char *input,
unsigned char *output )
{
int c, i;
size_t n = *nc_off;
while( length-- )
{
if( n == 0 ) {
aes_crypt_ecb( ctx, AES_ENCRYPT, nonce_counter, stream_block );
for( i = 16; i > 0; i-- )
if( ++nonce_counter[i - 1] != 0 )
break;
}
c = *input++;
*output++ = (unsigned char)( c ^ stream_block[n] );
n = (n + 1) & 0x0F;
}
*nc_off = n;
return( 0 );
}
/* AES-CMAC */
unsigned char const_Rb[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87
};
unsigned char const_Zero[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void leftshift_onebit(unsigned char *input, unsigned char *output)
{
int i;
unsigned char overflow = 0;
for (i = 15; i >= 0; i--)
{
output[i] = input[i] << 1;
output[i] |= overflow;
overflow = (input[i] & 0x80) ? 1 : 0;
}
}
void xor_128(unsigned char *a, unsigned char *b, unsigned char *out)
{
int i;
for (i = 0; i < 16; i++)
out[i] = a[i] ^ b[i];
}
void generate_subkey(aes_context *ctx, unsigned char *K1, unsigned char *K2)
{
unsigned char L[16];
unsigned char Z[16];
unsigned char tmp[16];
int i;
for (i = 0; i < 16; i++) Z[i] = 0;
aes_crypt_ecb(ctx, AES_ENCRYPT, Z, L);
if ((L[0] & 0x80) == 0)
{
leftshift_onebit(L,K1);
} else {
leftshift_onebit(L,tmp);
xor_128(tmp,const_Rb,K1);
}
if ((K1[0] & 0x80) == 0)
{
leftshift_onebit(K1,K2);
} else {
leftshift_onebit(K1,tmp);
xor_128(tmp,const_Rb,K2);
}
}
void padding (unsigned char *lastb, unsigned char *pad, int length)
{
int i;
for (i = 0; i < 16; i++)
{
if (i < length)
pad[i] = lastb[i];
else if (i == length)
pad[i] = 0x80;
else
pad[i] = 0x00;
}
}
void aes_cmac(aes_context *ctx, int length, unsigned char *input, unsigned char *output)
{
unsigned char X[16], Y[16], M_last[16], padded[16];
unsigned char K1[16], K2[16];
int n, i, flag;
generate_subkey(ctx, K1, K2);
n = (length + 15) / 16;
if (n == 0)
{
n = 1;
flag = 0;
} else {
if ((length % 16) == 0)
flag = 1;
else
flag = 0;
}
if (flag)
{
xor_128(&input[16 * (n - 1)], K1, M_last);
} else {
padding(&input[16 * (n - 1)], padded, length % 16);
xor_128(padded, K2, M_last);
}
for (i = 0; i < 16; i++) X[i] = 0;
for (i = 0; i < n - 1; i++)
{
xor_128(X, &input[16*i], Y);
aes_crypt_ecb(ctx, AES_ENCRYPT, Y, X);
}
xor_128(X,M_last,Y);
aes_crypt_ecb(ctx, AES_ENCRYPT, Y, X);
for (i = 0; i < 16; i++)
output[i] = X[i];
}
+177
View File
@@ -0,0 +1,177 @@
/**
* \file aes.h
*
* \brief AES block cipher
*
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <string.h>
#ifdef _MSC_VER
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define AES_ENCRYPT 1
#define AES_DECRYPT 0
#define POLARSSL_ERR_AES_INVALID_KEY_LENGTH -0x0020 /**< Invalid key length. */
#define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH -0x0022 /**< Invalid data input length. */
// Regular implementation
//
/**
* \brief AES context structure
*/
typedef struct
{
int nr; /*!< number of rounds */
uint32_t *rk; /*!< AES round keys */
uint32_t buf[68]; /*!< unaligned data */
}
aes_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief AES key schedule (encryption)
*
* \param ctx AES context to be initialized
* \param key encryption key
* \param keysize must be 128, 192 or 256
*
* \return 0 if successful, or POLARSSL_ERR_AES_INVALID_KEY_LENGTH
*/
int aes_setkey_enc( aes_context *ctx, const unsigned char *key, unsigned int keysize );
/**
* \brief AES key schedule (decryption)
*
* \param ctx AES context to be initialized
* \param key decryption key
* \param keysize must be 128, 192 or 256
*
* \return 0 if successful, or POLARSSL_ERR_AES_INVALID_KEY_LENGTH
*/
int aes_setkey_dec( aes_context *ctx, const unsigned char *key, unsigned int keysize );
/**
* \brief AES-ECB block encryption/decryption
*
* \param ctx AES context
* \param mode AES_ENCRYPT or AES_DECRYPT
* \param input 16-byte input block
* \param output 16-byte output block
*
* \return 0 if successful
*/
int aes_crypt_ecb( aes_context *ctx,
int mode,
const unsigned char input[16],
unsigned char output[16] );
/**
* \brief AES-CBC buffer encryption/decryption
* Length should be a multiple of the block
* size (16 bytes)
*
* \param ctx AES context
* \param mode AES_ENCRYPT or AES_DECRYPT
* \param length length of the input data
* \param iv initialization vector (updated after use)
* \param input buffer holding the input data
* \param output buffer holding the output data
*
* \return 0 if successful, or POLARSSL_ERR_AES_INVALID_INPUT_LENGTH
*/
int aes_crypt_cbc( aes_context *ctx,
int mode,
size_t length,
unsigned char iv[16],
const unsigned char *input,
unsigned char *output );
/**
* \brief AES-CFB128 buffer encryption/decryption.
*
* Note: Due to the nature of CFB you should use the same key schedule for
* both encryption and decryption. So a context initialized with
* aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT.
*
* both
* \param ctx AES context
* \param mode AES_ENCRYPT or AES_DECRYPT
* \param length length of the input data
* \param iv_off offset in IV (updated after use)
* \param iv initialization vector (updated after use)
* \param input buffer holding the input data
* \param output buffer holding the output data
*
* \return 0 if successful
*/
int aes_crypt_cfb128( aes_context *ctx,
int mode,
size_t length,
size_t *iv_off,
unsigned char iv[16],
const unsigned char *input,
unsigned char *output );
/**
* \brief AES-CTR buffer encryption/decryption
*
* Warning: You have to keep the maximum use of your counter in mind!
*
* Note: Due to the nature of CTR you should use the same key schedule for
* both encryption and decryption. So a context initialized with
* aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT.
*
* \param length The length of the data
* \param nc_off The offset in the current stream_block (for resuming
* within current cipher stream). The offset pointer to
* should be 0 at the start of a stream.
* \param nonce_counter The 128-bit nonce and counter.
* \param stream_block The saved stream-block for resuming. Is overwritten
* by the function.
* \param input The input data stream
* \param output The output data stream
*
* \return 0 if successful
*/
int aes_crypt_ctr( aes_context *ctx,
size_t length,
size_t *nc_off,
unsigned char nonce_counter[16],
unsigned char stream_block[16],
const unsigned char *input,
unsigned char *output );
void aes_cmac(aes_context *ctx, int length, unsigned char *input, unsigned char *output);
#ifdef __cplusplus
}
#endif
+790
View File
@@ -0,0 +1,790 @@
#include "stdafx.h"
#include "key_vault.h"
KeyVault::KeyVault()
{
}
void KeyVault::LoadSelfLV0Keys()
{
sk_LV0_arr.clear();
sk_LV0_arr.emplace_back(0x0000000000000000, 0x0000, KEY_LV0,
"CA7A24EC38BDB45B98CCD7D363EA2AF0C326E65081E0630CB9AB2D215865878A",
"F9205F46F6021697E670F13DFA726212",
"A8FD6DB24532D094EFA08CB41C9A72287D905C6B27B42BE4AB925AAF4AFFF34D41EEB54DD128700D",
"001AD976FCDE86F5B8FF3E63EF3A7F94E861975BA3",
0x33);
}
void KeyVault::LoadSelfLDRKeys()
{
sk_LDR_arr.clear();
sk_LDR_arr.emplace_back(0x0000000000000000, 0x0000, KEY_LDR,
"C0CEFE84C227F75BD07A7EB846509F93B238E770DACB9FF4A388F812482BE21B",
"47EE7454E4774CC9B8960C7B59F4C14D",
"C2D4AAF319355019AF99D44E2B58CA29252C89123D11D6218F40B138CAB29B7101F3AEB72A975019",
"00C5B2BFA1A413DD16F26D31C0F2ED4720DCFB0670",
0x20);
}
void KeyVault::LoadSelfLV1Keys()
{
sk_LV1_arr.clear();
sk_LV1_arr.emplace_back(0x0003003000000000, 0x0000, KEY_LV1,
"B9F3F9E6107CFF2680A91E118C2403CF4A6F18F3C7EFD7D13D1AC4DB760BD222",
"B43661B9A79BAD9D8E2B046469CDA1E7",
"4C870BE86DDD996A92A3F7F404F33604244A1D02AB5B78BC9DAF030B78BE8867CF586171B7D45D20",
"002CC736C7AD06D264E9AB663EB1F35F5DC159248C",
0x33);
sk_LV1_arr.emplace_back(0x0003004200000000, 0x0000, KEY_LV1,
"B880593856C8C6D2037585626A12977F50DCFCF3F132D2C89AA6E670EAFC1646",
"A79B05D4E37B8117A95E6E7C14FB640E",
"7454C7CCBFC2F66C142D78A730A3A6F973CC0FB75A46FCBB390790138910A0CAC78E5E21F4DA3375",
"00033A699FDD2DA6CDD6CCC03B2C6145F998706F74",
0x34);
sk_LV1_arr.emplace_back(0x0003005000000000, 0x0000, KEY_LV1,
"1E8EEEA9E80A729F3FA52CF523B25941EA44B4155D94E5DADC5C5A77847620C7",
"E034D31A80316960024D1B3D3164FDC3",
"7E3A196f4A5879F3A7B091A2263F7C24E1716129B580566D308D9C2254B36AEE53DEF30EC85F8398",
"005815D17125D04C33790321DE29EB6241365100B5",
0x35);
sk_LV1_arr.emplace_back(0x0003005500000000, 0x0000, KEY_LV1,
"53ABDF84BE08B0351B734F2B97D2BE1621BC6C889E4362E5C70F39D6C3ED9F23",
"44E652661AC7584DBE08ECB810FB5FC0",
"733198A7759BC07326755BC9773A8A17C8A7043C7BDAB83D88E230512E2EA3852D7DA4263A7E97F9",
"004312C65347ACBE95CC306442FEFD0AF4C2935EB3",
0x05);
sk_LV1_arr.emplace_back(0x0003005600000000, 0x0000, KEY_LV1,
"48793EBDDA1AF65D737DA2FDA2DD104447A698F8A82CAAEE992831711BA94E83",
"15DCF3C67147A45D09DE7521EECA07A1",
"85A8868C320127F10B6598964C69221C086702021D31803520E21FDE4DBE827766BE41825CB7328C",
"",
0x07);
sk_LV1_arr.emplace_back(0x0003006100000000, 0x0000, KEY_LV1,
"5FF17D836E2C4AD69476E2614F64BDD05B9115389A9A6D055B5B544B1C34E3D5",
"DF0F50EC3C4743C5B17839D7B49F24A4",
"1CDABE30833823F461CA534104115FFF60010B710631E435A7D915E82AE88EDE667264656CB7062E",
"",
0x05);
sk_LV1_arr.emplace_back(0x0003006600000000, 0x0000, KEY_LV1,
"BD0621FA19383C3C72ECBC3B008F1CD55FFD7C3BB7510BF11AD0CF0FC2B70951",
"569AF3745E1E02E3E288273CDE244CD8",
"21E26F11C2D69478609DD1BD278CDFC940D90386455BA52FCD1FA7E27AC2AFA826C79A10193B625C",
"",
0x07);
sk_LV1_arr.emplace_back(0x0003007400000000, 0x0000, KEY_LV1,
"41A6E0039041E9D8AAF4EF2F2A2971248EDBD96A3985611ED7B4CE73EE4804FE",
"C8C98D5A5CE23AF5607A352AECACB0DC",
"4389664390265F96C1A882374C0F856364E33DB09BE124A4666F9A12F0DD9C811EDD55BA21ED0667",
"",
0x12);
sk_LV1_arr.emplace_back(0x0004001100000000, 0x0000, KEY_LV1,
"557EDF6C063F3272B0D44EEC12F418DA774815B5415597CC5F75C21E048BAD74",
"7144D7574937818517826227EF4AC0B4",
"085D38DBF9B757329EB862107929909D32FA1DAE60641BF4AC25319D7650597EE977F8E810FEEA96",
"",
0x13);
sk_LV1_arr.emplace_back(0x0004005000000000, 0x0000, KEY_LV1,
"10CEA04973FCCC12EC19924510822D8D4C41F657FD3D7E73F415A8D687421BCD",
"ED8699562C6AC65204FA166257E7FCF4",
"9AF86FC869C159FBB62F7D9674EE257ABF12E5A96D5875B4AA73C13C2BC13E2A4079F98B9B935EE2",
"",
0x14);
}
void KeyVault::LoadSelfLV2Keys()
{
sk_LV2_arr.clear();
sk_LV2_arr.emplace_back(0x0003003000000000, 0x0000, KEY_LV2,
"94303F69513572AB5AE17C8C2A1839D2C24C28F65389D3BBB11894CE23E0798F",
"9769BFD187B90990AE5FEA4E110B9CF5",
"AFAF5E96AF396CBB69071082C46A8F34A030E8EDB799E0A7BE00AA264DFF3AEBF7923920D559404D",
"0070ABF9361B02291829D479F56AB248203CD3EB46",
0x20);
sk_LV2_arr.emplace_back(0x0003004200000000, 0x0000, KEY_LV2,
"575B0A6C4B4F2760A03FE4189EBAF4D947279FD982B14070349098B08FF92C10",
"411CB18F460CE50CAF2C426D8F0D93C8",
"3FEE313954CB3039C321A7E33B97FFDEC8988A8B55759161B04DBF4731284E4A8191E3F17D32B0EA",
"0073076441A08CD179E5FACE349B86DA58B5B7BA78",
0x21);
sk_LV2_arr.emplace_back(0x0003005000000000, 0x0000, KEY_LV2,
"6DBD48D787C58803A8D724DA5ACF04FF8FCE91D7545D2322F2B7ABF57014AF68",
"603A36213708520ED5D745DEC1325BA5",
"5888CB83AC3CCA9610BC173C53141C0CA58B93719E744660CA8823D5EAEE8F9BF736997054E4B7E3",
"0009EBC3DE442FA5FBF6C4F3D4F9EAB07778A142BD",
0x22);
sk_LV2_arr.emplace_back(0x0003005500000000, 0x0000, KEY_LV2,
"84015E90FA23139628A3C75CC09714E6427B527A82D18ABC3E91CD8D7DDAFF17",
"5B240444D645F2038118F97FD5A145D5",
"B266318245266B2D33641CD8A864066D077FAC60B7E27399099A70A683454B70F9888E7CC0C2BF72",
"009D4CBA2BFB1A8330D3E20E59D281D476D231C73A",
0x32);
sk_LV2_arr.emplace_back(0x0003005600000000, 0x0000, KEY_LV2,
"EAE15444048EFDE7A831BFA9F5D96F047C9FCFF50723E292CF50F5417D81E359",
"9CA9282DC7FA9F315EF3156D970B7CD4",
"0D58938CB47598A6A672874F1768068F8B80D8D17014D2ABEBAC85E5B0993D9FB6F307DDC3DDA699",
"",
0x33);
sk_LV2_arr.emplace_back(0x0003006100000000, 0x0000, KEY_LV2,
"88AD367EDEC2FEED3E2F99B1C685075C41BDEC90C84F526CAF588F89BBD1CBCC",
"8D18E8E525230E63DE10291C9DD615BF",
"86EED1D65E58890ABDA9ACA486A2BDDB9C0A529C2053FAE301F0F698EAF443DA0F60595A597A7027",
"",
0x32);
sk_LV2_arr.emplace_back(0x0003006600000000, 0x0000, KEY_LV2,
"688D5FCAC6F4EA35AC6AC79B10506007286131EE038116DB8AA2C0B0340D9FB0",
"75E0239D18B0B669EAE650972F99726B",
"008E1C820AC567D1BFB8FE3CC6AD2E1845A1D1B19ED2E18B18CA34A8D28A83EC60C63859CDB3DACA",
"",
0x33);
sk_LV2_arr.emplace_back(0x0003007400000000, 0x0000, KEY_LV2,
"E81C5B04C29FB079A4A2687A39D4EA97BFB49D80EF546CEB292979A5F77A6254",
"15058FA7F2CAD7C528B5F605F6444EB0",
"438D0E5C1E7AFB18234DB6867472FF5F52B750F30C379C7DD1EE0FD23E417B3EA819CC01BAC480ED",
"",
0x11);
sk_LV2_arr.emplace_back(0x0004001100000000, 0x0000, KEY_LV2,
"A1E4B86ED02BF7F1372A2C73FE02BC738907EB37CE3BA605FE783C999FAFDB97",
"BBE7799B9A37CB272E386618FDFD4AEC",
"5B31A8E2A663EBD673196E2E1022E0D64988C4E1BBFE5E474415883A3BA0D9C562A2BE9C30E9B4A8",
"",
0x07);
sk_LV2_arr.emplace_back(0x0004005000000000, 0x0000, KEY_LV2,
"0CAF212B6FA53C0DA7E2C575ADF61DBE68F34A33433B1B891ABF5C4251406A03",
"9B79374722AD888EB6A35A2DF25A8B3E",
"1034A6F98AF6625CC3E3604B59B971CA617DF337538D2179EBB22F3BDC9D0C6DA56BA7DDFD205A50",
"",
0x14);
}
void KeyVault::LoadSelfISOKeys()
{
sk_ISO_arr.clear();
sk_ISO_arr.emplace_back(0x0003003000000000, 0x0001, KEY_ISO,
"8860D0CFF4D0DC688D3223321B96B59A777E6914961488E07048DAECB020ECA4",
"C82D015D46CF152F1DD0C16F18B5B1E5",
"733918D7C888130509346E6B4A8B6CAA357AB557E814E8122BF102C14A314BF9475B9D70EAF9EC29",
"009BE892E122A5C943C1BB7403A67318AA9E1B286F",
0x36);
sk_ISO_arr.emplace_back(0x0003004200000000, 0x0001, KEY_ISO,
"101E27F3FA2FB53ACA924F783AD553162D56B975D05B81351A1111799F20254D",
"8D2E9C6297B8AD252998458296AC773C",
"138446EE0BDDA5638F97328C8956E6489CBBFE57C5961D40DD5C43BB4138F1C400A8B27204A5D625",
"00849DBC57D3B92F01864E6E82EB4EF0EF6311E122",
0x32);
sk_ISO_arr.emplace_back(0x0003005000000000, 0x0001, KEY_ISO,
"3F2604FA27AEADFBE1AC69EB00BB16EF196C2193CBD62900FFD8C25041680843",
"A414AC1DB7987E43777651B330B899E1",
"1F4633AFDE18614D6CEF38A2FD6C4CCAC7B6EB8109D72CD066ECEBA0193EA3F43C37AE83179A4E5F",
"0085B4B05DEBA7E6AD831653C974D95149803BB272",
0x33);
sk_ISO_arr.emplace_back(0x0003005500000000, 0x0001, KEY_ISO,
"BDB74AA6E3BA2DC10B1BD7F17198399A158DBE1FA0BEA68C90FCACBE4D04BE37",
"0207A479B1574F8E7F697528F05D5435",
"917E1F1DC48A54EB5F10B38E7569BB5383628A7C906F0DCA62FDA33805C15FAB270016940A09DB58",
"00294411363290975BA551336D3965D88AF029A17B",
0x03);
sk_ISO_arr.emplace_back(0x0003005600000000, 0x0001, KEY_ISO,
"311C015F169F2A1E0757F7064B14C7C9F3A3FFEE015BD4E3A22401A2667857CE",
"7BB8B3F5AC8E0890E3148AE5688C7350",
"3F040EFA2335FED5670BA4D5C3AB2D9D0B4BA69D154A0062EA995A7D21DBAF0DC5A0DAD333D1C1DD",
"",
0x08);
sk_ISO_arr.emplace_back(0x0003006100000000, 0x0001, KEY_ISO,
"8474ADCA3B3244931EECEB9357841442442A1C4A4BCF4E498E6738950F4E4093",
"FFF9CACCC4129125CAFB240F419E5F39",
"098E1A53E59A95316B00D5A29C05FFEBAE41D1A8A386F9DA96F98858FD25E07BB7A3BC96A5D5B556",
"",
0x03);
sk_ISO_arr.emplace_back(0x0003006600000000, 0x0001, KEY_ISO,
"E6A21C599B75696C169EC02582BDA74A776134A6E05108EA701EC0CA2AC03592",
"D292A7BD57C0BB2EABBCA1252FA9EDEF",
"2ED078A13DC4617EB550AD06E228C83C142A2D588EB5E729402D18038A14842FD65B277DCAD225A5",
"",
0x08);
sk_ISO_arr.emplace_back(0x0003007400000000, 0x0001, KEY_ISO,
"072D3A5C3BDB0D674DE209381432B20414BC9BDA0F583ECB94BD9A134176DD51",
"8516A81F02CF938740498A406C880871",
"5A778DEB5C4F12E8D48E06A2BBBBE3C90FA8C6C47DF9BDB5697FD4A8EB7941CE3F59A557E81C787D",
"",
0x21);
sk_ISO_arr.emplace_back(0x0003007400000000, 0x0100, KEY_ISO,
"786FAB8A0B89474A2CB80B3EA104CCCB9E13F66B45EC499BB31865D07C661EA8",
"94662F13D99A9F5D211C979FFDF65FE3",
"912C94C252B7799CEB45DFBB73EF7CAD9BCC0793A3331BBB79E3C47C0F5C782F698065A8D4DB0D8B",
"",
0x0E);
sk_ISO_arr.emplace_back(0x0004001100000000, 0x0001, KEY_ISO,
"4262657A3185D9480F82C8BD2F81766FCC2C8FD7DD5EBE8657B00B939E0C75BD",
"4F1E3EF07D893A4714B1B3D5A4E50479",
"4DBFCFA68B52F1D66E09AFA6C18EC65479EDBD027B6B8C6A5D85FE5C84D43EA40CEF1672078A0702",
"",
0x11);
sk_ISO_arr.emplace_back(0x0004001100000000, 0x0100, KEY_ISO,
"16AA7D7C35399E2B1BFAF68CD19D7512A7855029C08BECC4CC3F035DF7F9C70B",
"0E50DB6D937D262CB0499136852FCB80",
"AEE2795BF295662A50DFAFE70D1B0B6F0A2EBB211E1323A275FC6E2D13BE4F2F10CA34784F4CF1EC",
"",
0x0F);
sk_ISO_arr.emplace_back(0x0004005000000000, 0x0001, KEY_ISO,
"63565DBE98C3B1A52AADC907C47130FE57A10734E84F22592670F86ED2B0A086",
"953F6A99891B4739358F5363A00C08B9",
"26BE7B02E7D65C6C21BF4063CDB8C0092FE1679D62FA1A8CCC284A1D21885473A959992537A06612",
"",
0x15);
sk_ISO_arr.emplace_back(0x0004005000000000, 0x0100, KEY_ISO,
"B96EA32CB96EA32DB96EA32CB96EA32CB96EA32CB96EA32DB96EA32CB96EA32C",
"B96EA32CB96EA32DB96EA32DB96EA32C",
"2D7066E68C6AC3373B1346FD76FE7D18A207C811500E65D85DB57BC4A27AD78F59FD53F38F50E151",
"0044AA25B4276D79B494A29CB8DE104642424F8EEF",
0x02);
}
void KeyVault::LoadSelfAPPKeys()
{
sk_APP_arr.clear();
sk_APP_arr.emplace_back(0x0000009200000000, 0x0000, KEY_APP,
"95F50019E7A68E341FA72EFDF4D60ED376E25CF46BB48DFDD1F080259DC93F04",
"4A0955D946DB70D691A640BB7FAECC4C",
"6F8DF8EBD0A1D1DB08B30DD3A951E3F1F27E34030B42C729C55555232D61B834B8BDFFB07E54B343",
"006C3E4CCB2C69A5AD7C6F60448E50C7F9184EEAF4",
0x21);
sk_APP_arr.emplace_back(0x0003003000000000, 0x0001, KEY_APP,
"79481839C406A632BDB4AC093D73D99AE1587F24CE7E69192C1CD0010274A8AB",
"6F0F25E1C8C4B7AE70DF968B04521DDA",
"94D1B7378BAFF5DFED269240A7A364ED68446741622E50BC6079B6E606A2F8E0A4C56E5CFF836526",
"003DE80167D2F0E9D30F2145144A558D1174F5410C",
0x11);
sk_APP_arr.emplace_back(0x0003003000000000, 0x0002, KEY_APP,
"4F89BE98DDD43CAD343F5BA6B1A133B0A971566F770484AAC20B5DD1DC9FA06A",
"90C127A9B43BA9D8E89FE6529E25206F",
"8CA6905F46148D7D8D84D2AFCEAE61B41E6750FC22EA435DFA61FCE6F4F860EE4F54D9196CA5290E",
"",
0x13);
sk_APP_arr.emplace_back(0x0003003000000000, 0x0003, KEY_APP,
"C1E6A351FCED6A0636BFCB6801A0942DB7C28BDFC5E0A053A3F52F52FCE9754E",
"E0908163F457576440466ACAA443AE7C",
"50022D5D37C97905F898E78E7AA14A0B5CAAD5CE8190AE5629A10D6F0CF4173597B37A95A7545C92",
"",
0x0B);
sk_APP_arr.emplace_back(0x0003004200000000, 0x0004, KEY_APP,
"838F5860CF97CDAD75B399CA44F4C214CDF951AC795298D71DF3C3B7E93AAEDA",
"7FDBB2E924D182BB0D69844ADC4ECA5B",
"1F140E8EF887DAB52F079A06E6915A6460B75CD256834A43FA7AF90C23067AF412EDAFE2C1778D69",
"0074E922FDEE5DC4CDF22FC8D7986477F813400860",
0x14);
sk_APP_arr.emplace_back(0x0003004200000000, 0x0005, KEY_APP,
"C109AB56593DE5BE8BA190578E7D8109346E86A11088B42C727E2B793FD64BDC",
"15D3F191295C94B09B71EBDE088A187A",
"B6BB0A84C649A90D97EBA55B555366F52381BB38A84C8BB71DA5A5A0949043C6DB249029A43156F7",
"",
0x15);
sk_APP_arr.emplace_back(0x0003004200000000, 0x0006, KEY_APP,
"6DFD7AFB470D2B2C955AB22264B1FF3C67F180983B26C01615DE9F2ECCBE7F41",
"24BD1C19D2A8286B8ACE39E4A37801C2",
"71F46AC33FF89DF589A100A7FB64CEAC244C9A0CBBC1FDCE80FB4BF8A0D2E66293309CB8EE8CFA95",
"",
0x2C);
sk_APP_arr.emplace_back(0x0003005000000000, 0x0007, KEY_APP,
"945B99C0E69CAF0558C588B95FF41B232660ECB017741F3218C12F9DFDEEDE55",
"1D5EFBE7C5D34AD60F9FBC46A5977FCE",
"AB284CA549B2DE9AA5C903B75652F78D192F8F4A8F3CD99209415C0A84C5C9FD6BF3095C1C18FFCD",
"002CF896D35DB871D0E6A252E799876A70D043C23E",
0x15);
sk_APP_arr.emplace_back(0x0003005000000000, 0x0008, KEY_APP,
"2C9E8969EC44DFB6A8771DC7F7FDFBCCAF329EC3EC070900CABB23742A9A6E13",
"5A4CEFD5A9C3C093D0B9352376D19405",
"6E82F6B54A0E9DEBE4A8B3043EE3B24CD9BBB62B4416B0482582E419A2552E29AB4BEA0A4D7FA2D5",
"",
0x16);
sk_APP_arr.emplace_back(0x0003005000000000, 0x0009, KEY_APP,
"F69E4A2934F114D89F386CE766388366CDD210F1D8913E3B973257F1201D632B",
"F4D535069301EE888CC2A852DB654461",
"1D7B974D10E61C2ED087A0981535904677EC07E96260F89565FF7EBDA4EE035C2AA9BCBDD5893F99",
"",
0x2D);
sk_APP_arr.emplace_back(0x0003005500000000, 0x000A, KEY_APP,
"29805302E7C92F204009161CA93F776A072141A8C46A108E571C46D473A176A3",
"5D1FAB844107676ABCDFC25EAEBCB633",
"09301B6436C85B53CB1585300A3F1AF9FB14DB7C30088C4642AD66D5C148B8995BB1A698A8C71827",
"0010818ED8A666051C6198662C3D6DDE2CA4901DDC",
0x25);
sk_APP_arr.emplace_back(0x0003005500000000, 0x000B, KEY_APP,
"A4C97402CC8A71BC7748661FE9CE7DF44DCE95D0D58938A59F47B9E9DBA7BFC3",
"E4792F2B9DB30CB8D1596077A13FB3B5",
"2733C889D289550FE00EAA5A47A34CEF0C1AF187610EB07BA35D2C09BB73C80B244EB4147700D1BF",
"",
0x26);
sk_APP_arr.emplace_back(0x0003005500000000, 0x000C, KEY_APP,
"9814EFFF67B7074D1B263BF85BDC8576CE9DEC914123971B169472A1BC2387FA",
"D43B1FA8BE15714B3078C23908BB2BCA",
"7D1986C6BEE6CE1E0C5893BD2DF203881F40D5056761CC3F1F2E9D9A378617A2DE40BA5F09844CEB",
"",
0x3D);
sk_APP_arr.emplace_back(0x0003005600000000, 0x000D, KEY_APP,
"03B4C421E0C0DE708C0F0B71C24E3EE04306AE7383D8C5621394CCB99FF7A194",
"5ADB9EAFE897B54CB1060D6885BE22CF",
"71502ADB5783583AB88B2D5F23F419AF01C8B1E72FCA1E694AD49FE3266F1F9C61EFC6F29B351142",
"",
0x12);
sk_APP_arr.emplace_back(0x0003005600000000, 0x000E, KEY_APP,
"39A870173C226EB8A3EEE9CA6FB675E82039B2D0CCB22653BFCE4DB013BAEA03",
"90266C98CBAA06C1BF145FF760EA1B45",
"84DE5692809848E5ACBE25BE548F6981E3DB14735A5DDE1A0FD1F475866532B862B1AB6A004B7255",
"",
0x27);
sk_APP_arr.emplace_back(0x0003005600000000, 0x000F, KEY_APP,
"FD52DFA7C6EEF5679628D12E267AA863B9365E6DB95470949CFD235B3FCA0F3B",
"64F50296CF8CF49CD7C643572887DA0B",
"0696D6CCBD7CF585EF5E00D547503C185D7421581BAD196E081723CD0A97FA40B2C0CD2492B0B5A1",
"",
0x3A);
sk_APP_arr.emplace_back(0x0003006100000000, 0x0010, KEY_APP,
"A5E51AD8F32FFBDE808972ACEE46397F2D3FE6BC823C8218EF875EE3A9B0584F",
"7A203D5112F799979DF0E1B8B5B52AA4",
"50597B7F680DD89F6594D9BDC0CBEE03666AB53647D0487F7F452FE2DD02694631EA755548C9E934",
"",
0x25);
sk_APP_arr.emplace_back(0x0003006100000000, 0x0011, KEY_APP,
"0F8EAB8884A51D092D7250597388E3B8B75444AC138B9D36E5C7C5B8C3DF18FD",
"97AF39C383E7EF1C98FA447C597EA8FE",
"2FDA7A56AAEA65921C0284FF1942C6DE137370093D106034B59191951A5201B422D462F8726F852D",
"",
0x26);
sk_APP_arr.emplace_back(0x0003006600000000, 0x0013, KEY_APP,
"DBF62D76FC81C8AC92372A9D631DDC9219F152C59C4B20BFF8F96B64AB065E94",
"CB5DD4BE8CF115FFB25801BC6086E729",
"B26FE6D3E3A1E766FAE79A8E6A7F48998E7FC1E4B0AD8745FF54C018C2A6CC7A0DD7525FAFEA4917",
"",
0x12);
sk_APP_arr.emplace_back(0x0003006600000000, 0x0014, KEY_APP,
"491B0D72BB21ED115950379F4564CE784A4BFAABB00E8CB71294B192B7B9F88E",
"F98843588FED8B0E62D7DDCB6F0CECF4",
"04275E8838EF95BD013B223C3DF674540932F21B534C7ED2944B9104D938FEB03B824DDB866AB26E",
"",
0x27);
sk_APP_arr.emplace_back(0x0003007400000000, 0x0016, KEY_APP,
"A106692224F1E91E1C4EBAD4A25FBFF66B4B13E88D878E8CD072F23CD1C5BF7C",
"62773C70BD749269C0AFD1F12E73909E",
"566635D3E1DCEC47243AAD1628AE6B2CEB33463FC155E4635846CE33899C5E353DDFA47FEF5694AF",
"",
0x30);
sk_APP_arr.emplace_back(0x0003007400000000, 0x0017, KEY_APP,
"4E104DCE09BA878C75DA98D0B1636F0E5F058328D81419E2A3D22AB0256FDF46",
"954A86C4629E116532304A740862EF85",
"3B7B04C71CAE2B1199D57453C038BB1B541A05AD1B94167B0AB47A9B24CAECB9000CB21407009666",
"",
0x08);
sk_APP_arr.emplace_back(0x0003007400000000, 0x0018, KEY_APP,
"1F876AB252DDBCB70E74DC4A20CD8ED51E330E62490E652F862877E8D8D0F997",
"BF8D6B1887FA88E6D85C2EDB2FBEC147",
"64A04126D77BF6B4D686F6E8F87DD150A5B014BA922D2B694FFF4453E11239A6E0B58F1703C51494",
"",
0x11);
sk_APP_arr.emplace_back(0x0004001100000000, 0x0019, KEY_APP,
"3236B9937174DF1DC12EC2DD8A318A0EA4D3ECDEA5DFB4AC1B8278447000C297",
"6153DEE781B8ADDC6A439498B816DC46",
"148DCA961E2738BAF84B2D1B6E2DA2ABD6A95F2C9571E54C6922F9ED9674F062B7F1BE5BD6FA5268",
"",
0x31);
sk_APP_arr.emplace_back(0x0004001100000000, 0x001A, KEY_APP,
"5EFD1E9961462794E3B9EF2A4D0C1F46F642AAE053B5025504130590E66F19C9",
"1AC8FA3B3C90F8FDE639515F91B58327",
"BE4B1B513536960618BFEF12A713F6673881B02F9DC616191E823FC8337CCF99ADAA6172019C0C23",
"",
0x17);
sk_APP_arr.emplace_back(0x0004001100000000, 0x001B, KEY_APP,
"66637570D1DEC098467DB207BAEA786861964D0964D4DBAF89E76F46955D181B",
"9F7B5713A5ED59F6B35CD8F8A165D4B8",
"4AB6FB1F6F0C3D9219923C1AC683137AB05DF667833CC6A5E8F590E4E28FE2EB180C7D5861117CFB",
"",
0x12);
sk_APP_arr.emplace_back(0x0004004600000000, 0x001C, KEY_APP,
"CFF025375BA0079226BE01F4A31F346D79F62CFB643CA910E16CF60BD9092752",
"FD40664E2EBBA01BF359B0DCDF543DA4",
"36C1ACE6DD5CCC0006FDF3424750FAC515FC5CFA2C93EC53C6EC2BC421708D154E91F2E7EA54A893",
"",
0x09);
sk_APP_arr.emplace_back(0x0004004600000000, 0x001D, KEY_APP,
"D202174EB65A62048F3674B59EF6FE72E1872962F3E1CD658DE8D7AF71DA1F3E",
"ACB9945914EBB7B9A31ECE320AE09F2D",
"430322887503CF52928FAAA410FD623C7321281C8825D95F5B47EF078EFCFC44454C3AB4F00BB879",
"",
0x1A);
}
void KeyVault::LoadSelfNPDRMKeys()
{
sk_NPDRM_arr.clear();
sk_NPDRM_arr.emplace_back(0x0001000000000000, 0x0001, KEY_NPDRM,
"F9EDD0301F770FABBA8863D9897F0FEA6551B09431F61312654E28F43533EA6B",
"A551CCB4A42C37A734A2B4F9657D5540",
"B05F9DA5F9121EE4031467E74C505C29A8E29D1022379EDFF0500B9AE480B5DAB4578A4C61C5D6BF",
"00040AB47509BED04BD96521AD1B365B86BF620A98",
0x11);
sk_NPDRM_arr.emplace_back(0x0001000000000000, 0x0002, KEY_NPDRM,
"8E737230C80E66AD0162EDDD32F1F774EE5E4E187449F19079437A508FCF9C86",
"7AAECC60AD12AED90C348D8C11D2BED5",
"05BF09CB6FD78050C78DE69CC316FF27C9F1ED66A45BFCE0A1E5A6749B19BD546BBB4602CF373440",
"",
0x0A);
sk_NPDRM_arr.emplace_back(0x0003003000000000, 0x0003, KEY_NPDRM,
"1B715B0C3E8DC4C1A5772EBA9C5D34F7CCFE5B82025D453F3167566497239664",
"E31E206FBB8AEA27FAB0D9A2FFB6B62F",
"3F51E59FC74D6618D34431FA67987FA11ABBFACC7111811473CD9988FE91C43FC74605E7B8CB732D",
"",
0x08);
sk_NPDRM_arr.emplace_back(0x0003004200000000, 0x0004, KEY_NPDRM,
"BB4DBF66B744A33934172D9F8379A7A5EA74CB0F559BB95D0E7AECE91702B706",
"ADF7B207A15AC601110E61DDFC210AF6",
"9C327471BAFF1F877AE4FE29F4501AF5AD6A2C459F8622697F583EFCA2CA30ABB5CD45D1131CAB30",
"00B61A91DF4AB6A9F142C326BA9592B5265DA88856",
0x16);
sk_NPDRM_arr.emplace_back(0x0003004200000000, 0x0006, KEY_NPDRM,
"8B4C52849765D2B5FA3D5628AFB17644D52B9FFEE235B4C0DB72A62867EAA020",
"05719DF1B1D0306C03910ADDCE4AF887",
"2A5D6C6908CA98FC4740D834C6400E6D6AD74CF0A712CF1E7DAE806E98605CC308F6A03658F2970E",
"",
0x29);
sk_NPDRM_arr.emplace_back(0x0003005000000000, 0x0007, KEY_NPDRM,
"3946DFAA141718C7BE339A0D6C26301C76B568AEBC5CD52652F2E2E0297437C3",
"E4897BE553AE025CDCBF2B15D1C9234E",
"A13AFE8B63F897DA2D3DC3987B39389DC10BAD99DFB703838C4A0BC4E8BB44659C726CFD0CE60D0E",
"009EF86907782A318D4CC3617EBACE2480E73A46F6",
0x17);
sk_NPDRM_arr.emplace_back(0x0003005000000000, 0x0009, KEY_NPDRM,
"0786F4B0CA5937F515BDCE188F569B2EF3109A4DA0780A7AA07BD89C3350810A",
"04AD3C2F122A3B35E804850CAD142C6D",
"A1FE61035DBBEA5A94D120D03C000D3B2F084B9F4AFA99A2D4A588DF92B8F36327CE9E47889A45D0",
"",
0x2A);
sk_NPDRM_arr.emplace_back(0x0003005500000000, 0x000A, KEY_NPDRM,
"03C21AD78FBB6A3D425E9AAB1298F9FD70E29FD4E6E3A3C151205DA50C413DE4",
"0A99D4D4F8301A88052D714AD2FB565E",
"3995C390C9F7FBBAB124A1C14E70F9741A5E6BDF17A605D88239652C8EA7D5FC9F24B30546C1E44B",
"009AC6B22A056BA9E0B6D1520F28A57A3135483F9F",
0x27);
sk_NPDRM_arr.emplace_back(0x0003005500000000, 0x000C, KEY_NPDRM,
"357EBBEA265FAEC271182D571C6CD2F62CFA04D325588F213DB6B2E0ED166D92",
"D26E6DD2B74CD78E866E742E5571B84F",
"00DCF5391618604AB42C8CFF3DC304DF45341EBA4551293E9E2B68FFE2DF527FFA3BE8329E015E57",
"",
0x3A);
sk_NPDRM_arr.emplace_back(0x0003005600000000, 0x000D, KEY_NPDRM,
"337A51416105B56E40D7CAF1B954CDAF4E7645F28379904F35F27E81CA7B6957",
"8405C88E042280DBD794EC7E22B74002",
"9BFF1CC7118D2393DE50D5CF44909860683411A532767BFDAC78622DB9E5456753FE422CBAFA1DA1",
"",
0x18);
sk_NPDRM_arr.emplace_back(0x0003005600000000, 0x000F, KEY_NPDRM,
"135C098CBE6A3E037EBE9F2BB9B30218DDE8D68217346F9AD33203352FBB3291",
"4070C898C2EAAD1634A288AA547A35A8",
"BBD7CCCB556C2EF0F908DC7810FAFC37F2E56B3DAA5F7FAF53A4944AA9B841F76AB091E16B231433",
"",
0x3B);
sk_NPDRM_arr.emplace_back(0x0003006100000000, 0x0010, KEY_NPDRM,
"4B3CD10F6A6AA7D99F9B3A660C35ADE08EF01C2C336B9E46D1BB5678B4261A61",
"C0F2AB86E6E0457552DB50D7219371C5",
"64A5C60BC2AD18B8A237E4AA690647E12BF7A081523FAD4F29BE89ACAC72F7AB43C74EC9AFFDA213",
"",
0x27);
sk_NPDRM_arr.emplace_back(0x0003006600000000, 0x0013, KEY_NPDRM,
"265C93CF48562EC5D18773BEB7689B8AD10C5EB6D21421455DEBC4FB128CBF46",
"8DEA5FF959682A9B98B688CEA1EF4A1D",
"9D8DB5A880608DC69717991AFC3AD5C0215A5EE413328C2ABC8F35589E04432373DB2E2339EEF7C8",
"",
0x18);
sk_NPDRM_arr.emplace_back(0x0003007400000000, 0x0016, KEY_NPDRM,
"7910340483E419E55F0D33E4EA5410EEEC3AF47814667ECA2AA9D75602B14D4B",
"4AD981431B98DFD39B6388EDAD742A8E",
"62DFE488E410B1B6B2F559E4CB932BCB78845AB623CC59FDF65168400FD76FA82ED1DC60E091D1D1",
"",
0x25);
sk_NPDRM_arr.emplace_back(0x0004001100000000, 0x0019, KEY_NPDRM,
"FBDA75963FE690CFF35B7AA7B408CF631744EDEF5F7931A04D58FD6A921FFDB3",
"F72C1D80FFDA2E3BF085F4133E6D2805",
"637EAD34E7B85C723C627E68ABDD0419914EBED4008311731DD87FDDA2DAF71F856A70E14DA17B42",
"",
0x24);
sk_NPDRM_arr.emplace_back(0x0004004600000000, 0x001C, KEY_NPDRM,
"8103EA9DB790578219C4CEDF0592B43064A7D98B601B6C7BC45108C4047AA80F",
"246F4B8328BE6A2D394EDE20479247C5",
"503172C9551308A87621ECEE90362D14889BFED2CF32B0B3E32A4F9FE527A41464B735E1ADBC6762",
"",
0x30);
}
void KeyVault::LoadSelfUNK7Keys()
{
sk_UNK7_arr.clear();
sk_UNK7_arr.emplace_back(0x0003003000000000, 0x0000, KEY_UNK7,
"D91166973979EA8694476B011AC62C7E9F37DA26DE1E5C2EE3D66E42B8517085",
"DC01280A6E46BC674B81A7E8801EBE6E",
"A0FC44108236141BF3517A662B027AFC1AC513A05690496C754DEB7D43BDC41B80FD75C212624EE4",
"",
0x11);
sk_UNK7_arr.emplace_back(0x0003004200000000, 0x0000, KEY_UNK7,
"B73111B0B00117E48DE5E2EE5E534C0F0EFFA4890BBB8CAD01EE0F848F91583E",
"86F56F9E5DE513894874B8BA253334B1",
"B0BA1A1AB9723BB4E87CED9637BE056066BC56E16572D43D0210A06411DBF8FEB8885CD912384AE5",
"",
0x12);
sk_UNK7_arr.emplace_back(0x0003005000000000, 0x0000, KEY_UNK7,
"8E944267C02E69A4FE474B7F5FCD7974A4F936FF4355AEC4F80EFA123858D8F6",
"908A75754E521EAC2F5A4889C6D7B72D",
"91201DA7D79E8EE2563142ECBD646DA026C963AC09E760E5390FFE24DAE6864310ABE147F8204D0B",
"",
0x13);
sk_UNK7_arr.emplace_back(0x0003005500000000, 0x0000, KEY_UNK7,
"BB31DF9A6F62C0DF853075FAA65134D9CE2240306C1731D1F7DA9B5329BD699F",
"263057225873F83940A65C8C926AC3E4",
"BC3A82A4F44C43A197070CD236FDC94FCC542D69A3E803E0AFF78D1F3DA19A79D2F61FAB5B94B437",
"",
0x23);
sk_UNK7_arr.emplace_back(0x0003005600000000, 0x0000, KEY_UNK7,
"71AA75C70A255580E4AE9BDAA0B08828C53EAA713CD0713797F143B284C1589B",
"9DED878CB6BA07121C0F50E7B172A8BF",
"387FCDAEAFF1B59CFAF79CE6215A065ACEAFFAF4048A4F217E1FF5CE67C66EC3F089DB235E52F9D3",
"",
0x29);
sk_UNK7_arr.emplace_back(0x0003006100000000, 0x0000, KEY_UNK7,
"F5D1DBC182F5083CD4EA37C431C7DAC73882C07F232D2699B1DD9FDDF1BF4195",
"D3A7C3C91CBA014FCBCA6D5570DE13FF",
"97CA8A9781F45E557E98F176EF794FCDA6B151EB3DFD1ABA12151E00AE59957C3B15628FC8875D28",
"",
0x23);
sk_UNK7_arr.emplace_back(0x0003006600000000, 0x0000, KEY_UNK7,
"BF10F09590C0152F7EF749FF4B990122A4E8E5491DA49A2D931E72EEB990F860",
"22C19C5522F7A782AFC547C2640F5BDE",
"3233BA2B284189FB1687DF653002257A0925D8EB0C64EBBE8CC7DE87F548D107DE1FD3D1D285DB4F",
"",
0x29);
sk_UNK7_arr.emplace_back(0x0003007400000000, 0x0000, KEY_UNK7,
"F11DBD2C97B32AD37E55F8E743BC821D3E67630A6784D9A058DDD26313482F0F",
"FC5FA12CA3D2D336C4B8B425D679DA55",
"19E27EE90E33EDAB16B22E688B5F704E5C6EC1062070EBF43554CD03DFDAE16D684BB8B5574DBECA",
"",
0x15);
sk_UNK7_arr.emplace_back(0x0004001100000000, 0x0000, KEY_UNK7,
"751EE949CD3ADF50A469197494A1EC358409CCBE6E85217EBDE7A87D3FF1ABD8",
"23AE4ADA4D3F798DC5ED98000337FF77",
"1BABA87CD1AD705C462D4E7427B6DAF59A50383A348A15088F0EDFCF1ADF2B5C2B2D507B2A357D36",
"",
0x1A);
sk_UNK7_arr.emplace_back(0x0004004600000000, 0x0000, KEY_UNK7,
"46BD0891224E0CE13E2162921D4BB76193AEEE4416A729FCDD111C5536BF87C9",
"BF036387CDB613C0AC88A6D9D2CC5316",
"A14F6D5F9AD7EBB3B7A39A7C32F13E5DC3B0BA16BDC33D39FDDF88F4AEEA6CFEEB0C0796C917A952",
"",
0x0F);
}
SELF_KEY KeyVault::GetSelfLV0Key()
{
return sk_LV0_arr[0];
}
SELF_KEY KeyVault::GetSelfLDRKey()
{
return sk_LDR_arr[0];
}
SELF_KEY KeyVault::GetSelfLV1Key(u64 version)
{
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
for(unsigned int i = 0; i < sk_LV1_arr.size(); i++)
{
if (sk_LV1_arr[i].version == version)
{
key = sk_LV1_arr[i];
break;
}
}
return key;
}
SELF_KEY KeyVault::GetSelfLV2Key(u64 version)
{
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
for(unsigned int i = 0; i < sk_LV2_arr.size(); i++)
{
if (sk_LV2_arr[i].version == version)
{
key = sk_LV2_arr[i];
break;
}
}
return key;
}
SELF_KEY KeyVault::GetSelfISOKey(u16 revision, u64 version)
{
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
for(unsigned int i = 0; i < sk_ISO_arr.size(); i++)
{
if ((sk_ISO_arr[i].version == version) &&
(sk_ISO_arr[i].revision == revision))
{
key = sk_ISO_arr[i];
break;
}
}
return key;
}
SELF_KEY KeyVault::GetSelfAPPKey(u16 revision)
{
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
for(unsigned int i = 0; i < sk_APP_arr.size(); i++)
{
if (sk_APP_arr[i].revision == revision)
{
key = sk_APP_arr[i];
break;
}
}
return key;
}
SELF_KEY KeyVault::GetSelfUNK7Key(u64 version)
{
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
for(unsigned int i = 0; i < sk_UNK7_arr.size(); i++)
{
if (sk_UNK7_arr[i].version == version)
{
key = sk_UNK7_arr[i];
break;
}
}
return key;
}
SELF_KEY KeyVault::GetSelfNPDRMKey(u16 revision)
{
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
for(unsigned int i = 0; i < sk_NPDRM_arr.size(); i++)
{
if (sk_NPDRM_arr[i].revision == revision)
{
key = sk_NPDRM_arr[i];
break;
}
}
return key;
}
SELF_KEY KeyVault::FindSelfKey(u32 type, u16 revision, u64 version)
{
// Empty key.
SELF_KEY key(0, 0, 0, "", "", "", "", 0);
// Check SELF type.
switch (type)
{
case KEY_LV0:
LoadSelfLV0Keys();
key = GetSelfLV0Key();
break;
case KEY_LV1:
LoadSelfLV1Keys();
key = GetSelfLV1Key(version);
break;
case KEY_LV2:
LoadSelfLV2Keys();
key = GetSelfLV2Key(version);
break;
case KEY_APP:
LoadSelfAPPKeys();
key = GetSelfAPPKey(revision);
break;
case KEY_ISO:
LoadSelfISOKeys();
key = GetSelfISOKey(revision, version);
break;
case KEY_LDR:
LoadSelfLDRKeys();
key = GetSelfLDRKey();
break;
case KEY_UNK7:
LoadSelfUNK7Keys();
key = GetSelfUNK7Key(version);
break;
case KEY_NPDRM:
LoadSelfNPDRMKeys();
key = GetSelfNPDRMKey(revision);
break;
default:
break;
}
return key;
}
void KeyVault::SetKlicenseeKey(u8 *key)
{
memcpy(klicensee_key, key, 0x10);
}
u8 *KeyVault::GetKlicenseeKey()
{
return klicensee_key;
}
void rap_to_rif(unsigned char* rap, unsigned char* rif)
{
int i;
int round;
aes_context aes;
unsigned char key[0x10];
unsigned char iv[0x10];
memset(key, 0, 0x10);
memset(iv, 0, 0x10);
// Initial decrypt.
aes_setkey_dec(&aes, RAP_KEY, 128);
aes_crypt_cbc(&aes, AES_DECRYPT, 0x10, iv, rap, key);
// rap2rifkey round.
for (round = 0; round < 5; ++round) {
for (i = 0; i < 16; ++i) {
int p = RAP_PBOX[i];
key[p] ^= RAP_E1[p];
}
for (i = 15; i >= 1; --i) {
int p = RAP_PBOX[i];
int pp = RAP_PBOX[i - 1];
key[p] ^= key[pp];
}
int o = 0;
for (i = 0; i < 16; ++i) {
int p = RAP_PBOX[i];
unsigned char kc = key[p] - o;
unsigned char ec2 = RAP_E2[p];
if (o != 1 || kc != 0xFF) {
o = kc < ec2 ? 1 : 0;
key[p] = kc - ec2;
} else if (kc == 0xFF) {
key[p] = kc - ec2;
} else {
key[p] = kc;
}
}
}
memcpy(rif, key, 0x10);
}
+156
View File
@@ -0,0 +1,156 @@
#pragma once
#include "utils.h"
enum SELF_KEY_TYPE {
KEY_LV0 = 1,
KEY_LV1,
KEY_LV2,
KEY_APP,
KEY_ISO,
KEY_LDR,
KEY_UNK7,
KEY_NPDRM
};
struct SELF_KEY {
u64 version;
u16 revision;
u32 self_type;
u8 erk[0x20];
u8 riv[0x10];
u8 pub[0x28];
u8 priv[0x15];
u32 curve_type;
SELF_KEY(u64 ver, u16 rev, u32 type, const std::string& e, const std::string& r, const std::string& pb, const std::string& pr, u32 ct)
{
version = ver;
revision = rev;
self_type = type;
hex_to_bytes(erk, e.c_str());
hex_to_bytes(riv, r.c_str());
hex_to_bytes(pub, pb.c_str());
hex_to_bytes(priv, pr.c_str());
curve_type = ct;
}
};
static u8 PKG_AES_KEY[0x10] = {
0x2e, 0x7b, 0x71, 0xd7, 0xc9, 0xc9, 0xa1, 0x4e, 0xa3, 0x22, 0x1f, 0x18, 0x88, 0x28, 0xb8, 0xf8
};
static u8 NP_IDPS[0x10] = {
0x5E, 0x06, 0xE0, 0x4F, 0xD9, 0x4A, 0x71, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};
static u8 NP_KLIC_FREE[0x10] = {
0x72, 0xF9, 0x90, 0x78, 0x8F, 0x9C, 0xFF, 0x74, 0x57, 0x25, 0xF0, 0x8E, 0x4C, 0x12, 0x83, 0x87
};
static u8 NP_OMAC_KEY_2[0x10] = {
0x6B, 0xA5, 0x29, 0x76, 0xEF, 0xDA, 0x16, 0xEF, 0x3C, 0x33, 0x9F, 0xB2, 0x97, 0x1E, 0x25, 0x6B
};
static u8 NP_OMAC_KEY_3[0x10] = {
0x9B, 0x51, 0x5F, 0xEA, 0xCF, 0x75, 0x06, 0x49, 0x81, 0xAA, 0x60, 0x4D, 0x91, 0xA5, 0x4E, 0x97
};
static u8 NP_KLIC_KEY[0x10] = {
0xF2, 0xFB, 0xCA, 0x7A, 0x75, 0xB0, 0x4E, 0xDC, 0x13, 0x90, 0x63, 0x8C, 0xCD, 0xFD, 0xD1, 0xEE
};
static u8 NP_RIF_KEY[0x10] = {
0xDA, 0x7D, 0x4B, 0x5E, 0x49, 0x9A, 0x4F, 0x53, 0xB1, 0xC1, 0xA1, 0x4A, 0x74, 0x84, 0x44, 0x3B
};
static u8 NP_PSP_KEY_1[0x10] = {
0x2A, 0x6A, 0xFB, 0xCF, 0x43, 0xD1, 0x57, 0x9F, 0x7D, 0x73, 0x87, 0x41, 0xA1, 0x3B, 0xD4, 0x2E
};
static u8 NP_PSP_KEY_2[0x10] = {
0x0D, 0xB8, 0x57, 0x32, 0x36, 0x6C, 0xD7, 0x34, 0xFC, 0x87, 0x9E, 0x74, 0x33, 0x43, 0xBB, 0x4F
};
static u8 NP_PSX_KEY[0x10] = {
0x52, 0xC0, 0xB5, 0xCA, 0x76, 0xD6, 0x13, 0x4B, 0xB4, 0x5F, 0xC6, 0x6C, 0xA6, 0x37, 0xF2, 0xC1
};
static u8 RAP_KEY[0x10] = {
0x86, 0x9F, 0x77, 0x45, 0xC1, 0x3F, 0xD8, 0x90, 0xCC, 0xF2, 0x91, 0x88, 0xE3, 0xCC, 0x3E, 0xDF
};
static u8 RAP_PBOX[0x10] = {
0x0C, 0x03, 0x06, 0x04, 0x01, 0x0B, 0x0F, 0x08, 0x02, 0x07, 0x00, 0x05, 0x0A, 0x0E, 0x0D, 0x09
};
static u8 RAP_E1[0x10] = {
0xA9, 0x3E, 0x1F, 0xD6, 0x7C, 0x55, 0xA3, 0x29, 0xB7, 0x5F, 0xDD, 0xA6, 0x2A, 0x95, 0xC7, 0xA5
};
static u8 RAP_E2[0x10] = {
0x67, 0xD4, 0x5D, 0xA3, 0x29, 0x6D, 0x00, 0x6A, 0x4E, 0x7C, 0x53, 0x7B, 0xF5, 0x53, 0x8C, 0x74
};
static u8 SDAT_KEY[0x10] = {
0x0D, 0x65, 0x5E, 0xF8, 0xE6, 0x74, 0xA9, 0x8A, 0xB8, 0x50, 0x5C, 0xFA, 0x7D, 0x01, 0x29, 0x33
};
static u8 EDAT_KEY_0[0x10] = {
0xBE, 0x95, 0x9C, 0xA8, 0x30, 0x8D, 0xEF, 0xA2, 0xE5, 0xE1, 0x80, 0xC6, 0x37, 0x12, 0xA9, 0xAE
};
static u8 EDAT_HASH_0[0x10] = {
0xEF, 0xFE, 0x5B, 0xD1, 0x65, 0x2E, 0xEB, 0xC1, 0x19, 0x18, 0xCF, 0x7C, 0x04, 0xD4, 0xF0, 0x11
};
static u8 EDAT_KEY_1[0x10] = {
0x4C, 0xA9, 0xC1, 0x4B, 0x01, 0xC9, 0x53, 0x09, 0x96, 0x9B, 0xEC, 0x68, 0xAA, 0x0B, 0xC0, 0x81
};
static u8 EDAT_HASH_1[0x10] = {
0x3D, 0x92, 0x69, 0x9B, 0x70, 0x5B, 0x07, 0x38, 0x54, 0xD8, 0xFC, 0xC6, 0xC7, 0x67, 0x27, 0x47
};
static u8 EDAT_IV[0x10] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
class KeyVault
{
std::vector<SELF_KEY> sk_LV0_arr;
std::vector<SELF_KEY> sk_LV1_arr;
std::vector<SELF_KEY> sk_LV2_arr;
std::vector<SELF_KEY> sk_APP_arr;
std::vector<SELF_KEY> sk_ISO_arr;
std::vector<SELF_KEY> sk_LDR_arr;
std::vector<SELF_KEY> sk_UNK7_arr;
std::vector<SELF_KEY> sk_NPDRM_arr;
u8 klicensee_key[0x10];
public:
KeyVault();
SELF_KEY FindSelfKey(u32 type, u16 revision, u64 version);
void SetKlicenseeKey(u8 *key);
u8 *GetKlicenseeKey();
private:
void LoadSelfLV0Keys();
void LoadSelfLDRKeys();
void LoadSelfLV1Keys();
void LoadSelfLV2Keys();
void LoadSelfISOKeys();
void LoadSelfAPPKeys();
void LoadSelfUNK7Keys();
void LoadSelfNPDRMKeys();
SELF_KEY GetSelfLV0Key();
SELF_KEY GetSelfLDRKey();
SELF_KEY GetSelfLV1Key(u64 version);
SELF_KEY GetSelfLV2Key(u64 version);
SELF_KEY GetSelfISOKey(u16 revision, u64 version);
SELF_KEY GetSelfAPPKey(u16 revision);
SELF_KEY GetSelfUNK7Key(u64 version);
SELF_KEY GetSelfNPDRMKey(u16 revision);
};
// RAP to RIF function.
void rap_to_rif(unsigned char* rap, unsigned char* rif);
+274
View File
@@ -0,0 +1,274 @@
// Copyright (C) 2014 Hykem <hykem@hotmail.com>
// Licensed under the terms of the GNU GPL, version 3
// http://www.gnu.org/licenses/gpl-3.0.txt
#include "lz.h"
int decode_range(unsigned int *range, unsigned int *code, unsigned char **src)
{
if (!((*range) >> 24))
{
(*range) <<= 8;
*code = ((*code) << 8) + (*src)++[5];
return 1;
}
else
return 0;
}
int decode_bit(unsigned int *range, unsigned int *code, int *index, unsigned char **src, unsigned char *c)
{
unsigned int val = *range;
if (decode_range(range, code, src))
val *= (*c);
else
val = (val >> 8) * (*c);
*c -= ((*c) >> 3);
if (index) (*index) <<= 1;
if (*code < val)
{
*range = val;
*c += 31;
if (index) (*index)++;
return 1;
}
else
{
*code -= val;
*range -= val;
return 0;
}
}
int decode_number(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src)
{
int i = 1;
if (index >= 3)
{
decode_bit(range, code, &i, src, ptr + 0x18); // Offset 0x978
if (index >= 4)
{
decode_bit(range, code, &i, src, ptr + 0x18); // Offset 0x978
if (index >= 5)
{
decode_range(range, code, src);
for (; index >= 5; index--)
{
i <<= 1;
(*range) >>= 1;
if (*code < *range)
i++;
else
(*code) -= *range;
}
}
}
}
*bit_flag = decode_bit(range, code, &i, src, ptr); // Offset 0x960
if (index >= 1)
{
decode_bit(range, code, &i, src, ptr + 0x8); // Offset 0x968
if (index >= 2)
{
decode_bit(range, code, &i, src, ptr + 0x10); // Offset 0x970
}
}
return i;
}
int decode_word(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src)
{
int i = 1;
index /= 8;
if (index >= 3)
{
decode_bit(range, code, &i, src, ptr); // Offset 0x8A8
if (index >= 4)
{
decode_bit(range, code, &i, src, ptr); // Offset 0x8A8
if (index >= 5)
{
decode_range(range, code, src);
for (; index >= 5; index--)
{
i <<= 1;
(*range) >>= 1;
if (*code < *range)
i++;
else
(*code) -= *range;
}
}
}
}
*bit_flag = decode_bit(range, code, &i, src, ptr + 3); // Offset 0x8A8 + 3
if (index >= 1)
{
decode_bit(range, code, &i, src, ptr + 2); // Offset 0x8A8 + 2
if (index >= 2)
{
decode_bit(range, code, &i, src, ptr + 1); // Offset 0x8A8 + 1
}
}
return i;
}
int decompress(unsigned char *out, unsigned char *in, unsigned int size)
{
int result;
unsigned char *tmp = new unsigned char[0xA70];
int offset = 0;
int bit_flag = 0;
int data_length = 0;
int data_offset = 0;
unsigned char *tmp_sect1, *tmp_sect2, *tmp_sect3;
unsigned char *buf_start, *buf_end;
unsigned char prev = 0;
unsigned char *start = out;
unsigned char *end = (out + size);
unsigned char head = in[0];
unsigned int range = 0xFFFFFFFF;
unsigned int code = (in[1] << 24) | (in[2] << 16) | (in[3] << 8) | in[4];
if (head < 0) // Check if we have a valid starting byte.
{
// The dictionary header is invalid, the data is not compressed.
result = -1;
if (code <= size)
{
memcpy(out, (const void *)(in + 5), code);
result = (start - out);
}
}
else
{
// Set up a temporary buffer (sliding window).
memset(tmp, 0x80, 0xA60);
while (1)
{
// Start reading at 0x920.
tmp_sect1 = tmp + offset + 0x920;
if (!decode_bit(&range, &code, 0, &in, tmp_sect1)) // Raw char.
{
// Adjust offset and check for stream end.
if (offset > 0) offset--;
if (start == end) return (start - out);
// Locate first section.
int sect = (((((((int)(start - out)) & 7) << 8) + prev) >> head) & 7) * 0xFF - 1;
tmp_sect1 = tmp + sect;
int index = 1;
// Read, decode and write back.
do
{
decode_bit(&range, &code, &index, &in, tmp_sect1 + index);
} while ((index >> 8) == 0);
// Save index.
*start++ = index;
}
else // Compressed char stream.
{
int index = -1;
// Identify the data length bit field.
do {
tmp_sect1 += 8;
bit_flag = decode_bit(&range, &code, 0, &in, tmp_sect1);
index += bit_flag;
} while ((bit_flag != 0) && (index < 6));
// Default block size is 0x40.
int b_size = 0x40;
tmp_sect2 = tmp + index + 0x7F1;
// If the data length was found, parse it as a number.
if ((index >= 0) || (bit_flag != 0))
{
// Locate next section.
int sect = (index << 5) | (((((start - out)) << index) & 3) << 3) | (offset & 7);
tmp_sect1 = tmp + 0x960 + sect;
// Decode the data length (8 bit fields).
data_length = decode_number(tmp_sect1, index, &bit_flag, &range, &code, &in);
// If we got valid parameters, seek to find data offset.
if ((data_length != 3) && ((index > 0) || (bit_flag != 0))) {
tmp_sect2 += 0x38;
b_size = 0x80; // Block size is now 0x80.
}
} else {
// Assume one byte of advance.
data_length = 1;
}
int diff = 0;
int shift = 1;
// Identify the data offset bit field.
do {
diff = (shift << 4) - b_size;
bit_flag = decode_bit(&range, &code, &shift, &in, tmp_sect2 + (shift << 3));
} while (diff < 0);
// If the data offset was found, parse it as a number.
if ((diff > 0) || (bit_flag != 0))
{
// Adjust diff if needed.
if (bit_flag == 0) diff -= 8;
// Locate section.
tmp_sect3 = tmp + 0x8A8 + diff;
// Decode the data offset (1 bit fields).
data_offset = decode_word(tmp_sect3, diff, &bit_flag, &range, &code, &in);
} else {
// Assume one byte of advance.
data_offset = 1;
}
// Set buffer start/end.
buf_start = start - data_offset;
buf_end = start + data_length + 1;
// Underflow.
if (buf_start < out)
return -1;
// Overflow.
if (buf_end > end)
return -1;
// Update offset.
offset = ((((int)(buf_end - out)) + 1) & 1) + 6;
// Copy data.
do {
*start++ = *buf_start++;
} while (start < buf_end);
}
prev = *(start - 1);
}
result = (start - out);
}
delete[] tmp;
return result;
}
+7
View File
@@ -0,0 +1,7 @@
#include <string.h>
int decode_range(unsigned int *range, unsigned int *code, unsigned char **src);
int decode_bit(unsigned int *range, unsigned int *code, int *index, unsigned char **src, unsigned char *c);
int decode_number(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src);
int decode_word(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src);
int decompress(unsigned char *out, unsigned char *in, unsigned int size);
+396
View File
@@ -0,0 +1,396 @@
/*
* FIPS-180-1 compliant SHA-1 implementation
*
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* The SHA-1 standard was published by NIST in 1993.
*
* http://www.itl.nist.gov/fipspubs/fip180-1.htm
*/
#include "stdafx.h"
#include "sha1.h"
/*
* 32-bit integer manipulation macros (big endian)
*/
#ifndef GET_UINT32_BE
#define GET_UINT32_BE(n,b,i) \
{ \
(n) = ( (uint32_t) (b)[(i) ] << 24 ) \
| ( (uint32_t) (b)[(i) + 1] << 16 ) \
| ( (uint32_t) (b)[(i) + 2] << 8 ) \
| ( (uint32_t) (b)[(i) + 3] ); \
}
#endif
#ifndef PUT_UINT32_BE
#define PUT_UINT32_BE(n,b,i) \
{ \
(b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
(b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
(b)[(i) + 3] = (unsigned char) ( (n) ); \
}
#endif
/*
* SHA-1 context setup
*/
void sha1_starts( sha1_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
ctx->state[0] = 0x67452301;
ctx->state[1] = 0xEFCDAB89;
ctx->state[2] = 0x98BADCFE;
ctx->state[3] = 0x10325476;
ctx->state[4] = 0xC3D2E1F0;
}
void sha1_process( sha1_context *ctx, const unsigned char data[64] )
{
uint32_t temp, W[16], A, B, C, D, E;
GET_UINT32_BE( W[ 0], data, 0 );
GET_UINT32_BE( W[ 1], data, 4 );
GET_UINT32_BE( W[ 2], data, 8 );
GET_UINT32_BE( W[ 3], data, 12 );
GET_UINT32_BE( W[ 4], data, 16 );
GET_UINT32_BE( W[ 5], data, 20 );
GET_UINT32_BE( W[ 6], data, 24 );
GET_UINT32_BE( W[ 7], data, 28 );
GET_UINT32_BE( W[ 8], data, 32 );
GET_UINT32_BE( W[ 9], data, 36 );
GET_UINT32_BE( W[10], data, 40 );
GET_UINT32_BE( W[11], data, 44 );
GET_UINT32_BE( W[12], data, 48 );
GET_UINT32_BE( W[13], data, 52 );
GET_UINT32_BE( W[14], data, 56 );
GET_UINT32_BE( W[15], data, 60 );
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
#define R(t) \
( \
temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \
W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \
( W[t & 0x0F] = S(temp,1) ) \
)
#define P(a,b,c,d,e,x) \
{ \
e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \
}
A = ctx->state[0];
B = ctx->state[1];
C = ctx->state[2];
D = ctx->state[3];
E = ctx->state[4];
#define F(x,y,z) (z ^ (x & (y ^ z)))
#define K 0x5A827999
P( A, B, C, D, E, W[0] );
P( E, A, B, C, D, W[1] );
P( D, E, A, B, C, W[2] );
P( C, D, E, A, B, W[3] );
P( B, C, D, E, A, W[4] );
P( A, B, C, D, E, W[5] );
P( E, A, B, C, D, W[6] );
P( D, E, A, B, C, W[7] );
P( C, D, E, A, B, W[8] );
P( B, C, D, E, A, W[9] );
P( A, B, C, D, E, W[10] );
P( E, A, B, C, D, W[11] );
P( D, E, A, B, C, W[12] );
P( C, D, E, A, B, W[13] );
P( B, C, D, E, A, W[14] );
P( A, B, C, D, E, W[15] );
P( E, A, B, C, D, R(16) );
P( D, E, A, B, C, R(17) );
P( C, D, E, A, B, R(18) );
P( B, C, D, E, A, R(19) );
#undef K
#undef F
#define F(x,y,z) (x ^ y ^ z)
#define K 0x6ED9EBA1
P( A, B, C, D, E, R(20) );
P( E, A, B, C, D, R(21) );
P( D, E, A, B, C, R(22) );
P( C, D, E, A, B, R(23) );
P( B, C, D, E, A, R(24) );
P( A, B, C, D, E, R(25) );
P( E, A, B, C, D, R(26) );
P( D, E, A, B, C, R(27) );
P( C, D, E, A, B, R(28) );
P( B, C, D, E, A, R(29) );
P( A, B, C, D, E, R(30) );
P( E, A, B, C, D, R(31) );
P( D, E, A, B, C, R(32) );
P( C, D, E, A, B, R(33) );
P( B, C, D, E, A, R(34) );
P( A, B, C, D, E, R(35) );
P( E, A, B, C, D, R(36) );
P( D, E, A, B, C, R(37) );
P( C, D, E, A, B, R(38) );
P( B, C, D, E, A, R(39) );
#undef K
#undef F
#define F(x,y,z) ((x & y) | (z & (x | y)))
#define K 0x8F1BBCDC
P( A, B, C, D, E, R(40) );
P( E, A, B, C, D, R(41) );
P( D, E, A, B, C, R(42) );
P( C, D, E, A, B, R(43) );
P( B, C, D, E, A, R(44) );
P( A, B, C, D, E, R(45) );
P( E, A, B, C, D, R(46) );
P( D, E, A, B, C, R(47) );
P( C, D, E, A, B, R(48) );
P( B, C, D, E, A, R(49) );
P( A, B, C, D, E, R(50) );
P( E, A, B, C, D, R(51) );
P( D, E, A, B, C, R(52) );
P( C, D, E, A, B, R(53) );
P( B, C, D, E, A, R(54) );
P( A, B, C, D, E, R(55) );
P( E, A, B, C, D, R(56) );
P( D, E, A, B, C, R(57) );
P( C, D, E, A, B, R(58) );
P( B, C, D, E, A, R(59) );
#undef K
#undef F
#define F(x,y,z) (x ^ y ^ z)
#define K 0xCA62C1D6
P( A, B, C, D, E, R(60) );
P( E, A, B, C, D, R(61) );
P( D, E, A, B, C, R(62) );
P( C, D, E, A, B, R(63) );
P( B, C, D, E, A, R(64) );
P( A, B, C, D, E, R(65) );
P( E, A, B, C, D, R(66) );
P( D, E, A, B, C, R(67) );
P( C, D, E, A, B, R(68) );
P( B, C, D, E, A, R(69) );
P( A, B, C, D, E, R(70) );
P( E, A, B, C, D, R(71) );
P( D, E, A, B, C, R(72) );
P( C, D, E, A, B, R(73) );
P( B, C, D, E, A, R(74) );
P( A, B, C, D, E, R(75) );
P( E, A, B, C, D, R(76) );
P( D, E, A, B, C, R(77) );
P( C, D, E, A, B, R(78) );
P( B, C, D, E, A, R(79) );
#undef K
#undef F
ctx->state[0] += A;
ctx->state[1] += B;
ctx->state[2] += C;
ctx->state[3] += D;
ctx->state[4] += E;
}
/*
* SHA-1 process buffer
*/
void sha1_update( sha1_context *ctx, const unsigned char *input, size_t ilen )
{
size_t fill;
uint32_t left;
if( ilen <= 0 )
return;
left = ctx->total[0] & 0x3F;
fill = 64 - left;
ctx->total[0] += (uint32_t) ilen;
ctx->total[0] &= 0xFFFFFFFF;
if( ctx->total[0] < (uint32_t) ilen )
ctx->total[1]++;
if( left && ilen >= fill )
{
memcpy( (void *) (ctx->buffer + left), input, fill );
sha1_process( ctx, ctx->buffer );
input += fill;
ilen -= fill;
left = 0;
}
while( ilen >= 64 )
{
sha1_process( ctx, input );
input += 64;
ilen -= 64;
}
if( ilen > 0 )
memcpy( (void *) (ctx->buffer + left), input, ilen );
}
static const unsigned char sha1_padding[64] =
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/*
* SHA-1 final digest
*/
void sha1_finish( sha1_context *ctx, unsigned char output[20] )
{
uint32_t last, padn;
uint32_t high, low;
unsigned char msglen[8];
high = ( ctx->total[0] >> 29 )
| ( ctx->total[1] << 3 );
low = ( ctx->total[0] << 3 );
PUT_UINT32_BE( high, msglen, 0 );
PUT_UINT32_BE( low, msglen, 4 );
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
sha1_update( ctx, sha1_padding, padn );
sha1_update( ctx, msglen, 8 );
PUT_UINT32_BE( ctx->state[0], output, 0 );
PUT_UINT32_BE( ctx->state[1], output, 4 );
PUT_UINT32_BE( ctx->state[2], output, 8 );
PUT_UINT32_BE( ctx->state[3], output, 12 );
PUT_UINT32_BE( ctx->state[4], output, 16 );
}
/*
* output = SHA-1( input buffer )
*/
void sha1( const unsigned char *input, size_t ilen, unsigned char output[20] )
{
sha1_context ctx;
sha1_starts( &ctx );
sha1_update( &ctx, input, ilen );
sha1_finish( &ctx, output );
memset( &ctx, 0, sizeof( sha1_context ) );
}
/*
* SHA-1 HMAC context setup
*/
void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, size_t keylen )
{
size_t i;
unsigned char sum[20];
if( keylen > 64 )
{
sha1( key, keylen, sum );
keylen = 20;
key = sum;
}
memset( ctx->ipad, 0x36, 64 );
memset( ctx->opad, 0x5C, 64 );
for( i = 0; i < keylen; i++ )
{
ctx->ipad[i] = (unsigned char)( ctx->ipad[i] ^ key[i] );
ctx->opad[i] = (unsigned char)( ctx->opad[i] ^ key[i] );
}
sha1_starts( ctx );
sha1_update( ctx, ctx->ipad, 64 );
memset( sum, 0, sizeof( sum ) );
}
/*
* SHA-1 HMAC process buffer
*/
void sha1_hmac_update( sha1_context *ctx, const unsigned char *input, size_t ilen )
{
sha1_update( ctx, input, ilen );
}
/*
* SHA-1 HMAC final digest
*/
void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] )
{
unsigned char tmpbuf[20];
sha1_finish( ctx, tmpbuf );
sha1_starts( ctx );
sha1_update( ctx, ctx->opad, 64 );
sha1_update( ctx, tmpbuf, 20 );
sha1_finish( ctx, output );
memset( tmpbuf, 0, sizeof( tmpbuf ) );
}
/*
* SHA1 HMAC context reset
*/
void sha1_hmac_reset( sha1_context *ctx )
{
sha1_starts( ctx );
sha1_update( ctx, ctx->ipad, 64 );
}
/*
* output = HMAC-SHA-1( hmac key, input buffer )
*/
void sha1_hmac( const unsigned char *key, size_t keylen,
const unsigned char *input, size_t ilen,
unsigned char output[20] )
{
sha1_context ctx;
sha1_hmac_starts( &ctx, key, keylen );
sha1_hmac_update( &ctx, input, ilen );
sha1_hmac_finish( &ctx, output );
memset( &ctx, 0, sizeof( sha1_context ) );
}
+161
View File
@@ -0,0 +1,161 @@
/**
* \file sha1.h
*
* \brief SHA-1 cryptographic hash function
*
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <string.h>
#ifdef _MSC_VER
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define POLARSSL_ERR_SHA1_FILE_IO_ERROR -0x0076 /**< Read/write error in file. */
// Regular implementation
//
/**
* \brief SHA-1 context structure
*/
typedef struct
{
uint32_t total[2]; /*!< number of bytes processed */
uint32_t state[5]; /*!< intermediate digest state */
unsigned char buffer[64]; /*!< data block being processed */
unsigned char ipad[64]; /*!< HMAC: inner padding */
unsigned char opad[64]; /*!< HMAC: outer padding */
}
sha1_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-1 context setup
*
* \param ctx context to be initialized
*/
void sha1_starts( sha1_context *ctx );
/**
* \brief SHA-1 process buffer
*
* \param ctx SHA-1 context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void sha1_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
/**
* \brief SHA-1 final digest
*
* \param ctx SHA-1 context
* \param output SHA-1 checksum result
*/
void sha1_finish( sha1_context *ctx, unsigned char output[20] );
/* Internal use */
void sha1_process( sha1_context *ctx, const unsigned char data[64] );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Output = SHA-1( input buffer )
*
* \param input buffer holding the data
* \param ilen length of the input data
* \param output SHA-1 checksum result
*/
void sha1( const unsigned char *input, size_t ilen, unsigned char output[20] );
/**
* \brief Output = SHA-1( file contents )
*
* \param path input file name
* \param output SHA-1 checksum result
*
* \return 0 if successful, or POLARSSL_ERR_SHA1_FILE_IO_ERROR
*/
int sha1_file( const char *path, unsigned char output[20] );
/**
* \brief SHA-1 HMAC context setup
*
* \param ctx HMAC context to be initialized
* \param key HMAC secret key
* \param keylen length of the HMAC key
*/
void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, size_t keylen );
/**
* \brief SHA-1 HMAC process buffer
*
* \param ctx HMAC context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void sha1_hmac_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
/**
* \brief SHA-1 HMAC final digest
*
* \param ctx HMAC context
* \param output SHA-1 HMAC checksum result
*/
void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] );
/**
* \brief SHA-1 HMAC context reset
*
* \param ctx HMAC context to be reset
*/
void sha1_hmac_reset( sha1_context *ctx );
/**
* \brief Output = HMAC-SHA-1( hmac key, input buffer )
*
* \param key HMAC secret key
* \param keylen length of the HMAC key
* \param input buffer holding the data
* \param ilen length of the input data
* \param output HMAC-SHA-1 result
*/
void sha1_hmac( const unsigned char *key, size_t keylen,
const unsigned char *input, size_t ilen,
unsigned char output[20] );
#ifdef __cplusplus
}
#endif
+699
View File
@@ -0,0 +1,699 @@
#include "stdafx.h"
#include "unedat.h"
#include "Utilities/Log.h"
void generate_key(int crypto_mode, int version, unsigned char *key_final, unsigned char *iv_final, unsigned char *key, unsigned char *iv)
{
int mode = (int) (crypto_mode & 0xF0000000);
switch (mode) {
case 0x10000000:
// Encrypted ERK.
// Decrypt the key with EDAT_KEY + EDAT_IV and copy the original IV.
aescbc128_decrypt(version ? EDAT_KEY_1 : EDAT_KEY_0, EDAT_IV, key, key_final, 0x10);
memcpy(iv_final, iv, 0x10);
break;
case 0x20000000:
// Default ERK.
// Use EDAT_KEY and EDAT_IV.
memcpy(key_final, version ? EDAT_KEY_1 : EDAT_KEY_0, 0x10);
memcpy(iv_final, EDAT_IV, 0x10);
break;
case 0x00000000:
// Unencrypted ERK.
// Use the original key and iv.
memcpy(key_final, key, 0x10);
memcpy(iv_final, iv, 0x10);
break;
};
}
void generate_hash(int hash_mode, int version, unsigned char *hash_final, unsigned char *hash)
{
int mode = (int) (hash_mode & 0xF0000000);
switch (mode) {
case 0x10000000:
// Encrypted HASH.
// Decrypt the hash with EDAT_KEY + EDAT_IV.
aescbc128_decrypt(version ? EDAT_KEY_1 : EDAT_KEY_0, EDAT_IV, hash, hash_final, 0x10);
break;
case 0x20000000:
// Default HASH.
// Use EDAT_HASH.
memcpy(hash_final, version ? EDAT_HASH_1 : EDAT_HASH_0, 0x10);
break;
case 0x00000000:
// Unencrypted ERK.
// Use the original hash.
memcpy(hash_final, hash, 0x10);
break;
};
}
bool crypto(int hash_mode, int crypto_mode, int version, unsigned char *in, unsigned char *out, int length, unsigned char *key, unsigned char *iv, unsigned char *hash, unsigned char *test_hash)
{
// Setup buffers for key, iv and hash.
unsigned char key_final[0x10] = {};
unsigned char iv_final[0x10] = {};
unsigned char hash_final_10[0x10] = {};
unsigned char hash_final_14[0x14] = {};
// Generate crypto key and hash.
generate_key(crypto_mode, version, key_final, iv_final, key, iv);
if ((hash_mode & 0xFF) == 0x01)
generate_hash(hash_mode, version, hash_final_14, hash);
else
generate_hash(hash_mode, version, hash_final_10, hash);
if ((crypto_mode & 0xFF) == 0x01) // No algorithm.
{
memcpy(out, in, length);
}
else if ((crypto_mode & 0xFF) == 0x02) // AES128-CBC
{
aescbc128_decrypt(key_final, iv_final, in, out, length);
}
else
{
LOG_ERROR(LOADER, "EDAT: Unknown crypto algorithm!\n");
return false;
}
if ((hash_mode & 0xFF) == 0x01) // 0x14 SHA1-HMAC
{
return hmac_hash_compare(hash_final_14, 0x14, in, length, test_hash);
}
else if ((hash_mode & 0xFF) == 0x02) // 0x10 AES-CMAC
{
return cmac_hash_compare(hash_final_10, 0x10, in, length, test_hash);
}
else if ((hash_mode & 0xFF) == 0x04) //0x10 SHA1-HMAC
{
return hmac_hash_compare(hash_final_10, 0x10, in, length, test_hash);
}
else
{
LOG_ERROR(LOADER, "EDAT: Unknown hashing algorithm!\n");
return false;
}
}
unsigned char* dec_section(unsigned char* metadata)
{
unsigned char *dec = new unsigned char[0x10];
dec[0x00] = (metadata[0xC] ^ metadata[0x8] ^ metadata[0x10]);
dec[0x01] = (metadata[0xD] ^ metadata[0x9] ^ metadata[0x11]);
dec[0x02] = (metadata[0xE] ^ metadata[0xA] ^ metadata[0x12]);
dec[0x03] = (metadata[0xF] ^ metadata[0xB] ^ metadata[0x13]);
dec[0x04] = (metadata[0x4] ^ metadata[0x8] ^ metadata[0x14]);
dec[0x05] = (metadata[0x5] ^ metadata[0x9] ^ metadata[0x15]);
dec[0x06] = (metadata[0x6] ^ metadata[0xA] ^ metadata[0x16]);
dec[0x07] = (metadata[0x7] ^ metadata[0xB] ^ metadata[0x17]);
dec[0x08] = (metadata[0xC] ^ metadata[0x0] ^ metadata[0x18]);
dec[0x09] = (metadata[0xD] ^ metadata[0x1] ^ metadata[0x19]);
dec[0x0A] = (metadata[0xE] ^ metadata[0x2] ^ metadata[0x1A]);
dec[0x0B] = (metadata[0xF] ^ metadata[0x3] ^ metadata[0x1B]);
dec[0x0C] = (metadata[0x4] ^ metadata[0x0] ^ metadata[0x1C]);
dec[0x0D] = (metadata[0x5] ^ metadata[0x1] ^ metadata[0x1D]);
dec[0x0E] = (metadata[0x6] ^ metadata[0x2] ^ metadata[0x1E]);
dec[0x0F] = (metadata[0x7] ^ metadata[0x3] ^ metadata[0x1F]);
return dec;
}
unsigned char* get_block_key(int block, NPD_HEADER *npd)
{
unsigned char empty_key[0x10] = {};
unsigned char *src_key = (npd->version <= 1) ? empty_key : npd->dev_hash;
unsigned char *dest_key = new unsigned char[0x10];
memcpy(dest_key, src_key, 0xC);
dest_key[0xC] = (block >> 24 & 0xFF);
dest_key[0xD] = (block >> 16 & 0xFF);
dest_key[0xE] = (block >> 8 & 0xFF);
dest_key[0xF] = (block & 0xFF);
return dest_key;
}
// EDAT/SDAT functions.
int decrypt_data(rFile *in, rFile *out, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd, unsigned char* crypt_key, bool verbose)
{
// Get metadata info and setup buffers.
int block_num = (int) ((edat->file_size + edat->block_size - 1) / edat->block_size);
int metadata_section_size = ((edat->flags & EDAT_COMPRESSED_FLAG) != 0 || (edat->flags & EDAT_FLAG_0x20) != 0) ? 0x20 : 0x10;
int metadata_offset = 0x100;
unsigned char *enc_data;
unsigned char *dec_data;
unsigned char *b_key;
unsigned char *iv;
unsigned char empty_iv[0x10] = {};
// Decrypt the metadata.
for (int i = 0; i < block_num; i++)
{
in->Seek(metadata_offset + i * metadata_section_size);
unsigned char hash_result[0x10];
long offset;
int length = 0;
int compression_end = 0;
if ((edat->flags & EDAT_FLAG_0x3C) != 0 || (edat->flags & EDAT_FLAG_0x3D) != 0)
{
LOG_ERROR(LOADER, "EDAT: Flag 0x3C/0x3D EDAT files are unsupported yet");
return -1;
}
if ((edat->flags & EDAT_COMPRESSED_FLAG) != 0)
{
unsigned char metadata[0x20];
in->Read(metadata, 0x20);
// If the data is compressed, decrypt the metadata.
unsigned char *result = dec_section(metadata);
offset = ((swap32(*(int*)&result[0]) << 4) | (swap32(*(int*)&result[4])));
length = swap32(*(int*)&result[8]);
compression_end = swap32(*(int*)&result[12]);
delete[] result;
memcpy(hash_result, metadata, 0x10);
}
else if ((edat->flags & EDAT_FLAG_0x20) != 0)
{
// If FLAG 0x20, the metadata precedes each data block.
in->Seek(metadata_offset + i * metadata_section_size + length);
unsigned char metadata[0x20];
in->Read(metadata, 0x20);
// If FLAG 0x20 is set, apply custom xor.
for (int j = 0; j < 0x10; j++) {
hash_result[j] = (unsigned char)(metadata[j] ^ metadata[j+0x10]);
}
offset = metadata_offset + i * edat->block_size + (i + 1) * metadata_section_size;
length = edat->block_size;
if ((i == (block_num - 1)) && (edat->file_size % edat->block_size))
length = (int) (edat->file_size % edat->block_size);
}
else
{
in->Read(hash_result, 0x10);
offset = metadata_offset + i * edat->block_size + block_num * metadata_section_size;
length = edat->block_size;
if ((i == (block_num - 1)) && (edat->file_size % edat->block_size))
length = (int) (edat->file_size % edat->block_size);
}
// Locate the real data.
int pad_length = length;
length = (int) ((pad_length + 0xF) & 0xFFFFFFF0);
in->Seek(offset);
// Setup buffers for decryption and read the data.
enc_data = new unsigned char[length];
dec_data = new unsigned char[length];
unsigned char key_result[0x10];
unsigned char hash[0x10];
in->Read(enc_data, length);
// Generate a key for the current block.
b_key = get_block_key(i, npd);
// Encrypt the block key with the crypto key.
aesecb128_encrypt(crypt_key, b_key, key_result);
if ((edat->flags & EDAT_FLAG_0x10) != 0)
aesecb128_encrypt(crypt_key, key_result, hash); // If FLAG 0x10 is set, encrypt again to get the final hash.
else
memcpy(hash, key_result, 0x10);
// Setup the crypto and hashing mode based on the extra flags.
int crypto_mode = ((edat->flags & EDAT_FLAG_0x02) == 0) ? 0x2 : 0x1;
int hash_mode;
if ((edat->flags & EDAT_FLAG_0x10) == 0)
hash_mode = 0x02;
else if ((edat->flags & EDAT_FLAG_0x20) == 0)
hash_mode = 0x04;
else
hash_mode = 0x01;
if ((edat->flags & EDAT_ENCRYPTED_KEY_FLAG) != 0)
{
crypto_mode |= 0x10000000;
hash_mode |= 0x10000000;
}
if ((edat->flags & EDAT_DEBUG_DATA_FLAG) != 0)
{
// Reset the flags.
crypto_mode |= 0x01000000;
hash_mode |= 0x01000000;
// Simply copy the data without the header or the footer.
memcpy(dec_data, enc_data, length);
}
else
{
// IV is null if NPD version is 1 or 0.
iv = (npd->version <= 1) ? empty_iv : npd->digest;
// Call main crypto routine on this data block.
crypto(hash_mode, crypto_mode, (npd->version == 4), enc_data, dec_data, length, key_result, iv, hash, hash_result);
}
// Apply additional compression if needed and write the decrypted data.
if (((edat->flags & EDAT_COMPRESSED_FLAG) != 0) && compression_end)
{
int decomp_size = (int)edat->file_size;
unsigned char *decomp_data = new unsigned char[decomp_size];
memset(decomp_data, 0, decomp_size);
if (verbose)
LOG_NOTICE(LOADER, "EDAT: Decompressing...\n");
int res = lz_decompress(decomp_data, dec_data, decomp_size);
out->Write(decomp_data, res);
if (verbose)
{
LOG_NOTICE(LOADER, "EDAT: Compressed block size: %d\n", pad_length);
LOG_NOTICE(LOADER, "EDAT: Decompressed block size: %d\n", res);
}
edat->file_size -= res;
if (edat->file_size == 0)
{
if (res < 0)
{
LOG_ERROR(LOADER, "EDAT: Decompression failed!\n");
return 1;
}
else
LOG_SUCCESS(LOADER, "EDAT: Data successfully decompressed!\n");
}
delete[] decomp_data;
}
else
{
out->Write(dec_data, pad_length);
}
delete[] enc_data;
delete[] dec_data;
}
return 0;
}
static bool check_flags(EDAT_SDAT_HEADER *edat, NPD_HEADER *npd)
{
if (edat == nullptr || npd == nullptr)
return false;
if (npd->version == 0 || npd->version == 1)
{
if (edat->flags & 0x7EFFFFFE)
{
LOG_ERROR(LOADER, "EDAT: Bad header flags!\n");
return false;
}
}
else if (npd->version == 2)
{
if (edat->flags & 0x7EFFFFE0)
{
LOG_ERROR(LOADER, "EDAT: Bad header flags!\n");
return false;
}
}
else if (npd->version == 3 || npd->version == 4)
{
if (edat->flags & 0x7EFFFFC0)
{
LOG_ERROR(LOADER, "EDAT: Bad header flags!\n");
return false;
}
}
else if (npd->version > 4)
{
LOG_ERROR(LOADER, "EDAT: Unknown version - %d\n", npd->version);
return false;
}
return true;
}
int check_data(unsigned char *key, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd, rFile *f, bool verbose)
{
f->Seek(0);
unsigned char *header = new unsigned char[0xA0];
unsigned char *tmp = new unsigned char[0xA0];
unsigned char *hash_result = new unsigned char[0x10];
// Check NPD version and EDAT flags.
if (!check_flags(edat, npd))
{
delete[] header;
delete[] tmp;
delete[] hash_result;
return 1;
}
// Read in the file header.
f->Read(header, 0xA0);
f->Read(hash_result, 0x10);
// Setup the hashing mode and the crypto mode used in the file.
int crypto_mode = 0x1;
int hash_mode = ((edat->flags & EDAT_ENCRYPTED_KEY_FLAG) == 0) ? 0x00000002 : 0x10000002;
if ((edat->flags & EDAT_DEBUG_DATA_FLAG) != 0)
{
LOG_ERROR(LOADER, "EDAT: DEBUG data detected!\n");
hash_mode |= 0x01000000;
}
// Setup header key and iv buffers.
unsigned char header_key[0x10] = {};
unsigned char header_iv[0x10] = {};
// Test the header hash (located at offset 0xA0).
if (!crypto(hash_mode, crypto_mode, (npd->version == 4), header, tmp, 0xA0, header_key, header_iv, key, hash_result))
{
if (verbose)
LOG_WARNING(LOADER, "EDAT: Header hash is invalid!\n");
}
// Parse the metadata info.
int metadata_section_size = 0x10;
if (((edat->flags & EDAT_COMPRESSED_FLAG) != 0))
{
LOG_WARNING(LOADER, "EDAT: COMPRESSED data detected!\n");
metadata_section_size = 0x20;
}
int block_num = (int) ((edat->file_size + edat->block_size - 1) / edat->block_size);
int bytes_read = 0;
int metadata_offset = 0x100;
long bytes_to_read = metadata_section_size * block_num;
while (bytes_to_read > 0)
{
// Locate the metadata blocks.
int block_size = (0x3C00 > bytes_to_read) ? (int) bytes_to_read : 0x3C00; // 0x3C00 is the maximum block size.
f->Seek(metadata_offset + bytes_read);
unsigned char *data = new unsigned char[block_size];
// Read in the metadata.
tmp = new unsigned char[block_size];
f->Read(data, block_size);
// Check the generated hash against the metadata hash located at offset 0x90 in the header.
memset(hash_result, 0, 0x10);
f->Seek(0x90);
f->Read(hash_result, 0x10);
// Generate the hash for this block.
if (!crypto(hash_mode, crypto_mode, (npd->version == 4), data, tmp, block_size, header_key, header_iv, key, hash_result))
{
if (verbose)
LOG_WARNING(LOADER, "EDAT: Metadata hash from block 0x%08x is invalid!\n", metadata_offset + bytes_read);
}
// Adjust sizes.
bytes_read += block_size;
bytes_to_read -= block_size;
delete[] data;
}
// Cleanup.
delete[] header;
delete[] tmp;
delete[] hash_result;
return 0;
}
void validate_data(const char* file_name, unsigned char *klicensee, NPD_HEADER *npd, bool verbose)
{
int title_hash_result = 0;
int dev_hash_result = 0;
int file_name_length = strlen(file_name);
unsigned char *buf = new unsigned char[0x30 + file_name_length];
unsigned char key[0x10];
// Build the buffer (content_id + file_name).
memcpy(buf, npd->content_id, 0x30);
memcpy(buf + 0x30, file_name, file_name_length);
// Hash with NP_OMAC_KEY_3 and compare with title_hash.
title_hash_result = cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf, 0x30 + file_name_length, npd->title_hash);
if (verbose)
{
if (title_hash_result)
LOG_SUCCESS(LOADER, "EDAT: NPD title hash is valid!\n");
else
LOG_WARNING(LOADER, "EDAT: NPD title hash is invalid!\n");
}
// Check for an empty dev_hash (can't validate if devklic is NULL);
bool isDevklicEmpty = true;
for (int i = 0; i < 0x10; i++)
{
if (klicensee[i] != 0)
{
isDevklicEmpty = false;
break;
}
}
if (isDevklicEmpty)
{
if (verbose)
LOG_WARNING(LOADER, "EDAT: NPD dev hash is empty!\n");
}
else
{
// Generate klicensee xor key.
xor_(key, klicensee, NP_OMAC_KEY_2, 0x10);
// Hash with generated key and compare with dev_hash.
dev_hash_result = cmac_hash_compare(key, 0x10, (unsigned char *)npd, 0x60, npd->dev_hash);
if (verbose)
{
if (dev_hash_result)
LOG_SUCCESS(LOADER, "EDAT: NPD dev hash is valid!\n");
else
LOG_WARNING(LOADER, "EDAT: NPD dev hash is invalid!\n");
}
}
delete[] buf;
}
bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsigned char* devklic, unsigned char* rifkey, bool verbose)
{
// Setup NPD and EDAT/SDAT structs.
NPD_HEADER *NPD = new NPD_HEADER();
EDAT_SDAT_HEADER *EDAT = new EDAT_SDAT_HEADER();
// Read in the NPD and EDAT/SDAT headers.
char npd_header[0x80];
char edat_header[0x10];
input->Read(npd_header, 0x80);
input->Read(edat_header, 0x10);
memcpy(NPD->magic, npd_header, 4);
NPD->version = swap32(*(int*)&npd_header[4]);
NPD->license = swap32(*(int*)&npd_header[8]);
NPD->type = swap32(*(int*)&npd_header[12]);
memcpy(NPD->content_id, (unsigned char*)&npd_header[16], 0x30);
memcpy(NPD->digest, (unsigned char*)&npd_header[64], 0x10);
memcpy(NPD->title_hash, (unsigned char*)&npd_header[80], 0x10);
memcpy(NPD->dev_hash, (unsigned char*)&npd_header[96], 0x10);
NPD->unk1 = swap64(*(u64*)&npd_header[112]);
NPD->unk2 = swap64(*(u64*)&npd_header[120]);
unsigned char npd_magic[4] = {0x4E, 0x50, 0x44, 0x00}; //NPD0
if(memcmp(NPD->magic, npd_magic, 4))
{
LOG_ERROR(LOADER, "EDAT: File has invalid NPD header.");
delete NPD;
delete EDAT;
return 1;
}
EDAT->flags = swap32(*(int*)&edat_header[0]);
EDAT->block_size = swap32(*(int*)&edat_header[4]);
EDAT->file_size = swap64(*(u64*)&edat_header[8]);
if (verbose)
{
LOG_NOTICE(LOADER, "NPD HEADER\n");
LOG_NOTICE(LOADER, "NPD version: %d\n", NPD->version);
LOG_NOTICE(LOADER, "NPD license: %d\n", NPD->license);
LOG_NOTICE(LOADER, "NPD type: %d\n", NPD->type);
LOG_NOTICE(LOADER, "\n");
LOG_NOTICE(LOADER, "EDAT HEADER\n");
LOG_NOTICE(LOADER, "EDAT flags: 0x%08X\n", EDAT->flags);
LOG_NOTICE(LOADER, "EDAT block size: 0x%08X\n", EDAT->block_size);
LOG_NOTICE(LOADER, "EDAT file size: 0x%08X\n", EDAT->file_size);
LOG_NOTICE(LOADER, "\n");
}
// Set decryption key.
unsigned char key[0x10];
memset(key, 0, 0x10);
if((EDAT->flags & SDAT_FLAG) == SDAT_FLAG)
{
LOG_WARNING(LOADER, "EDAT: SDAT detected!\n");
xor_(key, NPD->dev_hash, SDAT_KEY, 0x10);
}
else
{
// Perform header validation (optional step).
validate_data(input_file_name, devklic, NPD, verbose);
if ((NPD->license & 0x3) == 0x3) // Type 3: Use supplied devklic.
memcpy(key, devklic, 0x10);
else if ((NPD->license & 0x2) == 0x2) // Type 2: Use key from RAP file (RIF key).
{
memcpy(key, rifkey, 0x10);
// Make sure we don't have an empty RIF key.
int i, test = 0;
for(i = 0; i < 0x10; i++)
{
if (key[i] != 0)
{
test = 1;
break;
}
}
if (!test)
{
LOG_ERROR(LOADER, "EDAT: A valid RAP file is needed!");
delete NPD;
delete EDAT;
return 1;
}
}
}
LOG_NOTICE(LOADER, "EDAT: Parsing data...\n");
if (check_data(key, EDAT, NPD, input, verbose))
LOG_ERROR(LOADER, "EDAT: Data parsing failed!\n");
else
LOG_SUCCESS(LOADER, "EDAT: Data successfully parsed!\n");
printf("\n");
LOG_NOTICE(LOADER, "EDAT: Decrypting data...\n");
if (decrypt_data(input, output, EDAT, NPD, key, verbose))
LOG_ERROR(LOADER, "EDAT: Data decryption failed!");
else
LOG_SUCCESS(LOADER, "EDAT: Data successfully decrypted!");
delete NPD;
delete EDAT;
return 0;
}
int DecryptEDAT(const std::string& input_file_name, const std::string& output_file_name, int mode, const std::string& rap_file_name, unsigned char *custom_klic, bool verbose)
{
// Prepare the files.
rFile input(input_file_name.c_str());
rFile output(output_file_name.c_str(), rFile::write);
rFile rap(rap_file_name.c_str());
// Set keys (RIF and DEVKLIC).
unsigned char rifkey[0x10];
unsigned char devklic[0x10];
memset(rifkey, 0, 0x10);
memset(devklic, 0, 0x10);
// Select the EDAT key mode.
switch (mode)
{
case 0:
break;
case 1:
memcpy(devklic, NP_KLIC_FREE, 0x10);
break;
case 2:
memcpy(devklic, NP_OMAC_KEY_2, 0x10);
break;
case 3:
memcpy(devklic, NP_OMAC_KEY_3, 0x10);
break;
case 4:
memcpy(devklic, NP_KLIC_KEY, 0x10);
break;
case 5:
memcpy(devklic, NP_PSX_KEY, 0x10);
break;
case 6:
memcpy(devklic, NP_PSP_KEY_1, 0x10);
break;
case 7:
memcpy(devklic, NP_PSP_KEY_2, 0x10);
break;
case 8:
{
if (custom_klic != NULL)
memcpy(devklic, custom_klic, 0x10);
else
{
LOG_ERROR(LOADER, "EDAT: Invalid custom klic!\n");
return -1;
}
break;
}
default:
LOG_ERROR(LOADER, "EDAT: Invalid mode!\n");
return -1;
}
// Check the input/output files.
if (!input.IsOpened() || !output.IsOpened())
{
LOG_ERROR(LOADER, "EDAT: Failed to open files!\n");
return -1;
}
// Read the RAP file, if provided.
if (rap.IsOpened())
{
unsigned char rapkey[0x10];
memset(rapkey, 0, 0x10);
rap.Read(rapkey, 0x10);
rap_to_rif(rapkey, rifkey);
rap.Close();
}
// Delete the bad output file if any errors arise.
if (extract_data(&input, &output, input_file_name.c_str(), devklic, rifkey, verbose))
{
input.Close();
output.Close();
rRemoveFile(output_file_name);
return 0;
}
// Cleanup.
input.Close();
output.Close();
return 0;
}
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include "utils.h"
#include "key_vault.h"
#define SDAT_FLAG 0x01000000
#define EDAT_COMPRESSED_FLAG 0x00000001
#define EDAT_FLAG_0x02 0x00000002
#define EDAT_ENCRYPTED_KEY_FLAG 0x00000008
#define EDAT_FLAG_0x10 0x00000010
#define EDAT_FLAG_0x20 0x00000020
#define EDAT_DEBUG_DATA_FLAG 0x80000000
#define EDAT_FLAG_0x3C 0x0000003C
#define EDAT_FLAG_0x3D 0x0000003D
typedef struct
{
unsigned char magic[4];
int version;
int license;
int type;
unsigned char content_id[0x30];
unsigned char digest[0x10];
unsigned char title_hash[0x10];
unsigned char dev_hash[0x10];
unsigned long long unk1;
unsigned long long unk2;
} NPD_HEADER;
typedef struct
{
int flags;
int block_size;
unsigned long long file_size;
} EDAT_SDAT_HEADER;
int DecryptEDAT(const std::string& input_file_name, const std::string& output_file_name, int mode, const std::string& rap_file_name, unsigned char *custom_klic, bool verbose);
+224
View File
@@ -0,0 +1,224 @@
#include "stdafx.h"
#include "unpkg.h"
#include <wx/progdlg.h>
#include "Utilities/Log.h"
// Decryption.
bool CheckHeader(rFile& pkg_f, PKGHeader* m_header)
{
if (m_header->pkg_magic != 0x7F504B47) {
LOG_ERROR(LOADER, "PKG: Not a package file!");
return false;
}
switch ((u32)m_header->pkg_type)
{
case PKG_RELEASE_TYPE_DEBUG: break;
case PKG_RELEASE_TYPE_RELEASE: break;
default:
LOG_ERROR(LOADER, "PKG: Unknown PKG type!");
return false;
}
switch ((u32)m_header->pkg_platform)
{
case PKG_PLATFORM_TYPE_PS3: break;
case PKG_PLATFORM_TYPE_PSP: break;
default:
LOG_ERROR(LOADER, "PKG: Unknown PKG type!");
return false;
}
if (m_header->header_size != PKG_HEADER_SIZE) {
LOG_ERROR(LOADER, "PKG: Wrong header size!");
return false;
}
if (m_header->pkg_size != pkg_f.Length()) {
LOG_ERROR(LOADER, "PKG: File size mismatch.");
return false;
}
if (m_header->data_size + m_header->data_offset + 0x60 != pkg_f.Length()) {
LOG_ERROR(LOADER, "PKG: Data size mismatch.");
return false;
}
return true;
}
bool LoadHeader(rFile& pkg_f, PKGHeader* m_header)
{
pkg_f.Seek(0);
if (pkg_f.Read(m_header, sizeof(PKGHeader)) != sizeof(PKGHeader)) {
LOG_ERROR(LOADER, "PKG: Package file is too short!");
return false;
}
if (!CheckHeader(pkg_f, m_header))
return false;
return true;
}
int Decrypt(rFile& pkg_f, rFile& dec_pkg_f, PKGHeader* m_header)
{
if (!LoadHeader(pkg_f, m_header))
return -1;
aes_context c;
u8 iv[HASH_LEN];
u8 buf[BUF_SIZE];
u8 ctr[BUF_SIZE];
// Debug key
u8 key[0x40];
memset(key, 0, 0x40);
memcpy(key+0x00, &m_header->qa_digest[0], 8); // &data[0x60]
memcpy(key+0x08, &m_header->qa_digest[0], 8); // &data[0x60]
memcpy(key+0x10, &m_header->qa_digest[8], 8); // &data[0x68]
memcpy(key+0x18, &m_header->qa_digest[8], 8); // &data[0x68]
pkg_f.Seek(m_header->data_offset);
u32 parts = (m_header->data_size + BUF_SIZE - 1) / BUF_SIZE;
wxProgressDialog pdlg("PKG Decrypter / Installer", "Please wait, decrypting...", parts, 0, wxPD_AUTO_HIDE | wxPD_APP_MODAL);
memcpy(iv, m_header->klicensee, sizeof(iv));
aes_setkey_enc(&c, PKG_AES_KEY, 128);
for (u32 i=0; i<parts; i++)
{
memset(buf, 0, sizeof(buf));
u32 length = pkg_f.Read(buf, BUF_SIZE);
u32 bits = (length + HASH_LEN - 1) / HASH_LEN;
if (m_header->pkg_type == PKG_RELEASE_TYPE_DEBUG)
{
for (u32 j=0; j<bits; j++)
{
u8 hash[0x14];
sha1(key, 0x40, hash);
*(u64*)&buf[j*HASH_LEN + 0] ^= *(u64*)&hash[0];
*(u64*)&buf[j*HASH_LEN + 8] ^= *(u64*)&hash[8];
*(be_t<u64>*)&key[0x38] += 1;
}
}
if (m_header->pkg_type == PKG_RELEASE_TYPE_RELEASE)
{
for (u32 j=0; j<bits; j++)
{
aes_crypt_ecb(&c, AES_ENCRYPT, iv, ctr+j*HASH_LEN);
be_t<u64> hi = *(be_t<u64>*)&iv[0];
be_t<u64> lo = *(be_t<u64>*)&iv[8] + 1;
if (lo == 0)
hi += 1;
*(be_t<u64>*)&iv[0] = hi;
*(be_t<u64>*)&iv[8] = lo;
}
for (u32 j=0; j<length; j++) {
buf[j] ^= ctr[j];
}
}
dec_pkg_f.Write(buf, length);
pdlg.Update(i);
}
pdlg.Update(parts);
return 0;
}
// Unpacking.
bool LoadEntries(rFile& dec_pkg_f, PKGHeader* m_header, PKGEntry *m_entries)
{
dec_pkg_f.Seek(0);
dec_pkg_f.Read(m_entries, sizeof(PKGEntry) * m_header->file_count);
if (m_entries->name_offset / sizeof(PKGEntry) != m_header->file_count) {
LOG_ERROR(LOADER, "PKG: Entries are damaged!");
return false;
}
return true;
}
bool UnpackEntry(rFile& dec_pkg_f, const PKGEntry& entry, std::string dir)
{
u8 buf[BUF_SIZE];
dec_pkg_f.Seek(entry.name_offset);
dec_pkg_f.Read(buf, entry.name_size);
buf[entry.name_size] = 0;
switch (entry.type & (0xff))
{
case PKG_FILE_ENTRY_NPDRM:
case PKG_FILE_ENTRY_NPDRMEDAT:
case PKG_FILE_ENTRY_SDAT:
case PKG_FILE_ENTRY_REGULAR:
{
rFile out;
out.Create(dir + std::string(reinterpret_cast<char *>(buf), entry.name_size));
dec_pkg_f.Seek(entry.file_offset);
for (u64 size = 0; size < entry.file_size; ) {
size += dec_pkg_f.Read(buf, BUF_SIZE);
if (size > entry.file_size)
out.Write(buf, BUF_SIZE - (size - entry.file_size));
else
out.Write(buf, BUF_SIZE);
}
out.Close();
}
break;
case PKG_FILE_ENTRY_FOLDER:
rMkdir(dir + std::string(reinterpret_cast<char *>(buf), entry.name_size));
break;
}
return true;
}
int Unpack(rFile& pkg_f, std::string src, std::string dst)
{
PKGHeader* m_header = (PKGHeader*) malloc (sizeof(PKGHeader));
rFile dec_pkg_f;
std::string decryptedFile = rGetCwd() + "/dev_hdd1/" + src + ".dec";
dec_pkg_f.Create(decryptedFile, true);
if (Decrypt(pkg_f, dec_pkg_f, m_header) < 0)
return -1;
dec_pkg_f.Close();
rFile n_dec_pkg_f(decryptedFile, rFile::read);
std::vector<PKGEntry> m_entries;
m_entries.resize(m_header->file_count);
PKGEntry *m_entries_ptr = &m_entries[0];
if (!LoadEntries(n_dec_pkg_f, m_header, m_entries_ptr))
return -1;
wxProgressDialog pdlg("PKG Decrypter / Installer", "Please wait, unpacking...", m_entries.size(), 0, wxPD_AUTO_HIDE | wxPD_APP_MODAL);
for (const PKGEntry& entry : m_entries)
{
UnpackEntry(n_dec_pkg_f, entry, dst + src + "/");
pdlg.Update(pdlg.GetValue() + 1);
}
pdlg.Update(m_entries.size());
n_dec_pkg_f.Close();
wxRemoveFile(decryptedFile);
return 0;
}
+50
View File
@@ -0,0 +1,50 @@
#pragma once
#include "utils.h"
#include "key_vault.h"
// Constants
#define PKG_HEADER_SIZE 0xC0 //sizeof(pkg_header) + sizeof(pkg_unk_checksum)
#define PKG_RELEASE_TYPE_RELEASE 0x8000
#define PKG_RELEASE_TYPE_DEBUG 0x0000
#define PKG_PLATFORM_TYPE_PS3 0x0001
#define PKG_PLATFORM_TYPE_PSP 0x0002
#define PKG_FILE_ENTRY_NPDRM 0x0001
#define PKG_FILE_ENTRY_NPDRMEDAT 0x0002
#define PKG_FILE_ENTRY_REGULAR 0x0003
#define PKG_FILE_ENTRY_FOLDER 0x0004
#define PKG_FILE_ENTRY_SDAT 0x0009
#define PKG_FILE_ENTRY_OVERWRITE 0x80000000
#define HASH_LEN 16
#define BUF_SIZE 4096
// Structs
struct PKGHeader
{
be_t<u32> pkg_magic; // Magic (0x7f504b47)
be_t<u16> pkg_type; // Release type (Retail:0x8000, Debug:0x0000)
be_t<u16> pkg_platform; // Platform type (PS3:0x0001, PSP:0x0002)
be_t<u32> header_size; // Header size (0xc0)
be_t<u32> unk1; // Some PKG version maybe?
be_t<u32> meta_size; // Size of metadata (block after header & hashes)
be_t<u32> file_count; // Number of files
be_t<u64> pkg_size; // PKG size in bytes
be_t<u64> data_offset; // Encrypted data offset
be_t<u64> data_size; // Encrypted data size in bytes
char title_id[48]; // Title ID
u8 qa_digest[16]; // This should be the hash of "files + attribs"
u8 klicensee[16]; // Nonce
};
struct PKGEntry
{
be_t<u32> name_offset; // File name offset
be_t<u32> name_size; // File name size
be_t<u64> file_offset; // File offset
be_t<u64> file_size; // File size
be_t<u32> type; // File type
be_t<u32> pad; // Padding (zeros)
};
extern int Unpack(rFile& dec_pkg_f, std::string src, std::string dst);
+670
View File
@@ -0,0 +1,670 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/FS/vfsLocalFile.h"
#include "unself.h"
SELFDecrypter::SELFDecrypter(vfsStream& s)
: self_f(s), key_v(), data_buf_length(0)
{
}
bool SELFDecrypter::LoadHeaders(bool isElf32)
{
// Read SCE header.
self_f.Seek(0);
sce_hdr.Load(self_f);
// Check SCE magic.
if (!sce_hdr.CheckMagic())
{
LOG_ERROR(LOADER, "SELF: Not a SELF file!");
return false;
}
// Read SELF header.
self_hdr.Load(self_f);
// Read the APP INFO.
self_f.Seek(self_hdr.se_appinfooff);
app_info.Load(self_f);
// Read ELF header.
self_f.Seek(self_hdr.se_elfoff);
if (isElf32)
elf32_hdr.Load(self_f);
else
elf64_hdr.Load(self_f);
// Read ELF program headers.
if (isElf32)
{
phdr32_arr.clear();
if(elf32_hdr.e_phoff == 0 && elf32_hdr.e_phnum)
{
LOG_ERROR(LOADER, "SELF: ELF program header offset is null!");
return false;
}
self_f.Seek(self_hdr.se_phdroff);
for(u32 i = 0; i < elf32_hdr.e_phnum; ++i)
{
phdr32_arr.emplace_back();
phdr32_arr.back().Load(self_f);
}
}
else
{
phdr64_arr.clear();
if(elf64_hdr.e_phoff == 0 && elf64_hdr.e_phnum)
{
LOG_ERROR(LOADER, "SELF: ELF program header offset is null!");
return false;
}
self_f.Seek(self_hdr.se_phdroff);
for(u32 i = 0; i < elf64_hdr.e_phnum; ++i)
{
phdr64_arr.emplace_back();
phdr64_arr.back().Load(self_f);
}
}
// Read section info.
secinfo_arr.clear();
self_f.Seek(self_hdr.se_secinfoff);
for(u32 i = 0; i < ((isElf32) ? elf32_hdr.e_phnum : elf64_hdr.e_phnum); ++i)
{
secinfo_arr.emplace_back();
secinfo_arr.back().Load(self_f);
}
// Read SCE version info.
self_f.Seek(self_hdr.se_sceveroff);
scev_info.Load(self_f);
// Read control info.
ctrlinfo_arr.clear();
self_f.Seek(self_hdr.se_controloff);
u32 i = 0;
while(i < self_hdr.se_controlsize)
{
ctrlinfo_arr.emplace_back();
ControlInfo &cinfo = ctrlinfo_arr.back();
cinfo.Load(self_f);
i += cinfo.size;
}
// Read ELF section headers.
if (isElf32)
{
shdr32_arr.clear();
if(elf32_hdr.e_shoff == 0 && elf32_hdr.e_shnum)
{
LOG_WARNING(LOADER, "SELF: ELF section header offset is null!");
return true;
}
self_f.Seek(self_hdr.se_shdroff);
for(u32 i = 0; i < elf32_hdr.e_shnum; ++i)
{
shdr32_arr.emplace_back();
shdr32_arr.back().Load(self_f);
}
}
else
{
shdr64_arr.clear();
if(elf64_hdr.e_shoff == 0 && elf64_hdr.e_shnum)
{
LOG_WARNING(LOADER, "SELF: ELF section header offset is null!");
return true;
}
self_f.Seek(self_hdr.se_shdroff);
for(u32 i = 0; i < elf64_hdr.e_shnum; ++i)
{
shdr64_arr.emplace_back();
shdr64_arr.back().Load(self_f);
}
}
return true;
}
void SELFDecrypter::ShowHeaders(bool isElf32)
{
LOG_NOTICE(LOADER, "SCE header");
LOG_NOTICE(LOADER, "----------------------------------------------------");
sce_hdr.Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "SELF header");
LOG_NOTICE(LOADER, "----------------------------------------------------");
self_hdr.Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "APP INFO");
LOG_NOTICE(LOADER, "----------------------------------------------------");
app_info.Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "ELF header");
LOG_NOTICE(LOADER, "----------------------------------------------------");
isElf32 ? elf32_hdr.Show() : elf64_hdr.Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "ELF program headers");
LOG_NOTICE(LOADER, "----------------------------------------------------");
for(unsigned int i = 0; i < ((isElf32) ? phdr32_arr.size() : phdr64_arr.size()); i++)
isElf32 ? phdr32_arr[i].Show() : phdr64_arr[i].Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "Section info");
LOG_NOTICE(LOADER, "----------------------------------------------------");
for(unsigned int i = 0; i < secinfo_arr.size(); i++)
secinfo_arr[i].Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "SCE version info");
LOG_NOTICE(LOADER, "----------------------------------------------------");
scev_info.Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "Control info");
LOG_NOTICE(LOADER, "----------------------------------------------------");
for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++)
ctrlinfo_arr[i].Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
LOG_NOTICE(LOADER, "ELF section headers");
LOG_NOTICE(LOADER, "----------------------------------------------------");
for(unsigned int i = 0; i < ((isElf32) ? shdr32_arr.size() : shdr64_arr.size()); i++)
isElf32 ? shdr32_arr[i].Show() : shdr64_arr[i].Show();
LOG_NOTICE(LOADER, "----------------------------------------------------");
}
bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
{
aes_context aes;
ControlInfo *ctrl = NULL;
u8 npdrm_key[0x10];
u8 npdrm_iv[0x10];
// Parse the control info structures to find the NPDRM control info.
for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++)
{
if (ctrlinfo_arr[i].type == 3)
{
ctrl = &ctrlinfo_arr[i];
break;
}
}
// Check if we have a valid NPDRM control info structure.
// If not, the data has no NPDRM layer.
if (!ctrl)
{
LOG_WARNING(LOADER, "SELF: No NPDRM control info found!");
return true;
}
u8 klicensee_key[0x10];
memcpy(klicensee_key, key_v.GetKlicenseeKey(), 0x10);
// Use klicensee if available.
if (klicensee_key != NULL)
memcpy(npdrm_key, klicensee_key, 0x10);
if (ctrl->npdrm.license == 1) // Network license.
{
LOG_ERROR(LOADER, "SELF: Can't decrypt network NPDRM!");
return false;
}
else if (ctrl->npdrm.license == 2) // Local license.
{
// Try to find a RAP file to get the key.
if (!GetKeyFromRap(ctrl->npdrm.content_id, npdrm_key))
{
LOG_ERROR(LOADER, "SELF: Can't find RAP file for NPDRM decryption!");
return false;
}
}
else if (ctrl->npdrm.license == 3) // Free license.
{
// Use the NP_KLIC_FREE.
memcpy(npdrm_key, NP_KLIC_FREE, 0x10);
}
else
{
LOG_ERROR(LOADER, "SELF: Invalid NPDRM license type!");
return false;
}
// Decrypt our key with NP_KLIC_KEY.
aes_setkey_dec(&aes, NP_KLIC_KEY, 128);
aes_crypt_ecb(&aes, AES_DECRYPT, npdrm_key, npdrm_key);
// IV is empty.
memset(npdrm_iv, 0, 0x10);
// Use our final key to decrypt the NPDRM layer.
aes_setkey_dec(&aes, npdrm_key, 128);
aes_crypt_cbc(&aes, AES_DECRYPT, metadata_size, npdrm_iv, metadata, metadata);
return true;
}
bool SELFDecrypter::LoadMetadata()
{
aes_context aes;
u32 metadata_info_size = sizeof(meta_info);
u8 *metadata_info = (u8 *)malloc(metadata_info_size);
u32 metadata_headers_size = sce_hdr.se_hsize - (sizeof(sce_hdr) + sce_hdr.se_meta + sizeof(meta_info));
u8 *metadata_headers = (u8 *)malloc(metadata_headers_size);
// Locate and read the encrypted metadata info.
self_f.Seek(sce_hdr.se_meta + sizeof(sce_hdr));
self_f.Read(metadata_info, metadata_info_size);
// Locate and read the encrypted metadata header and section header.
self_f.Seek(sce_hdr.se_meta + sizeof(sce_hdr) + metadata_info_size);
self_f.Read(metadata_headers, metadata_headers_size);
// Find the right keyset from the key vault.
SELF_KEY keyset = key_v.FindSelfKey(app_info.self_type, sce_hdr.se_flags, app_info.version);
// Copy the necessary parameters.
u8 metadata_key[0x20];
u8 metadata_iv[0x10];
memcpy(metadata_key, keyset.erk, 0x20);
memcpy(metadata_iv, keyset.riv, 0x10);
// Check DEBUG flag.
if ((sce_hdr.se_flags & 0x8000) != 0x8000)
{
// Decrypt the NPDRM layer.
if (!DecryptNPDRM(metadata_info, metadata_info_size))
return false;
// Decrypt the metadata info.
aes_setkey_dec(&aes, metadata_key, 256); // AES-256
aes_crypt_cbc(&aes, AES_DECRYPT, metadata_info_size, metadata_iv, metadata_info, metadata_info);
}
// Load the metadata info.
meta_info.Load(metadata_info);
// If the padding is not NULL for the key or iv fields, the metadata info
// is not properly decrypted.
if ((meta_info.key_pad[0] != 0x00) ||
(meta_info.iv_pad[0] != 0x00))
{
LOG_ERROR(LOADER, "SELF: Failed to decrypt metadata info!");
return false;
}
// Perform AES-CTR encryption on the metadata headers.
size_t ctr_nc_off = 0;
u8 ctr_stream_block[0x10];
aes_setkey_enc(&aes, meta_info.key, 128);
aes_crypt_ctr(&aes, metadata_headers_size, &ctr_nc_off, meta_info.iv, ctr_stream_block, metadata_headers, metadata_headers);
// Load the metadata header.
meta_hdr.Load(metadata_headers);
// Load the metadata section headers.
meta_shdr.clear();
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
meta_shdr.emplace_back();
meta_shdr.back().Load(metadata_headers + sizeof(meta_hdr) + sizeof(MetadataSectionHeader) * i);
}
// Copy the decrypted data keys.
data_keys_length = meta_hdr.key_count * 0x10;
data_keys = (u8 *) malloc (data_keys_length);
memcpy(data_keys, metadata_headers + sizeof(meta_hdr) + meta_hdr.section_count * sizeof(MetadataSectionHeader), data_keys_length);
return true;
}
bool SELFDecrypter::DecryptData()
{
aes_context aes;
// Calculate the total data size.
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
if (meta_shdr[i].encrypted == 3)
{
if ((meta_shdr[i].key_idx <= meta_hdr.key_count - 1) && (meta_shdr[i].iv_idx <= meta_hdr.key_count))
data_buf_length += meta_shdr[i].data_size;
}
}
// Allocate a buffer to store decrypted data.
data_buf = (u8*)malloc(data_buf_length);
// Set initial offset.
u32 data_buf_offset = 0;
// Parse the metadata section headers to find the offsets of encrypted data.
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
size_t ctr_nc_off = 0;
u8 ctr_stream_block[0x10];
u8 data_key[0x10];
u8 data_iv[0x10];
// Check if this is an encrypted section.
if (meta_shdr[i].encrypted == 3)
{
// Make sure the key and iv are not out of boundaries.
if((meta_shdr[i].key_idx <= meta_hdr.key_count - 1) && (meta_shdr[i].iv_idx <= meta_hdr.key_count))
{
// Get the key and iv from the previously stored key buffer.
memcpy(data_key, data_keys + meta_shdr[i].key_idx * 0x10, 0x10);
memcpy(data_iv, data_keys + meta_shdr[i].iv_idx * 0x10, 0x10);
// Allocate a buffer to hold the data.
u8 *buf = (u8 *)malloc(meta_shdr[i].data_size);
// Seek to the section data offset and read the encrypted data.
self_f.Seek(meta_shdr[i].data_offset);
self_f.Read(buf, meta_shdr[i].data_size);
// Zero out our ctr nonce.
memset(ctr_stream_block, 0, sizeof(ctr_stream_block));
// Perform AES-CTR encryption on the data blocks.
aes_setkey_enc(&aes, data_key, 128);
aes_crypt_ctr(&aes, meta_shdr[i].data_size, &ctr_nc_off, data_iv, ctr_stream_block, buf, buf);
// Copy the decrypted data.
memcpy(data_buf + data_buf_offset, buf, meta_shdr[i].data_size);
// Advance the buffer's offset.
data_buf_offset += meta_shdr[i].data_size;
// Release the temporary buffer.
free(buf);
}
}
}
return true;
}
bool SELFDecrypter::MakeElf(const std::string& elf, bool isElf32)
{
// Create a new ELF file.
rFile e(elf.c_str(), rFile::write);
if(!e.IsOpened())
{
LOG_ERROR(LOADER, "Could not create ELF file! (%s)", elf.c_str());
return false;
}
// Set initial offset.
u32 data_buf_offset = 0;
if (isElf32)
{
// Write ELF header.
WriteEhdr(e, elf32_hdr);
// Write program headers.
for(u32 i = 0; i < elf32_hdr.e_phnum; ++i)
WritePhdr(e, phdr32_arr[i]);
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
// PHDR type.
if (meta_shdr[i].type == 2)
{
// Seek to the program header data offset and write the data.
e.Seek(phdr32_arr[meta_shdr[i].program_idx].p_offset);
e.Write(data_buf + data_buf_offset, meta_shdr[i].data_size);
// Advance the data buffer offset by data size.
data_buf_offset += meta_shdr[i].data_size;
}
}
// Write section headers.
if(self_hdr.se_shdroff != 0)
{
e.Seek(elf32_hdr.e_shoff);
for(u32 i = 0; i < elf32_hdr.e_shnum; ++i)
WriteShdr(e, shdr32_arr[i]);
}
}
else
{
// Write ELF header.
WriteEhdr(e, elf64_hdr);
// Write program headers.
for(u32 i = 0; i < elf64_hdr.e_phnum; ++i)
WritePhdr(e, phdr64_arr[i]);
// Write data.
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
// PHDR type.
if (meta_shdr[i].type == 2)
{
// Decompress if necessary.
if (meta_shdr[i].compressed == 2)
{
// Allocate a buffer for decompression.
u8 *decomp_buf = (u8 *)malloc(phdr64_arr[meta_shdr[i].program_idx].p_filesz);
// Set up memory streams for input/output.
wxMemoryInputStream decomp_stream_in(data_buf + data_buf_offset, meta_shdr[i].data_size);
wxMemoryOutputStream decomp_stream_out;
// Create a Zlib stream, read the data and flush the stream.
wxZlibInputStream* z_stream = new wxZlibInputStream(decomp_stream_in);
z_stream->Read(decomp_stream_out);
delete z_stream;
// Copy the decompressed result from the stream.
decomp_stream_out.CopyTo(decomp_buf, phdr64_arr[meta_shdr[i].program_idx].p_filesz);
// Seek to the program header data offset and write the data.
e.Seek(phdr64_arr[meta_shdr[i].program_idx].p_offset);
e.Write(decomp_buf, phdr64_arr[meta_shdr[i].program_idx].p_filesz);
// Release the decompression buffer.
free(decomp_buf);
}
else
{
// Seek to the program header data offset and write the data.
e.Seek(phdr64_arr[meta_shdr[i].program_idx].p_offset);
e.Write(data_buf + data_buf_offset, meta_shdr[i].data_size);
}
// Advance the data buffer offset by data size.
data_buf_offset += meta_shdr[i].data_size;
}
}
// Write section headers.
if(self_hdr.se_shdroff != 0)
{
e.Seek(elf64_hdr.e_shoff);
for(u32 i = 0; i < elf64_hdr.e_shnum; ++i)
WriteShdr(e, shdr64_arr[i]);
}
}
e.Close();
return true;
}
bool SELFDecrypter::GetKeyFromRap(u8 *content_id, u8 *npdrm_key)
{
// Set empty RAP key.
u8 rap_key[0x10];
memset(rap_key, 0, 0x10);
// Try to find a matching RAP file under dev_usb000.
std::string ci_str((const char *)content_id);
std::string rap_path(rGetCwd() + "/dev_usb000/" + ci_str + ".rap");
// Check if we have a valid RAP file.
if (!rFile::Exists(rap_path))
{
LOG_ERROR(LOADER, "This application requires a valid RAP file for decryption!");
return false;
}
// Open the RAP file and read the key.
rFile rap_file(rap_path, rFile::read);
if (!rap_file.IsOpened())
{
LOG_ERROR(LOADER, "Failed to load RAP file!");
return false;
}
LOG_NOTICE(LOADER, "Loading RAP file %s", (ci_str + ".rap").c_str());
rap_file.Read(rap_key, 0x10);
rap_file.Close();
// Convert the RAP key.
rap_to_rif(rap_key, npdrm_key);
return true;
}
bool IsSelf(const std::string& path)
{
vfsLocalFile f(nullptr);
if(!f.Open(path))
return false;
SceHeader hdr;
hdr.Load(f);
return hdr.CheckMagic();
}
bool IsSelfElf32(const std::string& path)
{
vfsLocalFile f(nullptr);
if(!f.Open(path))
return false;
SceHeader hdr;
SelfHeader sh;
hdr.Load(f);
sh.Load(f);
// Locate the class byte and check it.
u8 elf_class[0x8];
f.Seek(sh.se_elfoff);
f.Read(elf_class, 0x8);
return (elf_class[4] == 1);
}
bool CheckDebugSelf(const std::string& self, const std::string& elf)
{
// Open the SELF file.
rFile s(self);
if(!s.IsOpened())
{
LOG_ERROR(LOADER, "Could not open SELF file! (%s)", self.c_str());
return false;
}
// Get the key version.
s.Seek(0x08);
u16 key_version;
s.Read(&key_version, sizeof(key_version));
// Check for DEBUG version.
if(swap16(key_version) == 0x8000)
{
LOG_WARNING(LOADER, "Debug SELF detected! Removing fake header...");
// Get the real elf offset.
s.Seek(0x10);
u64 elf_offset;
s.Read(&elf_offset, sizeof(elf_offset));
// Start at the real elf offset.
elf_offset = swap64(elf_offset);
s.Seek(elf_offset);
// Write the real ELF file back.
rFile e(elf, rFile::write);
if(!e.IsOpened())
{
LOG_ERROR(LOADER, "Could not create ELF file! (%s)", elf.c_str());
return false;
}
// Copy the data.
char buf[2048];
while (ssize_t size = s.Read(buf, 2048))
e.Write(buf, size);
e.Close();
return true;
}
else
{
// Leave the file untouched.
s.Seek(0);
return false;
}
}
bool DecryptSelf(const std::string& elf, const std::string& self)
{
// Check for a debug SELF first.
if (!CheckDebugSelf(self, elf))
{
// Set a virtual pointer to the SELF file.
vfsLocalFile self_vf(nullptr);
if (!self_vf.Open(self))
return false;
// Check the ELF file class (32 or 64 bit).
bool isElf32 = IsSelfElf32(self);
// Start the decrypter on this SELF file.
SELFDecrypter self_dec(self_vf);
// Load the SELF file headers.
if (!self_dec.LoadHeaders(isElf32))
{
LOG_ERROR(LOADER, "SELF: Failed to load SELF file headers!");
return false;
}
// Load and decrypt the SELF file metadata.
if (!self_dec.LoadMetadata())
{
LOG_ERROR(LOADER, "SELF: Failed to load SELF file metadata!");
return false;
}
// Decrypt the SELF file data.
if (!self_dec.DecryptData())
{
LOG_ERROR(LOADER, "SELF: Failed to decrypt SELF file data!");
return false;
}
// Make a new ELF file from this SELF.
if (!self_dec.MakeElf(elf, isElf32))
{
LOG_ERROR(LOADER, "SELF: Failed to make ELF file from SELF!");
return false;
}
}
return true;
}
+507
View File
@@ -0,0 +1,507 @@
#pragma once
#include "utils.h"
#include "key_vault.h"
#include "Loader/ELF.h"
#include "Loader/SELF.h"
#include <wx/mstream.h>
#include <wx/zstream.h>
struct AppInfo
{
u64 authid;
u32 vendor_id;
u32 self_type;
u64 version;
u64 padding;
void Load(vfsStream& f)
{
authid = Read64(f);
vendor_id = Read32(f);
self_type = Read32(f);
version = Read64(f);
padding = Read64(f);
}
void Show()
{
LOG_NOTICE(LOADER, "AuthID: 0x%llx", authid);
LOG_NOTICE(LOADER, "VendorID: 0x%08x", vendor_id);
LOG_NOTICE(LOADER, "SELF type: 0x%08x", self_type);
LOG_NOTICE(LOADER, "Version: 0x%llx", version);
}
};
struct SectionInfo
{
u64 offset;
u64 size;
u32 compressed;
u32 unknown1;
u32 unknown2;
u32 encrypted;
void Load(vfsStream& f)
{
offset = Read64(f);
size = Read64(f);
compressed = Read32(f);
unknown1 = Read32(f);
unknown2 = Read32(f);
encrypted = Read32(f);
}
void Show()
{
LOG_NOTICE(LOADER, "Offset: 0x%llx", offset);
LOG_NOTICE(LOADER, "Size: 0x%llx", size);
LOG_NOTICE(LOADER, "Compressed: 0x%08x", compressed);
LOG_NOTICE(LOADER, "Unknown1: 0x%08x", unknown1);
LOG_NOTICE(LOADER, "Unknown2: 0x%08x", unknown2);
LOG_NOTICE(LOADER, "Encrypted: 0x%08x", encrypted);
}
};
struct SCEVersionInfo
{
u32 subheader_type;
u32 present;
u32 size;
u32 unknown;
void Load(vfsStream& f)
{
subheader_type = Read32(f);
present = Read32(f);
size = Read32(f);
unknown = Read32(f);
}
void Show()
{
LOG_NOTICE(LOADER, "Sub-header type: 0x%08x", subheader_type);
LOG_NOTICE(LOADER, "Present: 0x%08x", present);
LOG_NOTICE(LOADER, "Size: 0x%08x", size);
LOG_NOTICE(LOADER, "Unknown: 0x%08x", unknown);
}
};
struct ControlInfo
{
u32 type;
u32 size;
u64 next;
union {
// type 1 0x30 bytes
struct {
u32 ctrl_flag1;
u32 unknown1;
u32 unknown2;
u32 unknown3;
u32 unknown4;
u32 unknown5;
u32 unknown6;
u32 unknown7;
} control_flags;
// type 2 0x30 bytes
struct {
u8 digest[20];
u64 unknown;
} file_digest_30;
// type 2 0x40 bytes
struct {
u8 digest1[20];
u8 digest2[20];
u64 unknown;
} file_digest_40;
// type 3 0x90 bytes
struct {
u32 magic;
u32 unknown1;
u32 license;
u32 type;
u8 content_id[48];
u8 digest[16];
u8 invdigest[16];
u8 xordigest[16];
u64 unknown2;
u64 unknown3;
} npdrm;
};
void Load(vfsStream& f)
{
type = Read32(f);
size = Read32(f);
next = Read64(f);
if (type == 1)
{
control_flags.ctrl_flag1 = Read32(f);
control_flags.unknown1 = Read32(f);
control_flags.unknown2 = Read32(f);
control_flags.unknown3 = Read32(f);
control_flags.unknown4 = Read32(f);
control_flags.unknown5 = Read32(f);
control_flags.unknown6 = Read32(f);
control_flags.unknown7 = Read32(f);
}
else if (type == 2)
{
if (size == 0x30)
{
f.Read(file_digest_30.digest, 20);
file_digest_30.unknown = Read64(f);
}
else if (size == 0x40)
{
f.Read(file_digest_40.digest1, 20);
f.Read(file_digest_40.digest2, 20);
file_digest_40.unknown = Read64(f);
}
}
else if (type == 3)
{
npdrm.magic = Read32(f);
npdrm.unknown1 = Read32(f);
npdrm.license = Read32(f);
npdrm.type = Read32(f);
f.Read(npdrm.content_id, 48);
f.Read(npdrm.digest, 16);
f.Read(npdrm.invdigest, 16);
f.Read(npdrm.xordigest, 16);
npdrm.unknown2 = Read64(f);
npdrm.unknown3 = Read64(f);
}
}
void Show()
{
LOG_NOTICE(LOADER, "Type: 0x%08x", type);
LOG_NOTICE(LOADER, "Size: 0x%08x", size);
LOG_NOTICE(LOADER, "Next: 0x%llx", next);
if (type == 1)
{
LOG_NOTICE(LOADER, "Control flag 1: 0x%08x", control_flags.ctrl_flag1);
LOG_NOTICE(LOADER, "Unknown1: 0x%08x", control_flags.unknown1);
LOG_NOTICE(LOADER, "Unknown2: 0x%08x", control_flags.unknown2);
LOG_NOTICE(LOADER, "Unknown3: 0x%08x", control_flags.unknown3);
LOG_NOTICE(LOADER, "Unknown4: 0x%08x", control_flags.unknown4);
LOG_NOTICE(LOADER, "Unknown5: 0x%08x", control_flags.unknown5);
LOG_NOTICE(LOADER, "Unknown6: 0x%08x", control_flags.unknown6);
LOG_NOTICE(LOADER, "Unknown7: 0x%08x", control_flags.unknown7);
}
else if (type == 2)
{
if (size == 0x30)
{
std::string digest_str;
for (int i = 0; i < 20; i++)
digest_str += fmt::Format("%02x", file_digest_30.digest[i]);
LOG_NOTICE(LOADER, "Digest: %s", digest_str.c_str());
LOG_NOTICE(LOADER, "Unknown: 0x%llx", file_digest_30.unknown);
}
else if (size == 0x40)
{
std::string digest_str1;
std::string digest_str2;
for (int i = 0; i < 20; i++)
{
digest_str1 += fmt::Format("%02x", file_digest_40.digest1[i]);
digest_str2 += fmt::Format("%02x", file_digest_40.digest2[i]);
}
LOG_NOTICE(LOADER, "Digest1: %s", digest_str1.c_str());
LOG_NOTICE(LOADER, "Digest2: %s", digest_str2.c_str());
LOG_NOTICE(LOADER, "Unknown: 0x%llx", file_digest_40.unknown);
}
}
else if (type == 3)
{
std::string contentid_str;
std::string digest_str;
std::string invdigest_str;
std::string xordigest_str;
for (int i = 0; i < 48; i++)
contentid_str += fmt::Format("%02x", npdrm.content_id[i]);
for (int i = 0; i < 16; i++)
{
digest_str += fmt::Format("%02x", npdrm.digest[i]);
invdigest_str += fmt::Format("%02x", npdrm.invdigest[i]);
xordigest_str += fmt::Format("%02x", npdrm.xordigest[i]);
}
LOG_NOTICE(LOADER, "Magic: 0x%08x", npdrm.magic);
LOG_NOTICE(LOADER, "Unknown1: 0x%08x", npdrm.unknown1);
LOG_NOTICE(LOADER, "License: 0x%08x", npdrm.license);
LOG_NOTICE(LOADER, "Type: 0x%08x", npdrm.type);
LOG_NOTICE(LOADER, "ContentID: %s", contentid_str.c_str());
LOG_NOTICE(LOADER, "Digest: %s", digest_str.c_str());
LOG_NOTICE(LOADER, "Inverse digest: %s", invdigest_str.c_str());
LOG_NOTICE(LOADER, "XOR digest: %s", xordigest_str.c_str());
LOG_NOTICE(LOADER, "Unknown2: 0x%llx", npdrm.unknown2);
LOG_NOTICE(LOADER, "Unknown3: 0x%llx", npdrm.unknown3);
}
}
};
struct MetadataInfo
{
u8 key[0x10];
u8 key_pad[0x10];
u8 iv[0x10];
u8 iv_pad[0x10];
void Load(u8* in)
{
memcpy(key, in, 0x10);
memcpy(key_pad, in + 0x10, 0x10);
memcpy(iv, in + 0x20, 0x10);
memcpy(iv_pad, in + 0x30, 0x10);
}
void Show()
{
std::string key_str;
std::string key_pad_str;
std::string iv_str;
std::string iv_pad_str;
for (int i = 0; i < 0x10; i++)
{
key_str += fmt::Format("%02x", key[i]);
key_pad_str += fmt::Format("%02x", key_pad[i]);
iv_str += fmt::Format("%02x", iv[i]);
iv_pad_str += fmt::Format("%02x", iv_pad[i]);
}
LOG_NOTICE(LOADER, "Key: %s", key_str.c_str());
LOG_NOTICE(LOADER, "Key pad: %s", key_pad_str.c_str());
LOG_NOTICE(LOADER, "IV: %s", iv_str.c_str());
LOG_NOTICE(LOADER, "IV pad: %s", iv_pad_str.c_str());
}
};
struct MetadataHeader
{
u64 signature_input_length;
u32 unknown1;
u32 section_count;
u32 key_count;
u32 opt_header_size;
u32 unknown2;
u32 unknown3;
void Load(u8* in)
{
memcpy(&signature_input_length, in, 8);
memcpy(&unknown1, in + 8, 4);
memcpy(&section_count, in + 12, 4);
memcpy(&key_count, in + 16, 4);
memcpy(&opt_header_size, in + 20, 4);
memcpy(&unknown2, in + 24, 4);
memcpy(&unknown3, in + 28, 4);
// Endian swap.
signature_input_length = swap64(signature_input_length);
unknown1 = swap32(unknown1);
section_count = swap32(section_count);
key_count = swap32(key_count);
opt_header_size = swap32(opt_header_size);
unknown2 = swap32(unknown2);
unknown3 = swap32(unknown3);
}
void Show()
{
LOG_NOTICE(LOADER, "Signature input length: 0x%llx", signature_input_length);
LOG_NOTICE(LOADER, "Unknown1: 0x%08x", unknown1);
LOG_NOTICE(LOADER, "Section count: 0x%08x", section_count);
LOG_NOTICE(LOADER, "Key count: 0x%08x", key_count);
LOG_NOTICE(LOADER, "Optional header size: 0x%08x", opt_header_size);
LOG_NOTICE(LOADER, "Unknown2: 0x%08x", unknown2);
LOG_NOTICE(LOADER, "Unknown3: 0x%08x", unknown3);
}
};
struct MetadataSectionHeader
{
u64 data_offset;
u64 data_size;
u32 type;
u32 program_idx;
u32 hashed;
u32 sha1_idx;
u32 encrypted;
u32 key_idx;
u32 iv_idx;
u32 compressed;
void Load(u8* in)
{
memcpy(&data_offset, in, 8);
memcpy(&data_size, in + 8, 8);
memcpy(&type, in + 16, 4);
memcpy(&program_idx, in + 20, 4);
memcpy(&hashed, in + 24, 4);
memcpy(&sha1_idx, in + 28, 4);
memcpy(&encrypted, in + 32, 4);
memcpy(&key_idx, in + 36, 4);
memcpy(&iv_idx, in + 40, 4);
memcpy(&compressed, in + 44, 4);
// Endian swap.
data_offset = swap64(data_offset);
data_size = swap64(data_size);
type = swap32(type);
program_idx = swap32(program_idx);
hashed = swap32(hashed);
sha1_idx = swap32(sha1_idx);
encrypted = swap32(encrypted);
key_idx = swap32(key_idx);
iv_idx = swap32(iv_idx);
compressed = swap32(compressed);
}
void Show()
{
LOG_NOTICE(LOADER, "Data offset: 0x%llx", data_offset);
LOG_NOTICE(LOADER, "Data size: 0x%llx", data_size);
LOG_NOTICE(LOADER, "Type: 0x%08x", type);
LOG_NOTICE(LOADER, "Program index: 0x%08x", program_idx);
LOG_NOTICE(LOADER, "Hashed: 0x%08x", hashed);
LOG_NOTICE(LOADER, "SHA1 index: 0x%08x", sha1_idx);
LOG_NOTICE(LOADER, "Encrypted: 0x%08x", encrypted);
LOG_NOTICE(LOADER, "Key index: 0x%08x", key_idx);
LOG_NOTICE(LOADER, "IV index: 0x%08x", iv_idx);
LOG_NOTICE(LOADER, "Compressed: 0x%08x", compressed);
}
};
struct SectionHash {
u8 sha1[20];
u8 padding[12];
u8 hmac_key[64];
void Load(vfsStream& f)
{
f.Read(sha1, 20);
f.Read(padding, 12);
f.Read(hmac_key, 64);
}
};
struct CapabilitiesInfo
{
u32 type;
u32 capabilities_size;
u32 next;
u32 unknown1;
u64 unknown2;
u64 unknown3;
u64 flags;
u32 unknown4;
u32 unknown5;
void Load(vfsStream& f)
{
type = Read32(f);
capabilities_size = Read32(f);
next = Read32(f);
unknown1 = Read32(f);
unknown2 = Read64(f);
unknown3 = Read64(f);
flags = Read64(f);
unknown4 = Read32(f);
unknown5 = Read32(f);
}
};
struct Signature
{
u8 r[21];
u8 s[21];
u8 padding[6];
void Load(vfsStream& f)
{
f.Read(r, 21);
f.Read(s, 21);
f.Read(padding, 6);
}
};
struct SelfSection
{
u8 *data;
u64 size;
u64 offset;
void Load(vfsStream& f)
{
*data = Read32(f);
size = Read64(f);
offset = Read64(f);
}
};
class SELFDecrypter
{
// Main SELF file stream.
vfsStream& self_f;
// SCE, SELF and APP headers.
SceHeader sce_hdr;
SelfHeader self_hdr;
AppInfo app_info;
// ELF64 header and program header/section header arrays.
Elf64_Ehdr elf64_hdr;
std::vector<Elf64_Shdr> shdr64_arr;
std::vector<Elf64_Phdr> phdr64_arr;
// ELF32 header and program header/section header arrays.
Elf32_Ehdr elf32_hdr;
std::vector<Elf32_Shdr> shdr32_arr;
std::vector<Elf32_Phdr> phdr32_arr;
// Decryption info structs.
std::vector<SectionInfo> secinfo_arr;
SCEVersionInfo scev_info;
std::vector<ControlInfo> ctrlinfo_arr;
// Metadata structs.
MetadataInfo meta_info;
MetadataHeader meta_hdr;
std::vector<MetadataSectionHeader> meta_shdr;
// Internal data buffers.
u8 *data_keys;
u32 data_keys_length;
u8 *data_buf;
u32 data_buf_length;
// Main key vault instance.
KeyVault key_v;
public:
SELFDecrypter(vfsStream& s);
bool MakeElf(const std::string& elf, bool isElf32);
bool LoadHeaders(bool isElf32);
void ShowHeaders(bool isElf32);
bool LoadMetadata();
bool DecryptData();
bool DecryptNPDRM(u8 *metadata, u32 metadata_size);
bool GetKeyFromRap(u8 *content_id, u8 *npdrm_key);
};
extern bool IsSelf(const std::string& path);
extern bool IsSelfElf32(const std::string& path);
extern bool CheckDebugSelf(const std::string& self, const std::string& elf);
extern bool DecryptSelf(const std::string& elf, const std::string& self);
+147
View File
@@ -0,0 +1,147 @@
#include "stdafx.h"
#include "utils.h"
// Endian swap auxiliary functions.
u16 swap16(u16 i)
{
return ((i & 0xFF00) >> 8) | ((i & 0xFF) << 8);
}
u32 swap32(u32 i)
{
return ((i & 0xFF000000) >> 24) | ((i & 0xFF0000) >> 8) | ((i & 0xFF00) << 8) | ((i & 0xFF) << 24);
}
u64 swap64(u64 i)
{
return ((i & 0x00000000000000ff) << 56) | ((i & 0x000000000000ff00) << 40) |
((i & 0x0000000000ff0000) << 24) | ((i & 0x00000000ff000000) << 8) |
((i & 0x000000ff00000000) >> 8) | ((i & 0x0000ff0000000000) >> 24) |
((i & 0x00ff000000000000) >> 40) | ((i & 0xff00000000000000) >> 56);
}
void xor_(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size)
{
int i;
for(i = 0; i < size; i++)
{
dest[i] = src1[i] ^ src2[i];
}
}
// Hex string conversion auxiliary functions.
u64 hex_to_u64(const char* hex_str)
{
u32 length = strlen(hex_str);
u64 tmp = 0;
u64 result = 0;
char c;
while (length--)
{
c = *hex_str++;
if((c >= '0') && (c <= '9'))
tmp = c - '0';
else if((c >= 'a') && (c <= 'f'))
tmp = c - 'a' + 10;
else if((c >= 'A') && (c <= 'F'))
tmp = c - 'A' + 10;
else
tmp = 0;
result |= (tmp << (length * 4));
}
return result;
}
void hex_to_bytes(unsigned char *data, const char *hex_str)
{
u32 str_length = strlen(hex_str);
u32 data_length = str_length / 2;
char tmp_buf[3] = {0, 0, 0};
// Don't convert if the string length is odd.
if (!(str_length % 2))
{
u8 *out = (u8 *) malloc (str_length * sizeof(u8));
u8 *pos = out;
while (str_length--)
{
tmp_buf[0] = *hex_str++;
tmp_buf[1] = *hex_str++;
*pos++ = (u8)(hex_to_u64(tmp_buf) & 0xFF);
}
// Copy back to our array.
memcpy(data, out, data_length);
}
}
// Crypto functions (AES128-CBC, AES128-ECB, SHA1-HMAC and AES-CMAC).
void aescbc128_decrypt(unsigned char *key, unsigned char *iv, unsigned char *in, unsigned char *out, int len)
{
aes_context ctx;
aes_setkey_dec(&ctx, key, 128);
aes_crypt_cbc(&ctx, AES_DECRYPT, len, iv, in, out);
// Reset the IV.
memset(iv, 0, 0x10);
}
void aesecb128_encrypt(unsigned char *key, unsigned char *in, unsigned char *out)
{
aes_context ctx;
aes_setkey_enc(&ctx, key, 128);
aes_crypt_ecb(&ctx, AES_ENCRYPT, in, out);
}
bool hmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int in_len, unsigned char *hash)
{
unsigned char *out = new unsigned char[key_len];
sha1_hmac(key, key_len, in, in_len, out);
for (int i = 0; i < 0x10; i++)
{
if (out[i] != hash[i])
{
delete[] out;
return false;
}
}
delete[] out;
return true;
}
bool cmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int in_len, unsigned char *hash)
{
unsigned char *out = new unsigned char[key_len];
aes_context ctx;
aes_setkey_enc(&ctx, key, 128);
aes_cmac(&ctx, in_len, in, out);
for (int i = 0; i < key_len; i++)
{
if (out[i] != hash[i])
{
delete[] out;
return false;
}
}
delete[] out;
return true;
}
#include "lz.h"
// Reverse-engineered custom LempelZivMarkov based compression (unknown variant of LZRC).
int lz_decompress(unsigned char *out, unsigned char *in, unsigned int size)
{
return decompress(out,in,size);
}
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include "aes.h"
#include "sha1.h"
// Auxiliary functions (endian swap and xor).
u16 swap16(u16 i);
u32 swap32(u32 i);
u64 swap64(u64 i);
void xor_(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size);
// Hex string conversion auxiliary functions.
u64 hex_to_u64(const char* hex_str);
void hex_to_bytes(unsigned char *data, const char *hex_str);
// Crypto functions (AES128-CBC, AES128-ECB, SHA1-HMAC and AES-CMAC).
void aescbc128_decrypt(unsigned char *key, unsigned char *iv, unsigned char *in, unsigned char *out, int len);
void aesecb128_encrypt(unsigned char *key, unsigned char *in, unsigned char *out);
bool hmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int in_len, unsigned char *hash);
bool cmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int in_len, unsigned char *hash);
// Reverse-engineered custom LempelZivMarkov based compression (unknown variant of LZRC).
int lz_decompress(unsigned char *out, unsigned char *in, unsigned int size);
+137
View File
@@ -0,0 +1,137 @@
#pragma once
#include "Emu/CPU/CPUDecoder.h"
#include "ARMv7Opcodes.h"
class ARMv7Decoder : public CPUDecoder
{
ARMv7Opcodes& m_op;
u8 m_last_instr_size;
public:
ARMv7Decoder(ARMv7Opcodes& op) : m_op(op)
{
}
u32 branchTarget(u32 imm)
{
return imm << 1;
}
virtual u8 DecodeMemory(const u64 address)
{
using namespace ARMv7_opcodes;
const u16 code0 = Memory.Read16(address);
const u16 code1 = Memory.Read16(address + 2);
switch(code0 >> 12) //15 - 12
{
case T1_CBZ:
switch((code0 >> 10) & 0x1)
{
case 0:
switch((code0 >> 8) & 0x1)
{
case 1:
m_op.CBZ((code0 >> 11) & 0x1, branchTarget((((code0 >> 9) & 0x1) << 5) | (code0 >> 3) & 0x1f), code0 & 0x7, 2);
return 2;
}
break;
}
break;
case T1_B:
m_op.B((code0 >> 8) & 0xf, branchTarget(code0 & 0xff), 2);
return 2;
}
switch(code0 >> 11) //15 - 11
{
case T2_B:
m_op.B(0xf, branchTarget(code0 & 0xfff), 2);
return 2;
case T3_B:
{
u8 S = (code0 >> 10) & 0x1;
u8 J1 = (code1 >> 13) & 0x1;
u8 J2 = (code1 >> 11) & 0x1;
u8 I1 = 1 - (J1 ^ S);
u8 I2 = 1 - (J2 ^ S);
u16 imm11 = code1 & 0x7ff;
u32 imm32 = 0;
switch(code1 >> 14)
{
case 2: //B
{
u8 cond;
switch((code1 >> 12) & 0x1)
{
case 0:
{
cond = (code0 >> 6) & 0xf;
u32 imm6 = code0 & 0x3f;
imm32 = sign<19, u32>((S << 19) | (I1 << 18) | (I2 << 17) | (imm6 << 11) | imm11);
}
break;
case 1:
cond = 0xf;
u32 imm10 = code0 & 0x7ff;
imm32 = sign<23, u32>((S << 23) | (I1 << 22) | (I2 << 21) | (imm10 << 11) | imm11);
break;
}
m_op.B(cond, branchTarget(imm32), 4);
}
return 4;
case 3: //BL
switch((code1 >> 12) & 0x1)
{
case 0:
break;
case 1:
u32 imm10 = code0 & 0x7ff;
imm32 = sign<23, u32>((S << 23) | (I1 << 22) | (I2 << 21) | (imm10 << 11) | imm11);
m_op.BL(branchTarget(imm32), 4);
return 4;
}
break;
}
}
break;
}
switch(code0 >> 9)
{
case T1_PUSH:
m_op.PUSH((((code0 >> 8) & 0x1) << 14) | (code0 & 0xff));
return 2;
case T1_POP:
m_op.POP((((code0 >> 8) & 0x1) << 15) | (code0 & 0xff));
return 2;
}
switch(code0)
{
case T2_PUSH:
m_op.PUSH(code1);
return 4;
case T2_POP:
m_op.POP(code1);
return 4;
case T1_NOP:
m_op.NOP();
return 2;
}
m_op.UNK(code0, code1);
return 2;
}
};
+95
View File
@@ -0,0 +1,95 @@
#pragma once
#include "Emu/ARMv7/ARMv7Opcodes.h"
#include "Emu/CPU/CPUDisAsm.h"
#include "Emu/Memory/Memory.h"
static const char* g_arm_cond_name[16] =
{
"eq", "ne", "cs", "cc",
"mi", "pl", "vs", "vc",
"hi", "ls", "ge", "lt",
"gt", "le", "al", "al",
};
class ARMv7DisAsm
: public CPUDisAsm
, public ARMv7Opcodes
{
public:
ARMv7DisAsm(CPUDisAsmMode mode) : CPUDisAsm(mode)
{
}
protected:
virtual u32 DisAsmBranchTarget(const s32 imm)
{
return dump_pc + imm;
}
std::string GetRegsListString(u16 regs_list)
{
std::string regs_str;
for(u16 mask=0x1, i=0; mask; mask <<= 1, i++)
{
if(regs_list & mask)
{
if(!regs_str.empty())
{
regs_str += ", ";
}
regs_str += g_arm_reg_name[i];
}
}
return regs_str;
}
void NULL_OP()
{
Write("null");
}
void PUSH(u16 regs_list)
{
Write(fmt::Format("push {%s}", GetRegsListString(regs_list).c_str()));
}
void POP(u16 regs_list)
{
Write(fmt::Format("pop {%s}", GetRegsListString(regs_list).c_str()));
}
void NOP()
{
Write("nop");
}
void B(u8 cond, u32 imm, u8 intstr_size)
{
if((cond & 0xe) == 0xe)
{
Write(fmt::Format("b 0x%x", DisAsmBranchTarget(imm) + intstr_size));
}
else
{
Write(fmt::Format("b[%s] 0x%x", g_arm_cond_name[cond], DisAsmBranchTarget(imm) + intstr_size));
}
}
virtual void CBZ(u8 op, u32 imm, u8 rn, u8 intstr_size)
{
Write(fmt::Format("cb%sz 0x%x,%s", (op ? "n" : ""), DisAsmBranchTarget(imm) + intstr_size, g_arm_reg_name[rn]));
}
void BL(u32 imm, u8 intstr_size)
{
Write(fmt::Format("bl 0x%x", DisAsmBranchTarget(imm) + intstr_size));
}
void UNK(const u16 code0, const u16 code1)
{
Write(fmt::Format("Unknown/Illegal opcode! (0x%04x : 0x%04x)", code0, code1));
}
};
+322
View File
@@ -0,0 +1,322 @@
#pragma once
#include "Emu/ARMv7/ARMv7Opcodes.h"
class ARMv7Interpreter : public ARMv7Opcodes
{
ARMv7Thread& CPU;
public:
ARMv7Interpreter(ARMv7Thread& cpu) : CPU(cpu)
{
}
enum SRType
{
SRType_None,
SRType_LSL,
SRType_LSR,
SRType_ASR,
SRType_ROR,
SRType_RRX,
};
template<typename T>
bool IsZero(T x)
{
return x == T(0);
}
template<typename T>
bool IsOnes(T x)
{
return x == ~T(0);
}
template<typename T>
u8 IsZeroBit(T x)
{
return IsZero(x) ? 1 : 0;
}
template<typename T>
bool IsOnesBit(T x, u8 len = sizeof(T) * 8)
{
return IsOnes(x) ? 1 : 0;
}
template<typename T>
u8 BitCount(T x, u8 len = sizeof(T) * 8)
{
u8 result = 0;
for(u8 mask=1 << (len - 1); mask; mask >>= 1)
{
if(x & mask) result++;
}
return result;
}
template<typename T>
s8 LowestSetBit(T x, u8 len = sizeof(T) * 8)
{
if(!x) return len;
u8 result = 0;
for(T mask=1, i=0; i<len && (x & mask) == 0; mask <<= 1, i++)
{
result++;
}
return result;
}
template<typename T>
s8 HighestSetBit(T x, u8 len = sizeof(T) * 8)
{
if(!x) return -1;
u8 result = len;
for(T mask=T(1) << (len - 1); (x & mask) == 0; mask >>= 1)
{
result--;
}
return result;
}
template<typename T>
s8 CountLeadingZeroBits(T x, u8 len = sizeof(T) * 8)
{
return len - 1 - HighestSetBit(x, len);
}
SRType DecodeImmShift(u8 type, u8 imm5, uint* shift_n)
{
SRType shift_t = SRType_None;
switch(type)
{
case 0: shift_t = SRType_LSL; if(shift_n) *shift_n = imm5; break;
case 1: shift_t = SRType_LSR; if(shift_n) *shift_n = imm5 == 0 ? 32 : imm5; break;
case 2: shift_t = SRType_ASR; if(shift_n) *shift_n = imm5 == 0 ? 32 : imm5; break;
case 3:
if(imm5 == 0)
{
shift_t = SRType_RRX; if(shift_n) *shift_n = 1;
}
else
{
shift_t = SRType_ROR; if(shift_n) *shift_n = imm5;
}
break;
}
return shift_t;
}
SRType DecodeRegShift(u8 type)
{
SRType shift_t = SRType_None;
switch(type)
{
case 0: shift_t = SRType_LSL; break;
case 1: shift_t = SRType_LSR; break;
case 2: shift_t = SRType_ASR; break;
case 3: shift_t = SRType_ROR; break;
}
return shift_t;
}
u32 LSL_C(u32 x, int shift, bool& carry_out)
{
u32 extended_x = x << shift;
carry_out = (extended_x >> 31) ? 1 : 0;
return extended_x & ~(1 << 31);
}
u32 LSL(u32 x, int shift)
{
if(!shift) return x;
bool carry_out;
return LSL_C(x, shift, carry_out);
}
u32 LSR_C(u32 x, int shift, bool& carry_out)
{
carry_out = (x >> (shift - 1)) & 0x1;
return x >> shift;
}
u32 LSR(u32 x, int shift)
{
if(!shift) return x;
bool carry_out;
return LSR_C(x, shift, carry_out);
}
s32 ASR_C(s32 x, int shift, bool& carry_out)
{
carry_out = (x >> (shift - 1)) & 0x1;
return x >> shift;
}
s32 ASR(s32 x, int shift)
{
if(!shift) return x;
bool carry_out;
return ASR_C(x, shift, carry_out);
}
u32 ROR_C(u32 x, int shift, bool& carry_out)
{
u32 result = LSR(x, shift) | LSL(x, 32 - shift);
carry_out = (result >> 30) & 0x1;
return result;
}
s32 ROR(s32 x, int shift)
{
if(!shift) return x;
bool carry_out;
return ROR_C(x, shift, carry_out);
}
template<typename T> T RRX_C(T x, bool carry_in, bool& carry_out)
{
carry_out = x & 0x1;
return ((u32)carry_in << 31) | (x & 0x7ffffffe);
}
s32 RRX(s32 x, int shift)
{
if(!shift) return x;
bool carry_out;
return RRX_C(x, shift, carry_out);
}
template<typename T> T Shift_C(T value, SRType type, uint amount, bool carry_in, bool& carry_out)
{
if(amount)
{
switch(type)
{
case SRType_LSL: return LSL_C(value, amount, carry_out);
case SRType_LSR: return LSR_C(value, amount, carry_out);
case SRType_ASR: return ASR_C(value, amount, carry_out);
case SRType_ROR: return ROR_C(value, amount, carry_out);
case SRType_RRX: return RRX_C(value, amount, carry_out);
}
}
carry_out = carry_in;
return value;
}
template<typename T> T Shift(T value, SRType type, uint amount, bool carry_in)
{
bool carry_out;
return Shift_C(value, type, amount, carry_in, carry_out);
}
template<typename T> T AddWithCarry(T x, T y, bool carry_in, bool& carry_out, bool& overflow)
{
uint unsigned_sum = (uint)x + (uint)y + (uint)carry_in;
int signed_sum = (int)x + (int)y + (int)carry_in;
T result = unsigned_sum & ~(T(1) << (sizeof(T) - 1));
carry_out = (uint)result != unsigned_sum;
overflow = (int)result != signed_sum;
return result;
}
bool ConditionPassed(u8 cond)
{
bool result = false;
switch(cond >> 1)
{
case 0: result = CPU.APSR.Z == 1; break;
case 1: result = CPU.APSR.C == 1; break;
case 2: result = CPU.APSR.N == 1; break;
case 3: result = CPU.APSR.V == 1; break;
case 4: result = CPU.APSR.C == 1 && CPU.APSR.Z == 0; break;
case 5: result = CPU.APSR.N == CPU.APSR.V; break;
case 6: result = CPU.APSR.N == CPU.APSR.V && CPU.APSR.Z == 0; break;
case 7: return true;
}
if(cond & 0x1)
{
return !result;
}
return result;
}
protected:
void NULL_OP()
{
LOG_ERROR(HLE, "null");
Emu.Pause();
}
void NOP()
{
}
void PUSH(u16 regs_list)
{
for(u16 mask=0x1, i=0; mask; mask <<= 1, i++)
{
if(regs_list & mask)
{
CPU.SP -= 4;
Memory.Write32(CPU.SP, CPU.read_gpr(i));
}
}
}
void POP(u16 regs_list)
{
for(u16 mask=(0x1 << 15), i=15; mask; mask >>= 1, i--)
{
if(regs_list & mask)
{
CPU.write_gpr(i, Memory.Read32(CPU.SP));
CPU.SP += 4;
}
}
}
void B(u8 cond, u32 imm, u8 intstr_size)
{
if(ConditionPassed(cond))
{
CPU.SetBranch(CPU.PC + intstr_size + imm);
}
}
void CBZ(u8 op, u32 imm, u8 rn, u8 intstr_size)
{
if((CPU.GPR[rn] == 0) ^ op)
{
CPU.SetBranch(CPU.PC + intstr_size + imm);
}
}
void BL(u32 imm, u8 intstr_size)
{
CPU.LR = (CPU.PC + intstr_size) | 1;
CPU.SetBranch(CPU.PC + intstr_size + imm);
}
void UNK(const u16 code0, const u16 code1)
{
LOG_ERROR(HLE, "Unknown/Illegal opcode! (0x%04x : 0x%04x)", code0, code1);
Emu.Pause();
}
};
+49
View File
@@ -0,0 +1,49 @@
#pragma once
static const char* g_arm_reg_name[16] =
{
"r0", "r1", "r2", "r3",
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
"r12", "sp", "lr", "pc",
};
namespace ARMv7_opcodes
{
enum ARMv7_T1Opcodes
{
T1_CBZ = 0xb,
T1_B = 0xd,
T1_PUSH = 0x1d,
T1_POP = 0x5e,
T1_NOP = 0xBF00,
};
enum ARMv7_T2Opcodes
{
T2_B = 0x1c,
T2_PUSH = 0xe92d,
T2_POP = 0xe8bd,
};
enum ARMv7_T3Opcodes
{
T3_B = 0x1e,
};
}
class ARMv7Opcodes
{
public:
virtual void NULL_OP() = 0;
virtual void NOP() = 0;
virtual void PUSH(u16 regs_list) = 0;
virtual void POP(u16 regs_list) = 0;
virtual void B(u8 cond, u32 imm, u8 intstr_size) = 0;
virtual void CBZ(u8 op, u32 imm, u8 rn, u8 intstr_size) = 0;
virtual void BL(u32 imm, u8 intstr_size)=0;
virtual void UNK(const u16 code0, const u16 code1) = 0;
};
+107
View File
@@ -0,0 +1,107 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/Cell/PPCThread.h"
#include "ARMv7Thread.h"
#include "ARMv7Decoder.h"
#include "ARMv7DisAsm.h"
#include "ARMv7Interpreter.h"
ARMv7Thread::ARMv7Thread() : CPUThread(CPU_THREAD_ARMv7)
{
}
void ARMv7Thread::InitRegs()
{
memset(GPR, 0, sizeof(GPR[0]) * 15);
APSR.APSR = 0;
IPSR.IPSR = 0;
SP = m_stack_point;
}
void ARMv7Thread::InitStack()
{
if(!m_stack_addr)
{
m_stack_size = 0x10000;
m_stack_addr = Memory.Alloc(0x10000, 1);
}
m_stack_point = m_stack_addr + m_stack_size;
}
u64 ARMv7Thread::GetFreeStackSize() const
{
return SP - GetStackAddr();
}
void ARMv7Thread::SetArg(const uint pos, const u64 arg)
{
assert(0);
}
std::string ARMv7Thread::RegsToString()
{
std::string result = "Registers:\n=========\n";
for(int i=0; i<15; ++i)
{
result += fmt::Format("%s\t= 0x%08x\n", g_arm_reg_name[i], GPR[i]);
}
result += fmt::Format("APSR\t= 0x%08x [N: %d, Z: %d, C: %d, V: %d, Q: %d]\n",
APSR.APSR,
fmt::by_value(APSR.N),
fmt::by_value(APSR.Z),
fmt::by_value(APSR.C),
fmt::by_value(APSR.V),
fmt::by_value(APSR.Q));
return result;
}
std::string ARMv7Thread::ReadRegString(const std::string& reg)
{
return "";
}
bool ARMv7Thread::WriteRegString(const std::string& reg, std::string value)
{
return true;
}
void ARMv7Thread::DoReset()
{
}
void ARMv7Thread::DoRun()
{
switch(Ini.CPUDecoderMode.GetValue())
{
case 0:
//m_dec = new ARMv7Decoder(*new ARMv7DisAsm());
break;
case 1:
case 2:
m_dec = new ARMv7Decoder(*new ARMv7Interpreter(*this));
break;
}
}
void ARMv7Thread::DoPause()
{
}
void ARMv7Thread::DoResume()
{
}
void ARMv7Thread::DoStop()
{
}
void ARMv7Thread::DoCode()
{
}
+99
View File
@@ -0,0 +1,99 @@
#pragma once
#include "Emu/CPU/CPUThread.h"
class ARMv7Thread : public CPUThread
{
public:
ARMv7Thread();
union
{
u32 GPR[15];
struct
{
u32 pad[13];
union
{
u32 SP;
struct { u16 SP_main, SP_process; };
};
u32 LR;
};
};
union
{
struct
{
u32 N : 1; //Negative condition code flag
u32 Z : 1; //Zero condition code flag
u32 C : 1; //Carry condition code flag
u32 V : 1; //Overflow condition code flag
u32 Q : 1; //Set to 1 if an SSAT or USAT instruction changes (saturates) the input value for the signed or unsigned range of the result
u32 : 27;
};
u32 APSR;
} APSR;
union
{
struct
{
u32 : 24;
u32 exception : 8;
};
u32 IPSR;
} IPSR;
void write_gpr(u8 n, u32 value)
{
assert(n < 16);
if(n < 15)
{
GPR[n] = value;
}
else
{
SetBranch(value);
}
}
u32 read_gpr(u8 n)
{
assert(n < 16);
if(n < 15)
{
return GPR[n];
}
return PC;
}
public:
virtual void InitRegs();
virtual void InitStack();
virtual u64 GetFreeStackSize() const;
virtual void SetArg(const uint pos, const u64 arg);
public:
virtual std::string RegsToString();
virtual std::string ReadRegString(const std::string& reg);
virtual bool WriteRegString(const std::string& reg, std::string value);
protected:
virtual void DoReset();
virtual void DoRun();
virtual void DoPause();
virtual void DoResume();
virtual void DoStop();
virtual void DoCode();
};
+160
View File
@@ -0,0 +1,160 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "rpcs3/Ini.h"
#include "OpenALThread.h"
ALenum g_last_al_error = AL_NO_ERROR;
ALCenum g_last_alc_error = ALC_NO_ERROR;
#define checkForAlError(sit) if((g_last_al_error = alGetError()) != AL_NO_ERROR) printAlError(g_last_al_error, sit)
#define checkForAlcError(sit) if((g_last_alc_error = alcGetError(m_device)) != ALC_NO_ERROR) printAlcError(g_last_alc_error, sit)
static const ALenum g_audio_format = Ini.AudioConvertToU16.GetValue() ? AL_FORMAT_STEREO16 : AL_FORMAT_STEREO_FLOAT32;
void printAlError(ALenum err, const char* situation)
{
if(err != AL_NO_ERROR)
{
LOG_ERROR(HLE, "%s: OpenAL error 0x%04x", situation, err);
Emu.Pause();
}
}
void printAlcError(ALCenum err, const char* situation)
{
if(err != ALC_NO_ERROR)
{
LOG_ERROR(HLE, "%s: OpenALC error 0x%04x", situation, err);
Emu.Pause();
}
}
OpenALThread::~OpenALThread()
{
Quit();
}
void OpenALThread::Init()
{
m_device = alcOpenDevice(nullptr);
checkForAlcError("alcOpenDevice");
m_context = alcCreateContext(m_device, nullptr);
checkForAlcError("alcCreateContext");
alcMakeContextCurrent(m_context);
checkForAlcError("alcMakeContextCurrent");
}
void OpenALThread::Quit()
{
m_context = alcGetCurrentContext();
m_device = alcGetContextsDevice(m_context);
alcMakeContextCurrent(nullptr);
alcDestroyContext(m_context);
alcCloseDevice(m_device);
}
void OpenALThread::Play()
{
ALint state;
alGetSourcei(m_source, AL_SOURCE_STATE, &state);
checkForAlError("OpenALThread::Play -> alGetSourcei");
if(state != AL_PLAYING)
{
alSourcePlay(m_source);
checkForAlError("alSourcePlay");
}
}
void OpenALThread::Close()
{
alSourceStop(m_source);
checkForAlError("alSourceStop");
if (alIsSource(m_source))
alDeleteSources(1, &m_source);
alDeleteBuffers(g_al_buffers_count, m_buffers);
checkForAlError("alDeleteBuffers");
}
void OpenALThread::Stop()
{
alSourceStop(m_source);
checkForAlError("alSourceStop");
}
void OpenALThread::Open(const void* src, ALsizei size)
{
alGenSources(1, &m_source);
checkForAlError("alGenSources");
alGenBuffers(g_al_buffers_count, m_buffers);
checkForAlError("alGenBuffers");
alSourcei(m_source, AL_LOOPING, AL_FALSE);
checkForAlError("OpenALThread::Open ->alSourcei");
m_buffer_size = size;
for(uint i=0; i<g_al_buffers_count; ++i)
{
AddBlock(m_buffers[i], m_buffer_size, src);
}
alSourceQueueBuffers(m_source, g_al_buffers_count, m_buffers);
checkForAlError("alSourceQueueBuffers");
Play();
}
void OpenALThread::AddData(const void* src, ALsizei size)
{
const char* bsrc = (const char*)src;
ALuint buffer;
ALint buffers_count;
alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &buffers_count);
checkForAlError("OpenALThread::AddData -> alGetSourcei");
while(size)
{
if(buffers_count-- <= 0)
{
Play();
alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &buffers_count);
checkForAlError("OpenALThread::AddData(in loop) -> alGetSourcei");
continue;
}
alSourceUnqueueBuffers(m_source, 1, &buffer);
checkForAlError("alSourceUnqueueBuffers");
int bsize = size < m_buffer_size ? size : m_buffer_size;
if (!AddBlock(buffer, bsize, bsrc))
LOG_ERROR(HLE, "OpenALThread::AddBlock: invalid block size: %d", bsize);
alSourceQueueBuffers(m_source, 1, &buffer);
checkForAlError("alSourceQueueBuffers");
size -= bsize;
bsrc += bsize;
}
Play();
}
bool OpenALThread::AddBlock(const ALuint buffer_id, const ALsizei size, const void* src)
{
if (size < 1) return false;
alBufferData(buffer_id, g_audio_format, src, size, 48000);
checkForAlError("alBufferData");
return true;
}
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include "OpenAL/include/alext.h"
class OpenALThread
{
private:
static const uint g_al_buffers_count = 16;
ALuint m_source;
ALuint m_buffers[g_al_buffers_count];
ALCdevice* m_device;
ALCcontext* m_context;
ALsizei m_buffer_size;
public:
~OpenALThread();
void Init();
void Quit();
void Play();
void Open(const void* src, ALsizei size);
void Close();
void Stop();
bool AddBlock(const ALuint buffer_id, ALsizei size, const void* src);
void AddData(const void* src, ALsizei size);
};
+47
View File
@@ -0,0 +1,47 @@
#include "stdafx.h"
#include "AudioDumper.h"
AudioDumper::AudioDumper(u8 ch) : m_header(ch)
{
}
AudioDumper::~AudioDumper()
{
}
bool AudioDumper::Init()
{
return m_output.Open("audio.wav", rFile::write);
}
void AudioDumper::WriteHeader()
{
m_output.Write(&m_header, sizeof(m_header)); // write file header
}
size_t AudioDumper::WriteData(const void* buffer, size_t size)
{
#ifdef SKIP_EMPTY_AUDIO
bool do_save = false;
for (u32 i = 0; i < size / 8; i++)
{
if (((u64*)buffer)[i]) do_save = true;
}
for (u32 i = 0; i < size % 8; i++)
{
if (((u8*)buffer)[i + (size & ~7)]) do_save = true;
}
if (!do_save) return size; // ignore empty data
#endif
size_t ret = m_output.Write(buffer, size);
m_header.Size += ret;
m_header.RIFF.Size += ret;
return ret;
}
void AudioDumper::Finalize()
{
m_output.Seek(0);
m_output.Write(&m_header, sizeof(m_header)); // write fixed file header
m_output.Close();
}
+69
View File
@@ -0,0 +1,69 @@
#pragma once
struct WAVHeader
{
struct RIFFHeader
{
u32 ID; // "RIFF"
u32 Size; // FileSize - 8
u32 WAVE; // "WAVE"
RIFFHeader(u32 size)
: ID(*(u32*)"RIFF")
, WAVE(*(u32*)"WAVE")
, Size(size)
{
}
} RIFF;
struct FMTHeader
{
u32 ID; // "fmt "
u32 Size; // 16
u16 AudioFormat; // 1 for PCM, 3 for IEEE Floating Point
u16 NumChannels; // 1, 2, 6, 8
u32 SampleRate; // 48000
u32 ByteRate; // SampleRate * NumChannels * BitsPerSample/8
u16 BlockAlign; // NumChannels * BitsPerSample/8
u16 BitsPerSample; // sizeof(float) * 8
FMTHeader(u8 ch)
: ID(*(u32*)"fmt ")
, Size(16)
, AudioFormat(3)
, NumChannels(ch)
, SampleRate(48000)
, ByteRate(SampleRate * ch * sizeof(float))
, BlockAlign(ch * sizeof(float))
, BitsPerSample(sizeof(float) * 8)
{
}
} FMT;
u32 ID; // "data"
u32 Size; // size of data (256 * NumChannels * sizeof(float))
WAVHeader(u8 ch)
: ID(*(u32*)"data")
, Size(0)
, FMT(ch)
, RIFF(sizeof(RIFFHeader) + sizeof(FMTHeader))
{
}
};
class AudioDumper
{
private:
WAVHeader m_header;
rFile m_output;
public:
AudioDumper(u8 ch);
~AudioDumper();
bool Init();
void WriteHeader();
size_t WriteData(const void* buffer, size_t size);
void Finalize();
const u8 GetCh() const { return m_header.FMT.NumChannels; }
};
+34
View File
@@ -0,0 +1,34 @@
#include "stdafx.h"
#include "rpcs3/Ini.h"
#include "AudioManager.h"
OpenALThread* m_audio_out;
AudioManager::AudioManager()
{
}
void AudioManager::Init()
{
if(m_audio_out) return;
m_audio_info.Init();
switch(Ini.AudioOutMode.GetValue())
{
default:
case 0: m_audio_out = nullptr; break;
case 1: m_audio_out = new OpenALThread(); break;
}
}
void AudioManager::Close()
{
delete m_audio_out;
m_audio_out = nullptr;
}
u8 AudioManager::GetState()
{
return CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED;
}

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