Commit Graph

1252 Commits (0bb4b77b784dfb1e405c71033bfa9988ac024a2d)

Author SHA1 Message Date
bunnei c51b23b052 Merge pull request #559 from lioncash/clean
arm: Some cleanup. Also fixed the initial ARM mode that is emulated.
11 years ago
Lioncash c94c41f95a arm: Get rid of some magic constants. Specify proper ARM mode.
Initially, we were starting the emulator in USER26MODE, which is incorrect, this should be USER32MODE.
11 years ago
Lioncash 93cd199633 arm: Change some more constants into enums 11 years ago
archshift ef24e72b26 Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)

Also removed some GEKKO cruft.
11 years ago
bunnei 168eb27aee GSP: Fixed typo in SignalInterrupt 11 years ago
bunnei 76e7d41f88 Merge pull request #552 from bunnei/setbufferswap-fix
GSP SetBufferSwap fix
11 years ago
bunnei 9eae2400c0 GSP: Call SetBufferSwap for each screen on corresponding signal interrupt. 11 years ago
bunnei ca22ee3239 Merge pull request #526 from purpasmart96/citra_stubs
Services: Stub some functions
11 years ago
bunnei 5b735bdeea Merge pull request #556 from lioncash/clean
arm: Remove TRUE/FALSE defines
11 years ago
bunnei 8f35772bd7 Merge pull request #555 from lioncash/lut
arm_dyncom_thumb: Make lookup tables static
11 years ago
Lioncash 088fab743f arm: Remove TRUE/FALSE defines
- Removed the Debug parameter from ARMul_State since it isn't used.
- Changed ARMul_CoProInit to a void function. It always returned true.
11 years ago
Subv 0d2b6dd656 PTM: Fixed a problem with the gamecoin PTM file. 11 years ago
Subv 1bbf0567b1 Archives: Made the Format function more generic. 11 years ago
Subv 071663e074 Archives: Expose the File and Directory classes to HLE 11 years ago
Subv ca1a87ef7d ResultVal: Fixed compilation when reassigning a ResultVal. 11 years ago
Yuri Kunde Schlesner 3f1a3952d7 FS: Allow multiple instances of the same archive type to be open at once 11 years ago
Yuri Kunde Schlesner 4468625080 FS: Get rid of completely useless Archive class 11 years ago
Lioncash 8d2fb3bb2b arm_dyncom_thumb: Make lookup tables static
These don't need to be recreated all the time.
11 years ago
bunnei 67db6aa4ce Merge pull request #553 from lioncash/denorm
vfp: Normalize accumulator for multiply accumulate instructions
11 years ago
Lioncash 3eccc66abf dyncom: Add more regs to MCR/MRC
Adds the registers that were left out of some coprocessor ranges.
11 years ago
Lioncash a86d5e2752 vfp: Normalize accumulator for multiply accumulate instructions 11 years ago
Kevin Hartman 5fcbfc06eb Scheduler refactor Pt. 1
* Simplifies scheduling logic, specifically regarding thread status. It should be much clearer which statuses are valid
for a thread at any given point in the system.
* Removes dead code from thread.cpp.
* Moves the implementation of resetting a ThreadContext to the corresponding core's implementation.

Other changes:
* Fixed comments in arm interfaces.
* Updated comments in thread.cpp
* Removed confusing, useless, functions like MakeReady() and ChangeStatus() from thread.cpp.
* Removed stack_size from Thread. In the CTR kernel, the thread's stack would be allocated before thread creation.
11 years ago
bunnei 848795f383 Merge pull request #551 from bunnei/mutex-fixes
Mutex/synch fixes
11 years ago
bunnei 1b0bf00cbc Mutex: Locks should be recursive. 11 years ago
bunnei caa58acc84 WaitSynch: Always reschedule (verified behavior on hw). 11 years ago
Lioncash 53fa04f326 vfpdouble: Fix the FTOUI NaN sign setting
This was fixed for vfpsingle, but not vfpdouble
11 years ago
Lioncash a734e9fdca Throw more unused/unnecessary VFP code out 11 years ago
Lioncash ca7babe062 vfp_helper: Convert some flags to enums. Throw out more duplicated FPSCR stuff 11 years ago
Lioncash d832c48864 vfp_helper: Normalize tabs to spaces 11 years ago
purpasmart96 60ce36f721 Services: Stub some functions 11 years ago
Lioncash 1ecd75ea1a vfp_helper: Remove unnecessary extern C blocks 11 years ago
Lioncash 3e576219c4 vfp: Move FPSID, FPEXC, and FPSCR values over to enums.
Also got rid of duplicate definitions of some of these values.
11 years ago
bunnei 7f900ac68e Merge pull request #537 from lioncash/vfp
vfp: Fix VCVT
11 years ago
bunnei 4d36a6a255 Merge pull request #536 from lioncash/dead
vfp: Throw out unused code
11 years ago
Lioncash 82e8f25fe7 vfp: Fix VCVT
These variants exclusively read from the single precision regs and write to double-precision registers
Fixes issues where converted values would be way off from what they should be due to the results being stored in the wrong registers.
11 years ago
Lioncash 7ecedfb970 vfp: Throw out unused code 11 years ago
Lioncash 3a5a39c6aa dyncom: Remove more unnecessary code 11 years ago
Lioncash 676daef3c7 core: Fix some warnings on OSX 11 years ago
Yuri Kunde Schlesner 88a4a808c6 Kernel: Stop creating useless Handles during object creation
They're finally unnecessary, and will stop cluttering the application's
handle table.
11 years ago
Yuri Kunde Schlesner 52f58e64ef Kernel: Make WaitObjects share ownership of Threads waiting on them
During normal operation, a thread waiting on an WaitObject and the
object hold mutual references to each other for the duration of the
wait.

If a process is forcefully terminated (The CTR kernel has a SVC to do
this, TerminateProcess, though no equivalent exists for threads.) its
threads would also be stopped and destroyed, leaving dangling pointers
in the WaitObjects.

The solution is to simply have the Thread remove itself from WaitObjects
when it is stopped. The vector of Threads in WaitObject has also been
changed to hold SharedPtrs, just in case. (Better to have a reference
cycle than a crash.)
11 years ago
Yuri Kunde Schlesner 7725256f64 Explicitly instantiate constructors/destructors for Kernel objects
This should speed up compile times a bit, as well as enable more liberal
use of forward declarations. (Due to SharedPtr not trying to emit the
destructor anymore.)
11 years ago
Yuri Kunde Schlesner 4e84df8be3 Mutex: Replace g_mutex_held_locks with a set inside Thread 11 years ago
Yuri Kunde Schlesner 0f69668fc6 HID: Fix crash when pressing a key when the emulator is stopped 11 years ago
Yuri Kunde Schlesner c4208c1171 SVC: Enable CloseHandle, clean up DuplicateHandle 11 years ago
Yuri Kunde Schlesner e8330dd162 Kernel: Fix bug in HandleTable::Close 11 years ago
Yuri Kunde Schlesner 5354a479bc Kernel: Remove Object::GetHandle (it's not used anymore :D) 11 years ago
Yuri Kunde Schlesner 869ec46683 Kernel: Introduce unique Object ids for debugging 11 years ago
Yuri Kunde Schlesner a9b86db3cf Kernel: Use separate Handle tables for CoreTiming userdata
This is to support the removal of GetHandle soon
11 years ago
Yuri Kunde Schlesner ec9c773251 Kernel: Remove previous scheduled event when a Timer is re-Set 11 years ago
Yuri Kunde Schlesner 8441591659 FS: Remove use of GetHandle 11 years ago
Yuri Kunde Schlesner 664c79ff47 Thread: Modernize two functions that slipped through previous rebases 11 years ago
Yuri Kunde Schlesner 6e11570862 Service: Store function names as const char* instead of std::string
Uses less memory (strings and function table is stored in constant data)
and speeds up start up (no need to allocate and copy strings).
11 years ago
Yuri Kunde Schlesner a79d21c83e Service: Clean-up Interface 11 years ago
Yuri Kunde Schlesner 8779b31fe6 Make Port/Service registration and querying more HW-accurate 11 years ago
Yuri Kunde Schlesner 5e91fc0d1a Filesys: Move creation of Handles for File/Directory to service handlers 11 years ago
bunnei c915d0b727 Merge pull request #514 from rohit-n/fix-warnings
Silence a few warnings.
11 years ago
bunnei c8628f5d56 Merge pull request #525 from lioncash/armwarn
vfp: Get rid of some compile warnings
11 years ago
Lioncash 8c944bd1f0 vfp: Get rid of some compile warnings 11 years ago
Lioncash 3f00dd9117 arm: Clean up ARMul_State
Remove unnecessary/unused struct variables.
11 years ago
Lioncash f44781fd7b arm: Adios armemu 11 years ago
Tony Wasserka 73a7a379d6 Merge pull request #512 from lioncash/assignment
shared_memory: Fix assignments in SharedMemory::Map
11 years ago
Lioncash b6cfc48a0b dyncom: clean up arm_dyncom_dec.h 11 years ago
Lioncash fc1a9e35fb arm: Move headers over to pragma once 11 years ago
Lioncash 83bc1a3120 arm: Get rid of armcpu.h and skyeye_types.h 11 years ago
Lioncash 904194c3e8 arm: Clean out armos.h and armmmu.h 11 years ago
bunnei 88a62b671b Merge pull request #513 from lioncash/cleanup
arm: Cleanup.
11 years ago
Rohit Nirmal 5ebf35db96 Silence a few warnings. 11 years ago
Lioncash 09a66860e2 arm: Throw out a lot of unnecessary code 11 years ago
Lioncash 3dfef1701c armdefs: Move some defines over to enums 11 years ago
Lioncash 96c174aed4 shared_memory: Fix assignments in SharedMemory::Map 11 years ago
Lioncash 0c4685ca12 loader: Add missing printf argument 11 years ago
Lioncash 551264f815 archive: Fix initializer list order for the File class. 11 years ago
Lioncash 0c53cc52bd apt_u: Fix missing printf specifiers 11 years ago
Yuri Kunde Schlesner d917a9bf77 Kernel: Mark all appropriate kernel objects as "final" 11 years ago
Yuri Kunde Schlesner 58b544db99 SVC: Use CASCADE_RESULT in SVC handlers 11 years ago
Yuri Kunde Schlesner 09ae6e1fa3 Remove result.h InvalidHandle
It was only being used in two places, where it was replaced by a local
constant.
11 years ago
Yuri Kunde Schlesner 44f90340dc SVC: Change return type of handlers to ResultCode 11 years ago
Yuri Kunde Schlesner d52d859936 Kernel: Convert Event to not use Handles 11 years ago
Yuri Kunde Schlesner ad80ff1e32 Kernel: Convert Timer to (mostly) not use Handles 11 years ago
Yuri Kunde Schlesner 882b6fed75 Kernel: Convert Mutex to not use Handles 11 years ago
Yuri Kunde Schlesner 38e7122f23 Kernel: Convert AddressArbiter to not use Handles 11 years ago
Yuri Kunde Schlesner d9b19be1d9 Kernel: Convert Semaphore to not use Handles 11 years ago
Yuri Kunde Schlesner 4bb33dfc30 Kernel: Convert SharedMemory to not use Handles 11 years ago
Yuri Kunde Schlesner afc416c607 Additions to ResultVal to make it more convenient to use. 11 years ago
Yuri Kunde Schlesner b5ee4f9df9 Move VAddr/PAddr typedefs to kernel.h 11 years ago
Yuri Kunde Schlesner 9a345de2bd Kernel: Remove useless/duplicated comments; mark functions static 11 years ago
bunnei 206cabc0e4 Merge pull request #412 from purpasmart96/svc_table_cleanup
SVC: Update the SVC function table
11 years ago
Lioncash 7a3e371141 dyncom: Minor cleanup
Narrow scopes for the instruction variables. Remove unnecessary parentheses.
11 years ago
purpasmart96 62f4365db1 SVC: Update the SVC function table 11 years ago
bunnei 326c451758 Merge pull request #345 from purpasmart96/apt_stubs
APT_U: Stub some functions & misc changes
11 years ago
bunnei 547737f720 Update vfp.cpp
VFP: Changed a debug log to trace.
11 years ago
bunnei e7dd4d34aa Merge pull request #485 from Subv/more_servs
Services: Stubbed more services.
11 years ago
Subv 2ea60bdc7f Services/HID: Removed some files due to a rebase error 11 years ago
Subv c2e9990149 Services: Stubbed more services.
Implemented FSUser::CreateExtSaveData
11 years ago
bunnei cc34462b71 Merge pull request #410 from chinhodado/cleanup
Cleanup: Logging in Core
11 years ago
Lioncash e09fb7becc vfp: Clean up vertical alignment for instructions 11 years ago
purpasmart96 2dd23b6467 APT_U: Stub some functions & misc changes 11 years ago
archshift 92a75df9b1 cam_u.h: fix indentation
Withholding my profanity towards Xcode.
11 years ago
bunnei 92550013cf Merge pull request #493 from archshift/ptmplay
Stubbed some services
11 years ago
Lioncash 8810dfe1de dyncom: Minor cleanup
Removes some unused macros and cleans up indentation inconsistencies
11 years ago
bunnei 731154f79e WaitSynchronization: Added a result code for invalid result, fixed bug. 11 years ago
bunnei 68ddaaa2f5 Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup. 11 years ago
bunnei 4255f25647 Thread: Use std::find in CheckWait_WaitObject. 11 years ago
bunnei 2f3020a102 Mutex: Cleanup and remove redundant code. 11 years ago
bunnei f09806aed2 Kernel: Renamed some functions for clarity.
- ReleaseNextThread->WakeupNextThread
- ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
11 years ago
bunnei 15b6a4d9ad Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void. 11 years ago
bunnei c68eb15695 WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" pure virtual. 11 years ago
bunnei 69c5830ef2 Event: Fix implementation of "non-sticky" events. 11 years ago
bunnei 9e6ec3b6cd Session: Change to a WaitObject. 11 years ago
bunnei d2759c578e Kernel: Reschedule on SignalEvent and SendSyncRequest, fix some bugs. 11 years ago
bunnei dde02f79af Mutex: Fix a bug where the thread should not wait if it already has the mutex. 11 years ago
bunnei 9412996c8f Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a WaitObject safely. 11 years ago
bunnei c06d64528a SVC: Removed a Sleep that made no sense
- Would deadlock the calling thread
- Code would never get hit anyways
11 years ago
bunnei 254e4ebd58 AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that made no sense. 11 years ago
bunnei e5a9f1c644 Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks. 11 years ago
bunnei 6deb1a0119 WaitSynchronizationN: Improved comments 11 years ago
bunnei 6643673f28 WaitSynchronizationN: Refactor to fix several bugs
- Separate wait checking from waiting the current thread
- Resume thread when wait_all=true only if all objects are available at once
- Set output to correct wait object index when there are duplicate handles
11 years ago
bunnei aa01c57ae9 Kernel: Separate WaitSynchronization into Wait and Acquire methods. 11 years ago
bunnei 627e96fc15 WaitSynchronizationN: Handle case where handles=nullptr. 11 years ago
bunnei f5c6d367c9 WaitSynchronizationN: Handle case where handle_count is invalid. 11 years ago
bunnei 064be2b86f WaitSynchronizationN: Handle case where handle_count=0. 11 years ago
bunnei 7faf2d8e06 WaitSynchronizationN: Implement return values 11 years ago
bunnei e4a5d8ad4f Event: Fixed some bugs and cleanup (Subv) 11 years ago
bunnei 1f7a04f05a Thread: Keep track of multiple wait objects. 11 years ago
bunnei 14cbbf4d9b Event: Get rid of permanent_lock hack. 11 years ago
bunnei 5e77e2e1de WaitObject: Added RemoveWaitingThread, fixed a bug, and cleanup. 11 years ago
bunnei c22bac6398 Kernel: Added WaitObject and changed "waitable" objects inherit from it. 11 years ago
archshift 1f109c6b49 Added HID_SPVR service and split HID_U implementation into service/hid/hid.xxx 11 years ago
archshift a68dda6328 Stubbed cam:u service 11 years ago
archshift 7516ceaf93 Stubbed ptm:play service 11 years ago
bunnei 8571befc64 Merge pull request #498 from lioncash/statics
core_timing: Mark several variables as static
11 years ago
Lioncash a3f5e5605c core: Fix a few docstrings 11 years ago
Lioncash bfef0aa07e core_timing: Mark several variables as static
These are only used in this translation unit.
11 years ago
bunnei cbbe9e1500 Merge pull request #492 from archshift/apt
Expose GetSharedFont and NotifyToWait to APT:A and APT:S respectively
11 years ago
bunnei 205170fa62 Merge pull request #241 from linkmauve/better-loader
Improve the loader a bit
11 years ago
Lioncash 8c6edc680c dyncom: Clarify precedence for ternary statements 11 years ago
bunnei 004b23153b Merge pull request #494 from lioncash/shift
dyncom: Implement missing shifts in ScaledRegisterPostIndexed, etc
11 years ago
Chin fa8e6272c8 Cleanup: Logging in Core 11 years ago
Lioncash a873f157d0 dyncom: Implement missing shifts in ScaledRegisterPostIndexed, etc 11 years ago
bunnei be8f665142 Merge pull request #383 from zhuowei/shared_page
Add some support for the shared page
11 years ago
archshift 4d316cbd8e Expose GetSharedFont and NotifyToWait to APT:A and APT:S respectively 11 years ago
Lioncash 8575010a68 dyncom: Handle the ARM A2 encoding of STRT/LDRT
These were also missing the shifted register case.
11 years ago
Lioncash 0a5d450e94 dyncom: Handle the ARM A2 encoding of LDRBT/STRBT. 11 years ago
Zhuowei Zhang edb8450420 Add some support for the shared page (currently 3d slider is implemented) 11 years ago
bunnei 2572a62480 APT: Fix typo in setting return code for NotifyToWait 11 years ago
bunnei 350c5a7e32 DSP: Removed useless spam log for SignalInterrupt 11 years ago
bunnei 4b47ed6194 Merge pull request #482 from yuriks/fix-vblank
Correctness fixes for GPU flipping and interrupts
11 years ago
Emmanuel Gil Peyrot df0d66c7cf Loader: Clean up the ELF AppLoader. 11 years ago
Emmanuel Gil Peyrot 84e52a944d Loader: Clean up the 3DSX AppLoader. 11 years ago
Emmanuel Gil Peyrot 08aaa33500 Loader: Clean up the NCCH AppLoader. 11 years ago