Rekai Nyangadzayi Musuka
3e25a7f595
fix: resolve timing regressions
...
make sure to use fetch timings when fetching instructions
2022-09-28 17:25:21 -03:00
Rekai Nyangadzayi Musuka
e16c2df8d0
fix: rename Pipline to Pipeline
2022-09-28 16:37:40 -03:00
Rekai Nyangadzayi Musuka
14ba0dbca9
feat: working pipeline implementation
2022-09-28 16:11:25 -03:00
Rekai Nyangadzayi Musuka
f466ae2ae2
chore: refactor ARM/THUMB data processing instructions
2022-09-28 12:47:44 -03:00
Rekai Nyangadzayi Musuka
f616ed29d1
fix: don't flush pipeline when reloading CPSR in ARM Data Processing
2022-09-28 12:47:44 -03:00
Rekai Nyangadzayi Musuka
f13b08b527
chore: don't write to CPSR + swap with SPSR at the same time
2022-09-28 10:01:52 -03:00
Rekai Nyangadzayi Musuka
750fdb65ae
fix: account for pipeline in obscure bios behaviour
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
be3ce71a96
fix: advance r15, even when the pipeline is reloaded from the scheduler
...
The PC would fall behind whenever an IRQ was called because the pipeline
was reloaded (+8 to PC), however that was never actually done by any code
Now, the PC is always incremented when the pipeline is reloaded
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
8e2022dffd
chore: dump pipeline state on cpu panic
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
0fe164db11
fix: reimpl THUMB.5 instructions
...
pipeline branch now passes arm.gba and thumb.gba again
(TODO: Stop rewriting my commits away)
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
41f10c6c12
fix: impl workaround for stage2 miscompilation
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
d5acfb6eb0
chore: instantly refill the pipeline on flush
...
I believe this to be necessary in order to get hardware interrupts
working.
thumb.gba test 108 fails but I'm committing anyways (despite the
regression) because this is kind of rebase/merge hell and I have
something that at least sort of works rn
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
6428be5f22
fix: reimpl handleInterrupt code
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
1d09554ea4
feat: implement basic pipeline
...
passes arm.gba, thumb.gb and armwrestler, fails in actual games
TODO: run FuzzARM debug specific titles
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
66ad155a76
feat: resolve off-by-{word, halfword} errors when printing debug info
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
1fa855d8b5
feat: reimplement cpu logging
2022-09-26 16:26:45 -03:00
Rekai Nyangadzayi Musuka
92cfc763c0
chore: move util.zig
2022-09-19 16:07:19 -03:00
Rekai Nyangadzayi Musuka
e192c6712f
chore: disable audio sync by default
...
forgot SDL2 AudioStream doesn't work well for my use-case
2022-09-18 09:20:01 -03:00
Rekai Nyangadzayi Musuka
3466bf6c0a
chore: change default settings
2022-09-18 06:30:39 -03:00
Rekai Nyangadzayi Musuka
fbe3de0eb3
chore: reimpl util.escape
...
should make use of stdlib when I can
2022-09-18 06:23:30 -03:00
Rekai Nyangadzayi Musuka
4af144fca2
fix: Detect FRAM ROMs
2022-09-18 06:19:05 -03:00
Rekai Nyangadzayi Musuka
9a8aaba1ab
chore: improve util and Gui API
2022-09-18 05:55:15 -03:00
Rekai Nyangadzayi Musuka
fa3b9c21b9
chore: move Gpio and Clock structs to separate file
2022-09-18 00:37:45 -03:00
Rekai Nyangadzayi Musuka
50adb5fbac
feat: add option to force-enable RTC
2022-09-17 20:27:17 -03:00
Rekai Nyangadzayi Musuka
19d78b9292
feat: auto-detect RTC in commercial ROMS
2022-09-17 20:23:49 -03:00
Rekai Nyangadzayi Musuka
a2e702c366
fix: account for lateness in RTC scheduler event
2022-09-17 09:07:31 -03:00
Rekai Nyangadzayi Musuka
12c138364d
fix: RTC day is 6 bits wide, not 3
2022-09-16 10:59:41 -03:00
Rekai Nyangadzayi Musuka
7783c11fac
feat: put RTC Sync on Scheduler
...
TODO: Database to see what games have what GPIO devices
2022-09-16 10:39:02 -03:00
Rekai Nyangadzayi Musuka
3fc3366c8a
chore: import datetime library + default time for RTC
2022-09-16 10:39:02 -03:00
Rekai Nyangadzayi Musuka
d6b182f245
fix: ignore RTC Time/DateTime writes
...
this falls in-line with better emulators
2022-09-16 10:39:02 -03:00
Rekai Nyangadzayi Musuka
3857c44e68
chore: use Clock.Writer for Command parsing, delete Clock.Command
2022-09-16 10:39:02 -03:00
Rekai Nyangadzayi Musuka
089c5fa025
feat: implement RTC Read/Writes
2022-09-16 10:39:02 -03:00
Rekai Nyangadzayi Musuka
c977f3f965
feat: implement force irqs for GPIO/RTC
2022-09-16 10:38:51 -03:00
Rekai Nyangadzayi Musuka
92417025e9
fix: properly resovle stack UAF
2022-09-16 02:10:41 -03:00
Rekai Nyangadzayi Musuka
1c52c0bf91
chore: shorten `orelse @panic` to `.?`
2022-09-16 02:10:41 -03:00
Rekai Nyangadzayi Musuka
617f7f4690
fix: update GpioData extern union
...
u4's are no longer supported in extern unions :\
2022-09-16 02:10:41 -03:00
Rekai Nyangadzayi Musuka
434a0dfac9
tmp: incomplete impl of GPIO + RTC
2022-09-16 02:10:41 -03:00
Rekai Nyangadzayi Musuka
4ec8dab460
chore: Guilty Gear X expects these I/O Registers
2022-09-14 11:38:26 -03:00
Rekai Nyangadzayi Musuka
59c9ff910e
feat: implement open bus for unmapped i/o
2022-09-12 23:18:29 -03:00
Rekai Nyangadzayi Musuka
0027d3f8a3
chore: comment open bus impl
2022-09-11 07:38:55 -03:00
Rekai Nyangadzayi Musuka
65cfc97f28
feat: reimplement audio sync
...
APU will now drop samples if the Audio Queue is already full, therefore
creating a "sped-up" effect when the emulator runs faster than 100%
2022-09-08 20:38:42 -03:00
Rekai Nyangadzayi Musuka
fa862f095a
chore: move arm/thumb lut idx functions
2022-09-06 23:58:24 -03:00
Rekai Nyangadzayi Musuka
3fb7f2f814
chore: better conform to zig idioms
2022-09-03 18:30:48 -03:00
Rekai Nyangadzayi Musuka
59669ba3a5
chore: rename arm7tdmi variables to just cpu
...
Less verbose, specifying arm7tdmi doesn't really do much when there's
no other CPU in the system
2022-09-03 17:56:37 -03:00
Rekai Nyangadzayi Musuka
6a798d2c9d
chore: allocate sprite array on heap
...
Each Sprite optional is 10 bytes meaning I'm allocating 1.28Kb on the
stack which isn't necessary.
2022-08-29 01:07:25 -05:00
Rekai Nyangadzayi Musuka
5f8c6833f4
chore: improve init/deinit methods
2022-08-29 01:07:25 -05:00
Rekai Nyangadzayi Musuka
aa52bb5917
chore: reorganize some code
2022-08-26 14:13:49 -05:00
Rekai Nyangadzayi Musuka
e57f918856
chore: pass the allocator as an argument more often
...
As of right now, I think the only cases where I shouldn't explicitly pass an allocator
are in read/write functions and deinits
2022-08-26 13:54:38 -05:00
Rekai Nyangadzayi Musuka
e5b7441740
fix: resolve use-afer-free in backup.zig
...
This worked fine on stage1, and works fine in debug in stage3.
However, stage3 ReleaseSafe would panic due to what I assume must
have been an undefined behaviour optimization.
While I'm happy that I was quickly made aware of the issue thanks to
the safety checks in ReleaseSafe I do wish that this issue showed itself
in Debug, since I *am* using the GPA
2022-08-26 13:04:09 -05:00
Rekai Nyangadzayi Musuka
2ab8769b7a
feat: Get ZBA working on Zig's new stage2/stage3 compiler
2022-08-21 12:28:31 -05:00