Commit graph

1078 commits

Author SHA1 Message Date
bunnei 14cbbf4d9b Event: Get rid of permanent_lock hack. 2015-01-21 18:42:04 -05:00
bunnei 5e77e2e1de WaitObject: Added RemoveWaitingThread, fixed a bug, and cleanup. 2015-01-21 18:41:58 -05:00
bunnei c22bac6398 Kernel: Added WaitObject and changed "waitable" objects inherit from it. 2015-01-21 18:41:00 -05:00
archshift 1f109c6b49 Added HID_SPVR service and split HID_U implementation into service/hid/hid.xxx 2015-01-21 13:31:10 -08:00
archshift a68dda6328 Stubbed cam:u service 2015-01-21 12:50:18 -08:00
archshift 7516ceaf93 Stubbed ptm:play service 2015-01-21 12:50:18 -08:00
bunnei 8571befc64 Merge pull request #498 from lioncash/statics
core_timing: Mark several variables as static
2015-01-20 14:34:07 -05:00
Lioncash a3f5e5605c core: Fix a few docstrings 2015-01-20 13:52:44 -05:00
Lioncash bfef0aa07e core_timing: Mark several variables as static
These are only used in this translation unit.
2015-01-20 13:49:10 -05:00
bunnei cbbe9e1500 Merge pull request #492 from archshift/apt
Expose GetSharedFont and NotifyToWait to APT:A and APT:S respectively
2015-01-20 12:55:53 -05:00
bunnei 205170fa62 Merge pull request #241 from linkmauve/better-loader
Improve the loader a bit
2015-01-20 12:55:28 -05:00
Lioncash 8c6edc680c dyncom: Clarify precedence for ternary statements 2015-01-19 20:35:55 -05:00
bunnei 004b23153b Merge pull request #494 from lioncash/shift
dyncom: Implement missing shifts in ScaledRegisterPostIndexed, etc
2015-01-19 16:42:31 -05:00
Chin fa8e6272c8 Cleanup: Logging in Core 2015-01-19 16:01:06 -05:00
Lioncash a873f157d0 dyncom: Implement missing shifts in ScaledRegisterPostIndexed, etc 2015-01-18 18:32:02 -05:00
bunnei be8f665142 Merge pull request #383 from zhuowei/shared_page
Add some support for the shared page
2015-01-18 18:31:52 -05:00
archshift 4d316cbd8e Expose GetSharedFont and NotifyToWait to APT:A and APT:S respectively 2015-01-18 15:15:14 -08:00
Lioncash 8575010a68 dyncom: Handle the ARM A2 encoding of STRT/LDRT
These were also missing the shifted register case.
2015-01-17 13:53:35 -05:00
Lioncash 0a5d450e94 dyncom: Handle the ARM A2 encoding of LDRBT/STRBT. 2015-01-16 21:05:27 -05:00
Zhuowei Zhang edb8450420 Add some support for the shared page (currently 3d slider is implemented) 2015-01-15 22:16:13 -05:00
bunnei 2572a62480 APT: Fix typo in setting return code for NotifyToWait 2015-01-15 18:23:53 -05:00
bunnei 350c5a7e32 DSP: Removed useless spam log for SignalInterrupt 2015-01-15 18:20:58 -05:00
bunnei 4b47ed6194 Merge pull request #482 from yuriks/fix-vblank
Correctness fixes for GPU flipping and interrupts
2015-01-15 18:11:03 -05:00
Emmanuel Gil Peyrot df0d66c7cf Loader: Clean up the ELF AppLoader. 2015-01-15 22:23:08 +01:00
Emmanuel Gil Peyrot 84e52a944d Loader: Clean up the 3DSX AppLoader. 2015-01-15 22:23:08 +01:00
Emmanuel Gil Peyrot 08aaa33500 Loader: Clean up the NCCH AppLoader. 2015-01-15 22:23:08 +01:00
Emmanuel Gil Peyrot 2c24e539a2 Loader: Display the type of the file being loaded. 2015-01-15 22:23:08 +01:00
Emmanuel Gil Peyrot 82ec17db7d Loader: Guess filetype from the magic, or fallback to the extension. 2015-01-15 22:23:08 +01:00
Emmanuel Gil Peyrot 04622a859c Loader: Don’t assume the file hasn’t been read before. 2015-01-15 22:23:07 +01:00
Emmanuel Gil Peyrot b5237e885d Loader: Keep a reference to the file and pass it to the correct AppLoader, instead of loading it multiple times. 2015-01-15 21:21:26 +00:00
Emmanuel Gil Peyrot 2d63df90a9 Loader: Initialize the default NCCH values in the class declaration, not in the constructor. 2015-01-15 21:21:26 +00:00
Emmanuel Gil Peyrot 9d3bb8b7c0 Loader: Remove the useless THREEDSXReader class. 2015-01-15 21:21:26 +00:00
Emmanuel Gil Peyrot 85030c6e6b Loader: Never forget to change is_loaded. 2015-01-15 21:21:26 +00:00
Emmanuel Gil Peyrot 43e699d849 Loader: Don’t duplicate the docstring into the cpp file. 2015-01-15 21:21:26 +00:00
Emmanuel Gil Peyrot bc2212106f Loader: Fix indentation, whitespace, and a few other such cosmetic stuff. 2015-01-15 21:21:25 +00:00
bunnei 3ff5a80d46 Merge pull request #481 from Subv/hm_b
APTU: Stubbed NotifyToWait, taken from 3dmoo.
2015-01-14 21:39:49 -05:00
Sebastian Valle fd1b600e05 APT: Fixed the comment style in some variables 2015-01-14 10:14:22 -05:00
bunnei 394d44cf74 Merge pull request #480 from Subv/arb_2
AddrArbiter: Implement arbitration types 3 and 4.
2015-01-14 10:04:33 -05:00
Yuri Kunde Schlesner a09f71521e GPU: Fix buffer overrun in Display Transfers
Display transfers with the horizontal downscaling flag were calculating
the wrong output size, causing them to write double the amount of data
intended. It is likely that this was perceived as correct due to a
separate bug in calculating source indices which caused the image to be
padded unless the previous bug was present.

This fixes both issues, correcting flickering issues in 3dscraft,
blargSnes and more (caused by the transfer overwriting the back buffer
which followed) as well as potentially fixing other crashes.
2015-01-14 05:20:14 -02:00
Yuri Kunde Schlesner 7630b31672 GSP: Fix appending of interrupts to the shared memory buffer
The code was previously appending the interrupt to after the end of the
buffer, instead of at the end.
2015-01-14 05:20:13 -02:00
Yuri Kunde Schlesner 9e084826b8 GPU: Do periodic VBlank updates using CoreTiming 2015-01-14 05:20:13 -02:00
Yuri Kunde Schlesner e29dd76e12 GPU: Correct wrong default framebuffer address for sub-screen.
It appears this is a mistake, since the sub-screen has no right
framebuffer.
2015-01-14 05:20:13 -02:00
Yuri Kunde Schlesner 5961a2852d GSP: Update framebuffer info on all interrupts
Hardware testing determined that the GSP processes shared memory
framebuffer update info even when no memory transfer or filling GX
commands are used. They are now updated on every interrupt, which isn't
confirmed correct but matches hardware behaviour more closely.

This also reverts the hack introduced in #404. It made a few games
behave better, but I believe it's incorrect and also breaks other games.
2015-01-14 05:20:12 -02:00
Yuri Kunde Schlesner 98e3274935 GPU: Fire GPU interrupts at the correct places.
PDC0 and PDC1 are both VBlank interrupts. PDC0 was being treated as a
HBlank interrupt and fired many more times than it should. They now both
fire together at 60 Hz. This puzzlingly *improves* apparent framerate on
many applications.

A few other interrupts were being fired inside the GSP command
processing instead of on the actual GPU register writes, so they were
moved there, which should cover direct writes tho those registers not
going through the GX command queue.
2015-01-14 05:07:35 -02:00
Subv 728c932dba APTU: Stubbed NotifyToWait, taken from 3dmoo.
Also renamed some handles in the APT:U service to be more descriptive.
Fixed a typo in InquireNotification
2015-01-13 19:18:10 -05:00
Subv 9e2ae289b8 AddrArbiter: Implement arbitration types 3 and 4. 2015-01-13 14:49:26 -05:00
Subv cf071cd897 Services: Added some missing services.
cfg:s, ptm:sysm, apt:s.
apt:s is almost exactly the same as apt:u as per 3dbrew
2015-01-13 14:43:30 -05:00
Lioncash 9288893d29 vfp: Remove dead code 2015-01-12 15:24:57 -05:00
Lioncash f7770b83d4 dyncom: Fix 32-bit ASR shifts for immediates 2015-01-12 14:15:24 -05:00
Lioncash e16b35eb53 dyncom: Remove unused flag macros 2015-01-12 12:57:15 -05:00
bunnei f3a7b66267 Merge pull request #472 from lioncash/overflow
dyncom: Fix some more V-flag setting ops. Plus some cleanup.
2015-01-12 10:35:19 -05:00
Lioncash 2843d1b98b dyncom: Get rid of unnecessary outer-scope variables in InterpreterMainLoop 2015-01-12 01:11:46 -05:00
Lioncash 3ace75a49f dyncom: Fix overflow flag setting for ADD/RSB/RSC/SUB/SBC
Also cleans up CMN, and CMP.
2015-01-12 01:03:58 -05:00
Lioncash 9c2c89b7e1 dyncom: Add a helper function for addition with a carry 2015-01-12 00:44:28 -05:00
darkf 67c644e317 Fix building on MinGW 2015-01-11 20:22:08 -08:00
Lioncash d2a05bbbc6 dyncom: Fix ADC overflow flag setting 2015-01-11 22:27:09 -05:00
bunnei b33380ca59 Merge pull request #456 from Subv/waitsync1
SVC: Wake up the thread after the delay in WaitSync1
2015-01-11 18:52:09 -05:00
Lioncash eabfa5cf43 dyncom: Fix conditional execution of MSR 2015-01-11 18:45:45 -05:00
bunnei 542b0b0057 Merge pull request #466 from Subv/wake
Thread: Prevent waking a thread multiple times.
2015-01-11 13:39:23 -05:00
Subv b68d51ed30 Thread: Prevent waking a thread multiple times.
If a thread was woken up by something, cancel the wakeup timeout.
2015-01-11 13:18:52 -05:00
Subv 38da198aa1 SVC: Wake up the thread after the delay in WaitSync1 2015-01-11 10:42:59 -05:00
archshift 3b555e2512 Stubbed y2r:u IsBusyConversion
There is no documentation available on this function, but we set the result to false as a stub.
This allows Super Little Acorns to move all the way in game with pp3c.
2015-01-10 22:47:31 -08:00
archshift 95be6ad7ae Added Archive ID to fs:USER debug logs involving opening the archive. 2015-01-10 14:32:11 -08:00
archshift 228843c43e Logging: Log all called service functions (under trace). Compile out all trace logs under release for performance. 2015-01-10 14:32:10 -08:00
Yuri Kunde Schlesner 8ad41775cc Kernel: Start using boost::intrusive_ptr for lifetime management 2015-01-09 19:43:52 -02:00
Yuri Kunde Schlesner d751de7341 Kernel: Don't re-assign object's handle when duplicating one 2015-01-09 19:43:51 -02:00
bunnei 6ae12424df Merge pull request #444 from yuriks/handle-reform2
Kernel Lifetime Reform Pt. 2
2015-01-09 12:59:35 -05:00
bunnei 86e07124ad Merge pull request #436 from kevinhartman/system-core
Warn if a new thread is intended to be run on the system CPU core
2015-01-09 11:14:35 -05:00
Yuri Kunde Schlesner 78ea76e12f Thread: Fix nullptr access in a logging function 2015-01-09 04:02:28 -02:00
Yuri Kunde Schlesner 7f1557fbbd Thread: Rename thread_queue => thread_list 2015-01-09 04:02:17 -02:00
Yuri Kunde Schlesner 9bf8462b96 Thread: Reduce use of Handles and move some funcs to inside the class. 2015-01-09 04:02:15 -02:00
Yuri Kunde Schlesner ba72208cd4 Kernel: Move Thread's definition to the header file 2015-01-09 03:51:55 -02:00
Yuri Kunde Schlesner 7b3452c730 Move ThreadContext to core/core.h and deal with the fallout 2015-01-09 03:51:55 -02:00
bunnei d46f650036 Merge pull request #255 from Subv/cbranch_3
Implemented timers
2015-01-08 22:38:33 -05:00
Subv 40c1439c34 Core: Fixed a crash and removed some unused variables.
ARM_Disasm only has static methods, so there's no need to have an instance of it.
2015-01-08 21:49:41 -05:00
Subv 07044651ef SVC: Implemented the Timer service calls. 2015-01-08 21:22:14 -05:00
Subv fc842963c8 DynCom: Add a comment to GetTicks. 2015-01-08 19:46:00 -05:00
Subv 620d77b7e3 Timing: Use CoreTiming::GetTicks to keep track of ticks.
This will keep track of idle ticks for us, and fixes some tickcount-related issues
2015-01-08 19:39:14 -05:00
bunnei cf1bbe8705 Merge pull request #443 from Subv/sleep_thread
SVC: Fixed SleepThread
2015-01-08 18:45:35 -05:00
Subv dfc440785a SVC: Fixed SleepThread.
It will now properly wait the specified number of nanoseconds and then wake up the thread.
2015-01-08 18:39:12 -05:00
bunnei 2432f317e4 Merge pull request #446 from lioncash/umaal
dyncom: Fix UMAAL
2015-01-08 11:22:20 -05:00
Lioncash 1cef6e92d5 dyncom: Fix UMAAL
These need to be done as a 64-bit operation.
2015-01-08 11:09:21 -05:00
Subv 60a373a786 Threads: Use a dummy idle thread when no other are ready.
This thread will not actually execute instructions, it will only advance the timing/events and try to yield immediately to the next ready thread, if there aren't any ready threads then it will be rescheduled and start its job again.
2015-01-07 20:31:31 -05:00
bunnei b659cac2dc Merge pull request #404 from bunnei/more-frame-synch-fixes
GPU: Toggle active framebuffer each frame
2015-01-07 18:13:48 -05:00
bunnei f7a3f45f1e GSP: Toggle active framebuffer each frame 2015-01-07 18:06:00 -05:00
bunnei e6864a1f41 Merge pull request #431 from yuriks/thread-queue-cleanup
Common: Clean up ThreadQueueList
2015-01-07 17:58:31 -05:00
Kevin Hartman 63be6aaadd Warn if a new thread is intended to be run on the system CPU core until we implement correct scheduling for such a thread. 2015-01-07 14:14:48 -08:00
bunnei 4c583732f2 Merge pull request #442 from lioncash/smul
dyncom: Fix SMULWB/SMULWT
2015-01-07 16:49:30 -05:00
Lioncash df5e0f9f28 dyncom: Fix SMULWB/SMULWT
Wasn't doing proper sign-extension
2015-01-07 16:41:08 -05:00
Yuri Kunde Schlesner 122c2bb324 Common: Clean up ThreadQueueList
Replace all the C-style complicated buffer management with a std::deque.
In addition to making the code easier to understand it also adds support
for non-POD IdTypes.

Also clean the rest of the code to follow our code style.
2015-01-07 18:38:25 -02:00
bunnei 3eca33c6a4 Merge pull request #425 from Subv/coretiming
Ported the CoreTiming namespace from PPSSPP
2015-01-07 15:30:46 -05:00
Subv 9bf82beb4c CoreTiming: Ported the CoreTiming namespace from PPSSPP
Implemented the required calls to make it work.

CoreTiming: Added a new logging class Core_Timing.
2015-01-07 15:08:35 -05:00
Yuri Kunde Schlesner a6ad68190f Fix double-free in Service manager during shutdown
Fixes #423.
2015-01-07 17:32:31 -02:00
bunnei 317fe1e528 Merge pull request #438 from lioncash/swp
dyncom: Fix SWPB
2015-01-07 09:53:29 -05:00
bunnei 5ae3a9657d Merge pull request #434 from lioncash/sm
dyncom: Move over SMLALXY
2015-01-07 09:51:06 -05:00
Lioncash 75c211c10f dyncom: Fix SWPB 2015-01-07 09:36:06 -05:00
Lioncash 511e13f3e3 dyncom: Move over SMLALXY 2015-01-07 00:53:56 -05:00
bunnei 088863c921 Merge pull request #376 from Subv/arc_reorder
Archives: Change the folder layout of some archives.
2015-01-06 20:13:56 -05:00
Subv 8fbe5d2dca Archives/Exdata: Don't set concrete_mount_point in the ctor 2015-01-06 16:12:25 -05:00
Subv 32dbb76e00 Archives: Changed the unimplemented archives comment.
It now refers to me as the PoC
2015-01-06 15:34:37 -05:00