Commit Graph

682 Commits

Author SHA1 Message Date
Maxim Poliakovski
6092882a45 ppcopcodes: fix bit test in eciwx/ecowx. 2026-02-22 18:17:29 +01:00
Tim Jarzombek
398e0b025d Fix bugs caught by fuzzing 2026-02-12 21:11:11 -05:00
joevt
60d4750d54 ppcopcodes: Decrementer fixes.
- Always add a tick to the timeout calculation.
- Make sure value of decrementer is < 0 for timed decrementer exception.
- Don't recalculate decrementer write time stamp in the case of an
  immediate decrementer exception.
2026-01-31 13:17:22 +01:00
dingusdev
213dd4c16e Update copyright info further 2026-01-30 08:12:04 -07:00
Maxim Poliakovski
0d22d5cbd8 ppcopcodes: fix decrementer interrupts.
Enable decrementer interrupts for MPC601
required by  MkLinux DR3.
2026-01-30 15:40:15 +01:00
Maxim Poliakovski
e75ee8d32a Update copyright year. 2026-01-30 12:15:00 +01:00
joevt
769ef49f67 ppcopcodes: Implement mfspr for tbl_u and tbu_u. 2026-01-29 07:53:37 -07:00
joevt
e0677a8a1f ppcexec: Add TBL_U and TBU_U for reg_op. 2026-01-29 07:53:27 -07:00
joevt
356e74f8c2 ppcdisasm: Cleanup spr calculation. 2026-01-29 07:53:17 -07:00
joevt
3e8121c1f5 ppcdisasm: Add tbl_u and tbu_u for mfspr. 2026-01-29 07:53:02 -07:00
dingusdev
742a810624 Restored floating point testing 2026-01-07 18:45:47 -07:00
joevt
be04300846 ppcexec: Add missing registers for disassembly. 2026-01-03 11:18:33 -07:00
dingusdev
a6b6fc1b61 Add missing returns to mfspr + mtspr 2025-09-15 07:54:15 -07:00
Maxim Poliakovski
049c843891 ppcopcodes: support reading the time base using TBL_S/TBU_S.
This is required by BeOS kernel.
2025-09-15 01:57:13 +02:00
joevt
2f0f264ef2 ppcdisasm: Add missing MPC601 register duplicates. 2025-07-30 21:30:31 -07:00
joevt
facbd05b9e ppcopcodes: Add missing break. 2025-07-25 07:14:05 -07:00
joevt
1b719f2d8f ppcmmu: Delete blank line. 2025-07-25 07:09:09 -07:00
joevt
1b7ec272d8 ppcmmu: Don't crash on MPC601 DBAT access. 2025-07-25 07:05:41 -07:00
Mihai Parparita
26724feff1 ppcmmu: fix tlb_flush_secondary_entry
It would iterate over all of the entries in the two-way line, but only
check the first one.

Fixes 10.1 kernel panic on boot after c317ed8b42.
2025-07-03 16:31:20 -07:00
joevt
5412fbc198 Remove superfluous semicolons. 2025-06-27 19:01:14 -07:00
Maxim Poliakovski
c317ed8b42 ppcmmu: fix TLB invalidation again. 2025-06-17 13:08:31 +02:00
Maxim Poliakovski
101d8aa885 ppcmmu: fix TLB invalidation.
The PowerPC manual says that `tlbie` only considers
bits 4-19 of the EA. Set the mask accordingly.
2025-05-21 18:42:57 +02:00
joevt
6c430b7d83 poweropcodes: Use ROTR_32 where possible. 2025-04-24 19:16:43 -07:00
dingusdev
2ce4e13170 ROTL_32 header fixes 2025-04-24 06:36:11 -07:00
joevt
746f461c5b ppcopcodes: Use ROTL_32 where possible. 2025-04-24 06:34:52 -07:00
joevt
5b3043c372 ppcfpopcodes: Remove redundant expression. 2025-04-24 06:33:22 -07:00
dingusdev
c1ed416b58 Revert "display: Remove resizing flag."
This reverts commit c781ba8fab.
2025-04-23 21:08:45 -07:00
joevt
c781ba8fab display: Remove resizing flag.
It doesn't do anything useful yet and setting the resizing flag to true stops updates if the window doesn't actually change size.
2025-04-23 06:50:24 -07:00
joevt
c6013f076a ppcmmu: Fix DMA for adjacent cross region ranges.
If a DMA range extends beyond the end of a region into a second region of the same type (either RAM or ROM), and the regions are adjacent in both the guest and host address spaces, then allow the DMA to proceed.
2025-04-23 06:32:28 -07:00
joevt
9c6a7de45f ppcopcodes: Remove unnecessary type casts. 2025-04-23 06:15:38 -07:00
joevt
47c66666bb display: Add zoom and fullscreen no letterbox.
Added a third full screen mode which removes letterbox or pillarbox black bars.
Added Control-- and control-+ to decrease or increase the scale by a factor of 2^(1/8). This means the scale doubles or halves after pressing the same key 8 times.

drawable_w and drawable_h are floating point so that scaling is reversible (i.e. scaling from 100% to 800% and back to 100% gives 100% instead of 99 or 101%).
default_scale_x

Handle switching host resolution between Retina (HiDPI) and Low resolution modes. This involves updating the window scale factor.

Add window scale factor to window title.
2025-04-22 06:36:04 -07:00
dingusdev
88b5b2ec66 Prep for Alpha 1.0.3 2025-04-18 21:22:19 -07:00
Maxim Poliakovski
d315624d54 ppcopcodes: refactor rfi to reduce code duplication. 2025-04-16 00:58:27 +02:00
joevt
ec6fa9360c ppcopcodes: Cleanup ppc_rfi.
Reduce the number of operations by 1
and make more clear what is happening.
2025-04-16 00:51:13 +02:00
joevt
0fe6ffeb6f ppcemu: reformat and extend MSR enum. 2025-04-15 18:52:52 +02:00
joevt
b280da81bc ppc: Timing calculation changes.
Note: all timings are relative to virtual time which is 16 ns per instruction. 8 ns per instruction is too fast for the PDM 'mach' gestalt calculation in firmware.

- For MPC601, bit 7 of RTC and DEC changes at 7.8336 MHz so bit 0 would change at 1.0027008 GHz. Therefore multiply time base frequency by 128. For MPC601, DEC now changes at 1.0027008 GHz instead of 7.8336 MHz.
- Add tbr_freq_shift for cases where time base frequency exceeds 1GHz.
- Change calc_rtcl_value to use time base frequency. For MPC601, RTC now changes at 1.0027008 GHz instead 1GHz.
- For MPC601, the 7 least significant bits of DEC are not implemented so make them not getable or setable.
2025-04-08 19:46:48 -07:00
joevt
6363eef32f ppcexec: Make opcode macros depend on OPr. 2025-04-08 19:46:20 -07:00
joevt
ba9bbb32c3 Catch all errors for debug read/write methods. 2025-03-23 16:14:31 -07:00
dingusdev
130beabf2a Re-insert code for tlbia
BeOS uses this as part of its boot handler.
2025-03-21 18:57:17 -07:00
dingusdev
a7170f4956 Removing code for tlbia
Seems to be causing a regression in Mac OS X 10.0
2025-03-21 18:42:56 -07:00
joevt
ae605157db debugger: Add fregs command. 2025-03-10 07:15:44 -07:00
dingusdev
6e74146466 Don't forget to update CR1 in edge case of fdiv 2025-03-02 10:42:31 -07:00
dingusdev
a972bd26f7 Corrected handling of MMU Mode 1 2025-03-02 10:41:42 -07:00
dingusdev
b09dfa22ec Fix regression in fdiv(s)(.) 2025-03-01 15:18:24 -07:00
dingusdev
f3dec30c27 Add missing PR bit checks 2025-02-26 20:40:41 -07:00
dingusdev
a848eb9e76 Fixed accidental removal in ppc_exec_until 2025-02-16 06:35:24 -07:00
dingusdev
d82d9ac7b9 Added missing header - chrono 2025-02-15 16:02:32 -07:00
joevt
82a48899f0 Change ppc_opcode_grabber to a variable. 2025-02-10 07:01:32 -07:00
joevt
2f30395d00 Break long lines.
Make them 130 characters or less.
2025-01-30 06:30:51 -07:00
Mihai Parparita
134339ae9d Mitigate performance impact of respecting FP bit
In #135 we switched from a static OpcodeGrabber table to a
curOpcodeGrabber pointer in ppc_main_opcode. This results in an extra
indirection (as far as generated assembly having an additional load),
which reduces execution speed.

Switch to making the opcode grabber into a parameter to
ppc_main_opcode, and make ppc_exec_inner keep it up to date (via an
EXEF_OPCODE exception flag).

Also fixes FPU instructions in ppctests - we now need to set the FP
MSR bit when initializing the CPU.
2025-01-25 17:58:31 -08:00