Commit Graph

67 Commits

Author SHA1 Message Date
joevt
19adb54cd8 Fix compiler warnings.
These were detected by github Actions but not by Xcode.
2023-01-11 01:17:13 -08:00
joevt
5294a8b71c Fix compiler warnings: unused variables. 2023-01-11 01:17:12 -08:00
joevt
46bc8567e9 Fix compiler warnings: uninitialized variables.
- mpc601_block_address_translation will now return 0 for prot and pa when bat_hit is false (when the if statement is not positive during the for loop). The calling function doesn't care what prot and pa are when bat_hit is false, but we do this to remove the compiler warining.
- For tlb_flush_entry, the compiler thinks m might not always be in the range 0 to 5 so tlb1 and tlb2 might not get initialized by the switch statement. Add default to get around this warning.
2023-01-11 01:17:12 -08:00
joevt
64fec88436 Fix compiler warnings: cast loses precision.
Use explicit cast when converting large integer types to smaller integer types when it is known that the most significant bytes are not required.
For pcidevice, check the ROM file size before casting to int. We'll allow expansion ROM sizes up to 4MB but usually they are 64K, sometimes 128K, rarely 256K.
for machinefactory, change the type to size_t so that it can correctly get the size of files that are larger than 4GB; it already checks the file size is 4MB before we need to cast to uint32_t.
For floppyimg, check the image size before casting to int. For raw images, only allow files up to 2MB. For DiskCopy42 images, it already checks the file size, so do the cast after that.
2023-01-11 01:17:12 -08:00
Maxim Poliakovski
648dfcd47b ppcmmu: fix BAT state updates. 2022-12-20 14:58:45 +01:00
Maxim Poliakovski
9f4c248e4c Rework DBDMA logic for bidirectional channels. 2022-11-17 18:03:18 +01:00
joevt
b76bfedf4b Remove unnecessary linefeeds from log
To remove blank lines in the dingusppc.log file or in the console output when -d is used.
2022-08-14 05:26:56 -07:00
Maxim Poliakovski
fd33c10712 ppcmmu.cpp: remove unused local variables. 2021-12-07 23:23:39 +01:00
Maxim Poliakovski
c0cd6eb38f Add missing licence headers, update license date. 2021-10-23 21:00:31 +02:00
Maxim Poliakovski
9329d56d83 Move devices into dedicated subdirectories. 2021-10-23 20:17:47 +02:00
Maxim Poliakovski
2a9d364b1b ppcmmu: implement separate TLB pointers for read/write. 2021-10-10 22:01:02 +02:00
Maxim Poliakovski
3eb2d3cba7 ppcmmu: verbose MMU state with mmu_print_regs(). 2021-10-10 22:01:02 +02:00
Maxim Poliakovski
bde5b71167 ppcmmu: re-arrange code to avoid formward declarations. 2021-10-10 22:01:02 +02:00
Maxim Poliakovski
bb0ca2ac40 ppcmmu: fix TLB flushing. 2021-10-10 22:01:02 +02:00
Maxim Poliakovski
b4d399ffa2 Improve three logging messages. 2021-09-30 23:01:56 +02:00
Maxim Poliakovski
22827642e4 ppcmmu: implement 601-style BAT. 2021-09-27 12:37:35 +02:00
Maxim Poliakovski
f104a634ea ppcmmu: some more cleanup. 2021-09-26 14:20:46 +02:00
Maxim Poliakovski
81ea96a058 ppcmmu.cpp: fix includes. 2021-09-25 23:38:27 +02:00
Maxim Poliakovski
212cd58f40 ppcmmu: refactor and clean up. 2021-09-25 19:13:40 +02:00
Maxim Poliakovski
5b54cd69ef ppcmmu: better fatal error handling with ABORT_F. 2021-09-25 19:13:40 +02:00
Maxim Poliakovski
501f24f0d3 ppcmmu: implement SoftTLB for instructions. 2021-09-25 19:13:40 +02:00
Maxim Poliakovski
2a79c9a63c ppcmmu.c: restructure and clean up. 2021-09-25 19:13:40 +02:00
Maxim Poliakovski
a8f400287a Add TLB profiling. 2021-08-22 17:34:23 +02:00
Maxim Poliakovski
089645e830 Implement SoftTLB for writes. 2021-08-22 17:34:23 +02:00
Maxim Poliakovski
4da95a66d7 Make emulated memory loads to use SoftTLB. 2021-06-20 22:33:10 +02:00
Maxim Poliakovski
7d8f4d4e61 Finalize SoftTLB for reads. 2021-05-16 22:00:00 +02:00
Maxim Poliakovski
a5ddb51a3b ppcmmu: initial TLB implementation for reads. 2021-05-16 00:53:15 +02:00
Maxim Poliakovski
0c1c59ffa7 ppcmmu: set type of the profiling variables to uint64_t. 2021-04-29 01:30:27 +02:00
Maxim Poliakovski
085877a8bf ppcmmu: add MMU profiling (disabled by default). 2021-04-18 20:49:58 +02:00
Maxim Poliakovski
bc59bf7c43 ppcmmu: replace macros with function templates. 2021-04-18 20:05:15 +02:00
Maxim Poliakovski
0375b6a687 ppcmmu: invert BAT mask to speed up match. 2021-04-11 02:03:20 +02:00
Maxim Poliakovski
d545780071 ppcmmu: fix calculation for BAT access_bits. 2021-04-10 23:51:00 +02:00
Maxim Poliakovski
7628ec92c0 Rename memreadwrite.h to memaccess.h 2021-02-03 12:19:18 +01:00
Maxim Poliakovski
a775007d3a MMU: implement misaligned cross-page accesses. 2020-11-29 00:23:30 +01:00
Maxim Poliakovski
2b19b0b237 ppcmmu: better initialization of last used entries. 2020-11-14 02:57:36 +01:00
Waqar Ahmed
0ab9380be3 clang-format everything 2020-05-12 23:55:45 +05:00
Maxim Poliakovski
695044cf0e Support more than one I/O region per device. 2020-03-31 18:48:04 +02:00
dingusdev
60ffa5bfac Initial attempt at fixing SDL2 building for Windows 2020-03-22 20:15:12 -07:00
Maxim Poliakovski
8e34c1657c Mock up DBDMA channel execution for sound. 2020-03-19 02:00:18 +01:00
Maxim Poliakovski
9be3250142 Fix MMU region bounds check. 2020-03-15 20:08:53 +01:00
dingusdev
e31f7873f5 Fixed redunant variable names for PPC emulation. 2020-03-04 21:29:04 -07:00
dingusdev
354409812e Updating files with proper licensing header 2020-02-28 09:04:28 -07:00
dingusdev
d91950e582 Further logging code. 2020-02-23 22:36:31 -07:00
Maxim Poliakovski
461d859e73 ppcmmu: add debug memory reading function.
This function saves and restores the MMU state
so no invalid user input can break CPU execution.
2020-02-23 16:41:58 +01:00
Maxim Poliakovski
fe57beb983 Revert "Disassembler added"
This reverts commit 37078ddfe1.
2020-02-04 14:20:10 +01:00
dingusdev
37078ddfe1 Disassembler added
Created by maximumspatium, with some additions by me.
2020-02-03 08:03:24 -07:00
Maxim Poliakovski
043aedb9ad ppcmmu: implement BAT protection. 2020-01-30 00:57:45 +01:00
Maxim Poliakovski
354b7b65be ppcmmu: handle unaligned reads and writes. 2020-01-30 00:45:39 +01:00
dingusdev
aa20d64b48 SPRs now use symbolic names 2020-01-27 20:39:23 -07:00
Maxim Poliakovski
2953eaa538 Restructure main.cpp, remove obsolete code. 2020-01-28 02:20:43 +01:00