Rekai Nyangadzayi Musuka
9436888b28
chore(gitignore): update .gitignore
...
sometimes I'm left with a src/zig-cache, and I want to
just make sure that I never-ever end up commiting that
2022-10-21 05:13:13 -03:00
Rekai Nyangadzayi Musuka
583ed54ee3
feat: write default config.toml if it doesn't exist
...
also resolves panic on missing /zba or /zba/save directory by ensuring
those directories exist as soon as we know the data directory
2022-10-21 05:13:13 -03:00
Rekai Nyangadzayi Musuka
7944cd7abc
chore: update README
2022-10-21 05:13:13 -03:00
Rekai Nyangadzayi Musuka
ffd94c96ce
Merge pull request 'Configure SDL2 to use OpenGL' ( #4 ) from opengl into main
...
Reviewed-on: #4
2022-10-21 05:13:13 -03:00
Rekai Nyangadzayi Musuka
4fe612da61
fix(opengl): properly control whether vsync is enabled
2022-10-21 05:13:12 -03:00
Rekai Nyangadzayi Musuka
4262688fa8
chore(ppu): remove BGR555 -> RGBA888 LUT
...
LUT probably couldn't fit in CPU cache anyways.
TODO: Consider whether LUTs for separate channels (size 32 * 3 * 3
instead of std.math.maxInt(u15))
2022-10-21 05:13:12 -03:00
Rekai Nyangadzayi Musuka
35d685f032
chore: replace OpenGL 4.5 bindings with OpenGL 3.3
2022-10-21 05:13:12 -03:00
Rekai Nyangadzayi Musuka
5b9d3d0960
chore: remove unnecessary ptr cast
2022-10-21 05:13:12 -03:00
Rekai Nyangadzayi Musuka
44b2e9be88
chore(gpio): add missing errdefer
2022-10-21 05:13:11 -03:00
Rekai Nyangadzayi Musuka
4b7ef52a7a
feat: implement better Colour Emulation
2022-10-21 05:13:11 -03:00
Rekai Nyangadzayi Musuka
5103fdf646
chore(main): report errors slightly better
2022-10-21 05:13:11 -03:00
Rekai Nyangadzayi Musuka
acddaf76aa
fix: lower required OpenGL version + resolve offset bug
2022-10-21 05:13:11 -03:00
Rekai Nyangadzayi Musuka
3da3b69e13
feat: use opengl
...
TODO:
- Texture isn't scaling properly
- I need to reverse the colours in the frag shader
2022-10-21 05:13:11 -03:00
Rekai Nyangadzayi Musuka
40062d4dfe
chore(config): add log message
2022-10-21 05:13:10 -03:00
Rekai Nyangadzayi Musuka
1c91b497bc
feat(config): add option to skip BIOS
2022-10-21 05:13:10 -03:00
Rekai Nyangadzayi Musuka
e3286a9872
feat(cli): Add option to skip BIOS
2022-10-21 05:13:10 -03:00
Rekai Nyangadzayi Musuka
ddb0e2f928
chore: Update README.md
2022-10-21 05:13:10 -03:00
Rekai Nyangadzayi Musuka
d927ee6c90
Merge pull request 'Draft: Implement Instruction Pipeline' ( #3 ) from pipeline into main
...
Reviewed-on: #3
2022-10-21 05:13:10 -03:00
Rekai Nyangadzayi Musuka
011f105bee
feat(config): add config option to mute ZBA
2022-10-21 05:13:09 -03:00
Rekai Nyangadzayi Musuka
2c88f9bbce
fix(bios): set addr_latch even if bios is skipped
2022-10-21 05:13:09 -03:00
Rekai Nyangadzayi Musuka
30c5fafec1
chore(config): add example config file
2022-10-21 05:13:09 -03:00
Rekai Nyangadzayi Musuka
3b144e581a
fix(bus): make open bus impl aware of CPU pipeline
2022-10-21 05:13:09 -03:00
Rekai Nyangadzayi Musuka
0117a52f4d
style(bus): cpu ptr doesn't need to be optional
2022-10-21 05:13:09 -03:00
Rekai Nyangadzayi Musuka
3cf7c83269
style: code cleanup
2022-10-21 05:13:09 -03:00
Rekai Nyangadzayi Musuka
85d4690c56
fix: resolve timing regressions
...
make sure to use fetch timings when fetching instructions
2022-10-21 05:13:08 -03:00
Rekai Nyangadzayi Musuka
130d40bc7f
fix: rename Pipline to Pipeline
2022-10-21 05:13:08 -03:00
Rekai Nyangadzayi Musuka
2c928eafec
feat: working pipeline implementation
2022-10-21 05:13:08 -03:00
Rekai Nyangadzayi Musuka
dcbeeee7cc
chore: refactor ARM/THUMB data processing instructions
2022-10-21 05:13:08 -03:00
Rekai Nyangadzayi Musuka
84ccb7224b
fix: don't flush pipeline when reloading CPSR in ARM Data Processing
2022-10-21 05:13:08 -03:00
Rekai Nyangadzayi Musuka
dd4bb4ff03
chore: don't write to CPSR + swap with SPSR at the same time
2022-10-21 05:13:07 -03:00
Rekai Nyangadzayi Musuka
ecbfe67b27
chore: update README.md
2022-10-21 05:13:07 -03:00
Rekai Nyangadzayi Musuka
e29c20019d
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-10-21 05:13:07 -03:00
Rekai Nyangadzayi Musuka
d8c397248f
chore: dump pipeline state on cpu panic
2022-10-21 05:13:07 -03:00
Rekai Nyangadzayi Musuka
64aed01869
fix: reimpl THUMB.5 instructions
...
pipeline branch now passes arm.gba and thumb.gba again
(TODO: Stop rewriting my commits away)
2022-10-21 05:13:07 -03:00
Rekai Nyangadzayi Musuka
29f2a0288f
fix: impl workaround for stage2 miscompilation
2022-10-21 05:13:07 -03:00
Rekai Nyangadzayi Musuka
27ada16377
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-10-21 05:13:06 -03:00
Rekai Nyangadzayi Musuka
ad1cec58e7
fix: reimpl handleInterrupt code
2022-10-21 05:13:06 -03:00
Rekai Nyangadzayi Musuka
97d9edab93
feat: implement basic pipeline
...
passes arm.gba, thumb.gb and armwrestler, fails in actual games
TODO: run FuzzARM debug specific titles
2022-10-21 05:13:06 -03:00
Rekai Nyangadzayi Musuka
39f56e6d8a
feat: resolve off-by-{word, halfword} errors when printing debug info
2022-10-21 05:13:06 -03:00
Rekai Nyangadzayi Musuka
f0014e7179
feat: reimplement cpu logging
2022-10-21 05:13:06 -03:00
Rekai Nyangadzayi Musuka
8a804ea05e
Merge pull request 'Add TOML Support' ( #2 ) from toml into main
...
Reviewed-on: #2
2022-10-21 05:13:05 -03:00
Rekai Nyangadzayi Musuka
efce1a6dce
chore(emu): refactor code
2022-10-21 05:13:05 -03:00
Rekai Nyangadzayi Musuka
8b9ab6f4b5
feat(config): add support for (and read from) TOML config file
2022-10-21 05:13:05 -03:00
Rekai Nyangadzayi Musuka
d21c860eb5
feat: parse config.toml in data folder
...
Also took the chance to rework parts of the logic that determines
ZBA's save path
2022-10-21 05:13:05 -03:00
Rekai Nyangadzayi Musuka
85e670a1d7
chore: add zig-toml dependency
2022-10-21 05:13:05 -03:00
Rekai Nyangadzayi Musuka
4f823217bd
chore: update dependencies
2022-10-21 05:13:04 -03:00
Rekai Nyangadzayi Musuka
207a99edbe
style: improve code quality
2022-10-21 05:13:04 -03:00
Rekai Nyangadzayi Musuka
3c5b30dece
feat: rewrite device ticks
2022-10-21 05:13:04 -03:00
Rekai Nyangadzayi Musuka
739d38533a
style(scheduler): rename scheduler event handlers
2022-10-21 05:13:04 -03:00
Rekai Nyangadzayi Musuka
ae6b8e2f03
style: code refactoring
2022-10-21 05:13:04 -03:00
Rekai Nyangadzayi Musuka
208f4b522d
style(apu): split apu.zig into multiple files + refactor
2022-10-21 05:13:03 -03:00
Rekai Nyangadzayi Musuka
bd54700103
style(backup): refactor code
2022-10-21 05:13:03 -03:00
Rekai Nyangadzayi Musuka
08d27520e0
style(flash): move flash code into it's own file
2022-10-21 05:13:03 -03:00
Rekai Nyangadzayi Musuka
bfe97c671e
style(eeprom): move eeprom code to it's own file
2022-10-21 05:13:03 -03:00
Rekai Nyangadzayi Musuka
9baadadba2
style(bus): refactor several hardware abstractions
2022-10-21 05:13:03 -03:00
Rekai Nyangadzayi Musuka
68a87e0a54
chore: SDL2.zig expects target to be set before link() is called
2022-10-21 05:13:02 -03:00
Rekai Nyangadzayi Musuka
1d7dfe71ca
chore: update dependencies
2022-10-21 05:13:02 -03:00
Rekai Nyangadzayi Musuka
1acc5e35e9
chore: move util.zig
2022-10-21 05:13:02 -03:00
Rekai Nyangadzayi Musuka
df73cdbecc
chore: disable audio sync by default
...
forgot SDL2 AudioStream doesn't work well for my use-case
2022-10-21 05:13:02 -03:00
Rekai Nyangadzayi Musuka
6738dfac85
chore: change default settings
2022-10-21 05:13:02 -03:00
Rekai Nyangadzayi Musuka
11985f4019
chore: reimpl util.escape
...
should make use of stdlib when I can
2022-10-21 05:13:02 -03:00
Rekai Nyangadzayi Musuka
7cad3aca13
fix: Detect FRAM ROMs
2022-10-21 05:13:01 -03:00
Rekai Nyangadzayi Musuka
2bbc12cd1a
chore: improve util and Gui API
2022-10-21 05:13:01 -03:00
Rekai Nyangadzayi Musuka
270db2b5ff
chore: move Gpio and Clock structs to separate file
2022-10-21 05:13:01 -03:00
Rekai Nyangadzayi Musuka
bce46418cd
Merge pull request 'Implement RTC' ( #1 ) from rtc into main
...
Reviewed-on: #1
2022-10-21 05:13:01 -03:00
Rekai Nyangadzayi Musuka
2d9b03a725
feat: add option to force-enable RTC
2022-10-21 05:13:01 -03:00
Rekai Nyangadzayi Musuka
c34752ac65
feat: auto-detect RTC in commercial ROMS
2022-10-21 05:13:00 -03:00
Rekai Nyangadzayi Musuka
60680a36e2
fix: account for lateness in RTC scheduler event
2022-10-21 05:13:00 -03:00
Rekai Nyangadzayi Musuka
4111bb5e4f
fix: RTC day is 6 bits wide, not 3
2022-10-21 05:13:00 -03:00
Rekai Nyangadzayi Musuka
612f5fe30e
feat: put RTC Sync on Scheduler
...
TODO: Database to see what games have what GPIO devices
2022-10-21 05:13:00 -03:00
Rekai Nyangadzayi Musuka
d9776e99d3
chore: import datetime library + default time for RTC
2022-10-21 05:13:00 -03:00
Rekai Nyangadzayi Musuka
960efcd428
fix: ignore RTC Time/DateTime writes
...
this falls in-line with better emulators
2022-10-21 05:13:00 -03:00
Rekai Nyangadzayi Musuka
b07dc8484d
chore: use Clock.Writer for Command parsing, delete Clock.Command
2022-10-21 05:12:59 -03:00
Rekai Nyangadzayi Musuka
ebcae80a9d
feat: implement RTC Read/Writes
2022-10-21 05:12:59 -03:00
Rekai Nyangadzayi Musuka
ff8ea79620
feat: implement force irqs for GPIO/RTC
2022-10-21 05:12:59 -03:00
Rekai Nyangadzayi Musuka
fe19b19fc7
fix: properly resovle stack UAF
2022-10-21 05:12:59 -03:00
Rekai Nyangadzayi Musuka
e709c2030c
chore: shorten `orelse @panic` to `.?`
2022-10-21 05:12:59 -03:00
Rekai Nyangadzayi Musuka
5725bbbe35
fix: update GpioData extern union
...
u4's are no longer supported in extern unions :\
2022-10-21 05:12:59 -03:00
Rekai Nyangadzayi Musuka
8553ab6e6d
chore: Guilty Gear X expects these I/O Registers
2022-10-21 05:12:58 -03:00
Rekai Nyangadzayi Musuka
372bfdc5f6
tmp: incomplete impl of GPIO + RTC
2022-10-21 05:12:58 -03:00
Rekai Nyangadzayi Musuka
fad5c9e632
feat: implement open bus for unmapped i/o
2022-10-21 05:12:58 -03:00
Rekai Nyangadzayi Musuka
5fb5247d0e
chore: comment open bus impl
2022-10-21 05:12:58 -03:00
Rekai Nyangadzayi Musuka
75be6aa82a
chore: update dependencies
2022-10-21 05:12:58 -03:00
Rekai Nyangadzayi Musuka
0b8cc30d4d
chore: Update README.md
2022-10-21 05:12:58 -03:00
Rekai Nyangadzayi Musuka
d2a50cf9d2
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-10-21 05:12:57 -03:00
Rekai Nyangadzayi Musuka
b2386a6a2b
chore: move arm/thumb lut idx functions
2022-10-21 05:12:57 -03:00
Rekai Nyangadzayi Musuka
22fbe380eb
chore: update dependencies
2022-10-21 05:12:57 -03:00
Rekai Nyangadzayi Musuka
f2b27f31f4
chore: better conform to zig idioms
2022-10-21 05:12:57 -03:00
Rekai Nyangadzayi Musuka
867025b1ec
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-10-21 05:12:57 -03:00
Rekai Nyangadzayi Musuka
9b0f54b111
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-10-21 05:12:56 -03:00
Rekai Nyangadzayi Musuka
4cf58f1faa
chore: improve init/deinit methods
2022-10-21 05:12:56 -03:00
Rekai Nyangadzayi Musuka
1a56f957c1
chore: reorganize some code
2022-10-21 05:12:56 -03:00
Rekai Nyangadzayi Musuka
1a4a2a56a3
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-10-21 05:12:56 -03:00
Rekai Nyangadzayi Musuka
c701156ce6
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-10-21 05:12:56 -03:00
Rekai Nyangadzayi Musuka
4b6897aedf
feat: Get ZBA working on Zig's new stage2/stage3 compiler
2022-10-21 05:12:55 -03:00
Rekai Nyangadzayi Musuka
1471288969
chore: move window scale const to emu.zig
2022-10-21 05:12:55 -03:00
Rekai Nyangadzayi Musuka
7488fd7fd5
fix: reimpl debug reads w/out throwing away *const Self
2022-10-21 05:12:55 -03:00
Rekai Nyangadzayi Musuka
20056eff2c
chore: update dependencies:
2022-10-21 05:12:55 -03:00
Rekai Nyangadzayi Musuka
3f760fccaf
feat: reimplement cpu logging
2022-10-21 05:12:55 -03:00
Rekai Nyangadzayi Musuka
f833de765c
chore: don't init bus in Arm7tdmi init
2022-10-21 05:12:55 -03:00
Rekai Nyangadzayi Musuka
aa19ef5f71
feat: move arm instr decoding to module
2022-10-21 05:12:54 -03:00
Rekai Nyangadzayi Musuka
f0284107f9
feat: move thumb instr decoding to module
2022-10-21 05:12:54 -03:00
Rekai Nyangadzayi Musuka
91c94fe528
chore: change directory structure
2022-10-21 05:12:54 -03:00
Rekai Nyangadzayi Musuka
45fc49b216
fix: reimplement halt fast-forwarding
2022-10-21 05:12:54 -03:00
Rekai Nyangadzayi Musuka
0939d6d7bc
chore: move audio sync, video sync variables
2022-10-21 05:12:53 -03:00
Rekai Nyangadzayi Musuka
e7b5410509
chore: update README.md
2022-10-21 05:12:53 -03:00
Rekai Nyangadzayi Musuka
2758e511ea
chore: update SDL.zig
2022-10-21 05:12:53 -03:00
Rekai Nyangadzayi Musuka
46ee21f464
feat: impl WININ, WINOUT, WIN{N}H and WIN{N}V
2022-10-21 05:12:53 -03:00
Rekai Nyangadzayi Musuka
0287c9a260
fix: force align DMA transfers
2022-10-21 05:12:53 -03:00
Rekai Nyangadzayi Musuka
665767c250
fix: resolve bugs in VRAM unpredictable read/writes
2022-10-21 05:12:53 -03:00
Rekai Nyangadzayi Musuka
0fd8a13a93
fix: don't start HDMA in vblank
2022-10-21 05:12:52 -03:00
Rekai Nyangadzayi Musuka
125b931d0c
feat: implement brightness increase/decrease
2022-10-21 05:12:52 -03:00
Rekai Nyangadzayi Musuka
27259c97db
feat: implement object blending
2022-10-21 05:12:52 -03:00
Rekai Nyangadzayi Musuka
9479838614
feat: implement background alpha blending
2022-10-21 05:12:52 -03:00
Rekai Nyangadzayi Musuka
8a203ff05f
feat: implement BLDCNT, BLDALPHA, BLDY
2022-10-21 05:12:52 -03:00
Rekai Nyangadzayi Musuka
39f71730e0
chore: update README
2022-10-21 05:12:52 -03:00
Rekai Nyangadzayi Musuka
33f993c19d
chore: rename + remove some code
2022-10-21 05:12:51 -03:00
Rekai Nyangadzayi Musuka
18ec16eb6d
fix: properly fire DMA IRQs
...
This resolves Sound DMA Timing issues present in DOOM
2022-10-21 05:12:51 -03:00
Rekai Nyangadzayi Musuka
bf558922f9
chore: rename Dma.active to Dma.in_progress
2022-10-21 05:12:51 -03:00
Rekai Nyangadzayi Musuka
e87bda7584
chore: rewrite info log message
2022-10-21 05:12:51 -03:00
Rekai Nyangadzayi Musuka
87dc70436c
feat: implement NR10 obscure behaviour
2022-10-21 05:12:51 -03:00
Rekai Nyangadzayi Musuka
5dd78177f4
feat: handle all I/O when using Cult-Of-GBA BIOS
2022-10-21 05:12:51 -03:00
Rekai Nyangadzayi Musuka
203af4c471
chore: 32-bit reads for PSG audio
2022-10-21 05:12:50 -03:00
Rekai Nyangadzayi Musuka
98223d9e5a
chore: implement more than just 1 cycle per mem access
2022-10-21 05:12:50 -03:00
Rekai Nyangadzayi Musuka
e8cc0dfabb
fix: implement register reads for Yoshi's Island
2022-10-21 05:12:50 -03:00
Rekai Nyangadzayi Musuka
c8585a6f9a
fix: reimplement DMA ticking
2022-10-21 05:12:50 -03:00
Rekai Nyangadzayi Musuka
7d79361aca
chore(cpu): add inline fn isHalted()
2022-10-21 05:12:50 -03:00
Rekai Nyangadzayi Musuka
d1d32e465c
chore: attempt to debug Rhythm Heaven
2022-10-21 05:12:50 -03:00
Rekai Nyangadzayi Musuka
42c6b21124
fix: impl BG?{X,Y} RefPoint write behaviour outside of Vblank
...
With this fix Mode 7-like games now properly render their backgrounds
2022-10-21 05:12:49 -03:00
Rekai Nyangadzayi Musuka
44e1dacb7b
chore: change priority of some logs
2022-10-21 05:12:49 -03:00
Rekai Nyangadzayi Musuka
eeea8a6327
chore: mess with debug statements + mask APU I/O reads
2022-10-21 05:12:49 -03:00
Rekai Nyangadzayi Musuka
0a5df26c31
chore: move timer, apu and dma i/o addr matching outside of io.zig
2022-10-21 05:12:49 -03:00
Rekai Nyangadzayi Musuka
d3bc58d71c
chore: separate render code for affine sprites
2022-10-21 05:12:49 -03:00
Rekai Nyangadzayi Musuka
8d32d9788e
chore: reimplement object rendering
...
TODO: implement affine sprites
2022-10-21 05:12:48 -03:00
Rekai Nyangadzayi Musuka
b18f488b01
chore: small changes to normal background drawing code
2022-10-21 05:12:48 -03:00
Rekai Nyangadzayi Musuka
4b4242df2a
feat: implement affine backgrounds
2022-10-21 05:12:48 -03:00
Rekai Nyangadzayi Musuka
e2533dedeb
chore: stub 8-bit window registers
2022-10-21 05:12:48 -03:00
Rekai Nyangadzayi Musuka
89619596ad
chore: remove code that pretends to remove DC offset
2022-10-21 05:12:48 -03:00
Rekai Nyangadzayi Musuka
02fee16561
fix: replace affine bg register bitfields with signed integers
2022-10-21 05:12:48 -03:00
Rekai Nyangadzayi Musuka
bf8521eb5e
chore: use stdlib endian-aware integer read/write functions
2022-10-21 05:12:47 -03:00
Rekai Nyangadzayi Musuka
299244a37a
chore: update zig version in README.md
2022-10-21 05:12:47 -03:00
Rekai Nyangadzayi Musuka
9990fa3513
chore: update SDL.zig
2022-10-21 05:12:47 -03:00
Rekai Nyangadzayi Musuka
db064d2321
chore: misc style improvements
2022-10-21 05:12:47 -03:00
Rekai Nyangadzayi Musuka
e0523aea63
chore: rename method in FpsTracker
2022-10-21 05:12:47 -03:00
Rekai Nyangadzayi Musuka
5982fdea98
chore: update README.md
2022-10-21 05:12:46 -03:00
Rekai Nyangadzayi Musuka
c18be62b11
fix(backup): resolve banking issue in flash impl
2022-10-21 05:12:46 -03:00
Rekai Nyangadzayi Musuka
9f69b122d0
chore: remove awful ptr casts in backup.zig and bios.zig
2022-10-21 05:12:46 -03:00
Rekai Nyangadzayi Musuka
295aa139f6
feat: pass jsmolka's bios.gba
2022-10-21 05:12:46 -03:00
Rekai Nyangadzayi Musuka
2502cc5bf0
fix: play right samples in right channel
2022-10-21 05:12:46 -03:00
Rekai Nyangadzayi Musuka
fc7f2a2959
fix: resolve issue when handling event sooner than expected
2022-10-21 05:12:46 -03:00
Rekai Nyangadzayi Musuka
9d839a0328
fix: remove DC offset from audio output
2022-10-21 05:12:45 -03:00
Rekai Nyangadzayi Musuka
55dada243e
chore: add debug keybinds for scheduler capacity + event count
2022-10-21 05:12:45 -03:00
Rekai Nyangadzayi Musuka
78e7c0bc3f
perf: don't check scheduler every iteration of runFrame loop
...
~20fps gain in Pokemon Emerald, nice
2022-10-21 05:12:45 -03:00
Rekai Nyangadzayi Musuka
9134456229
chore: simplify 4bpp palette code
2022-10-21 05:12:45 -03:00
Rekai Nyangadzayi Musuka
0ef71ecb49
perf: convert BGR555 to RGBA8888 at compile-time, access w/ lookup table
...
Compile speed isn't slowed down by that much + there's a ~20fps gain in
Pokemon emerald, though this isn't anything exact
2022-10-21 05:12:45 -03:00
Rekai Nyangadzayi Musuka
3d18685d36
chore: modify type signature of util.sext
2022-10-21 05:12:45 -03:00
Rekai Nyangadzayi Musuka
f194bee4eb
chore: cleanup main
2022-10-21 05:12:44 -03:00
Rekai Nyangadzayi Musuka
f373d8e17c
chore: emu audio sync code to emu.zig
2022-10-21 05:12:44 -03:00
Rekai Nyangadzayi Musuka
1b7d15e7d2
chore: redo apu sampling
2022-10-21 05:12:44 -03:00
Rekai Nyangadzayi Musuka
89d8c08cd1
chore: implement apu u16 reads
2022-10-21 05:12:44 -03:00
Rekai Nyangadzayi Musuka
3cd02a44cf
fix: clean up frequency timer implementations
2022-10-21 05:12:44 -03:00
Rekai Nyangadzayi Musuka
87eb0cc808
Revert "fix: resolve off-by-one errors when scheduling freq timer expirations"
...
This reverts commit c9b0030b4b
.
2022-10-21 05:12:43 -03:00
Rekai Nyangadzayi Musuka
8313210ddc
fix: resolve off-by-one errors when scheduling freq timer expirations
2022-10-21 05:12:43 -03:00
Rekai Nyangadzayi Musuka
2664f5cf20
chore: improve APU accuracy + scheduler refactoring
2022-10-21 05:12:43 -03:00
Rekai Nyangadzayi Musuka
47518268a6
chore: update SDL.zig
2022-10-21 05:12:43 -03:00
Rekai Nyangadzayi Musuka
29ee225c1f
feat: stub Affine BG registers
2022-10-21 05:12:43 -03:00
Rekai Nyangadzayi Musuka
ff6d2517be
fix: resolve out-of-bounds error with 8bpp tall / horizontal sprites
...
Boot ROM is now enabled by default as well
2022-10-21 05:12:43 -03:00
Rekai Nyangadzayi Musuka
242bf08cf2
chore: improve audio accuracy
2022-10-21 05:12:42 -03:00
Rekai Nyangadzayi Musuka
996de65688
chore: reintroduce thread sleeping + simplify fps counter
2022-10-21 05:12:42 -03:00
Rekai Nyangadzayi Musuka
b97b66927f
feat: implement double buffering
2022-10-21 05:12:42 -03:00
Rekai Nyangadzayi Musuka
628d4cfb68
chore: clean up DMA code
2022-10-21 05:12:42 -03:00
Rekai Nyangadzayi Musuka
ff002f18c6
feat: handle DMA IRQs (maybe?)
2022-10-21 05:12:42 -03:00
Rekai Nyangadzayi Musuka
5d5d3827fb
chore: contain Timers in a tuple rather than a struct
2022-10-21 05:12:42 -03:00
Rekai Nyangadzayi Musuka
8826242bf3
chore: contain DMA Controllers in a tuple rather than a struct
2022-10-21 05:12:41 -03:00
Rekai Nyangadzayi Musuka
4bb1aa06f7
chore: update git submodules
2022-10-21 05:12:41 -03:00
Rekai Nyangadzayi Musuka
570ff8536c
chore: resolve incorrect memory mirror in VRAM
...
+ stub GPIO registers on ROM Write
2022-10-21 05:12:41 -03:00
Rekai Nyangadzayi Musuka
2c0d2b64a2
chore: stub a few I/O registers
2022-10-21 05:12:41 -03:00
Rekai Nyangadzayi Musuka
1750c0a26e
chore: allow 8-bit IO to BG0CNT and BG1CNT
...
BG0CNT and and BG1CNT now work properly in mario kart
2022-10-21 05:12:41 -03:00
Rekai Nyangadzayi Musuka
a102d68e99
chore: define affine sprite attributes
2022-10-21 05:12:41 -03:00
Rekai Nyangadzayi Musuka
61483b93e8
feat: stub mode 1 and 2
2022-10-21 05:12:40 -03:00
Rekai Nyangadzayi Musuka
192d7645eb
feat: implement mode 5
...
I wonder which obscure game makes heavy use of this mode
2022-10-21 05:12:40 -03:00
Rekai Nyangadzayi Musuka
f1c68fb0de
chore: comment ARM MSR code + Audio issues
2022-10-21 05:12:40 -03:00
Rekai Nyangadzayi Musuka
cb74bfd280
chore: pass destoer's cond_invalid test
2022-10-21 05:12:40 -03:00
Rekai Nyangadzayi Musuka
0d1717538b
chore: misc print message improvements
2022-10-21 05:12:40 -03:00
Rekai Nyangadzayi Musuka
896ae0935a
chore: improvements to APU accuracy
2022-10-21 05:12:39 -03:00
Rekai Nyangadzayi Musuka
1a23073424
fix: incorrect order-of-operations in ARM BL impl
2022-10-21 05:12:39 -03:00
Rekai Nyangadzayi Musuka
36f3b0d381
chore: special case saving for ROMS without titles
2022-10-21 05:12:39 -03:00
Rekai Nyangadzayi Musuka
74335cacbf
chore: update README
2022-10-21 05:12:39 -03:00
Rekai Nyangadzayi Musuka
1ee2dd9c5e
chore: update most recent zig version
2022-10-21 05:12:39 -03:00
Rekai Nyangadzayi Musuka
c2f3790dc3
feat: pass DenSinH's eeprom-test
2022-10-21 05:12:39 -03:00
Rekai Nyangadzayi Musuka
746c28004f
feat: implement EEPROM
2022-10-21 05:12:38 -03:00
Rekai Nyangadzayi Musuka
084d4b28dd
chore: implement I/O regsister for Minish Cap
2022-10-21 05:12:38 -03:00
Rekai Nyangadzayi Musuka
ed6e83b121
chore: change default window scale to 4x
2022-10-21 05:12:38 -03:00
Rekai Nyangadzayi Musuka
b827ba3a1c
chore: write more debug log messages for unimplemented registers
2022-10-21 05:12:38 -03:00
Rekai Nyangadzayi Musuka
0f343f0b74
chore: only sync to audio for now
2022-10-21 05:12:38 -03:00
Rekai Nyangadzayi Musuka
7a670c6ed9
feat: panic on unimplemented I/O in ReleaseSafe/Debug but not ReleaseFast
2022-10-21 05:12:38 -03:00
Rekai Nyangadzayi Musuka
e690f88cda
chore: misc improvements
2022-10-21 05:12:37 -03:00
Rekai Nyangadzayi Musuka
c7f537959b
fix: improper lifetime for *Arm7tdmi ptr in Bus
...
*Arm7tdmi ptr is now assigned one scope up so that it lives as least
as long as Bus does
2022-10-21 05:12:37 -03:00
Rekai Nyangadzayi Musuka
f074b703b3
feat: implement Noise
...
Kirby & The Amazing Mirror crashes only in ReleaseSafe / ReleaseBug.
TODO: Figure out why
2022-10-21 05:12:37 -03:00
Rekai Nyangadzayi Musuka
f8159645e0
feat: implement ch3
2022-10-21 05:12:37 -03:00
Rekai Nyangadzayi Musuka
cccb83a926
feat: implement ch2
2022-10-21 05:12:37 -03:00
Rekai Nyangadzayi Musuka
af8fe66c43
feat: implement ch1
...
TODO: It's really loud
2022-10-21 05:12:36 -03:00
Rekai Nyangadzayi Musuka
1f23aff22c
chore: broken impl of ch1
2022-10-21 05:12:36 -03:00
Rekai Nyangadzayi Musuka
e580b78020
feat: add audio resampler
...
Also implement extremely naive audio sync
2022-10-21 05:12:36 -03:00
Rekai Nyangadzayi Musuka
a87a5ce273
chore: calculate apu sample rate a bit better
2022-10-21 05:12:36 -03:00
Rekai Nyangadzayi Musuka
af1887e0a6
feat: schedule audio sampling on scheduler
...
DMA sound in games like Pokemon Emerald, Chobits, Love Hina, and Kirby:
Nightmare in Dream Land sound great save for conerns about resampling
2022-10-21 05:12:36 -03:00
Rekai Nyangadzayi Musuka
14bb2f6fbe
chore: improve timer behaviour
2022-10-21 05:12:36 -03:00
Rekai Nyangadzayi Musuka
d144973acf
chore: move some init code to functions
2022-10-21 05:12:35 -03:00
Rekai Nyangadzayi Musuka
eecd78a008
feat: impelemt THUMB open bus
2022-10-21 05:12:35 -03:00
Rekai Nyangadzayi Musuka
c03c142b14
feat: implement ARM read open bus
2022-10-21 05:12:35 -03:00
Rekai Nyangadzayi Musuka
40f3600de2
fix: remove accidental rotation in ldrsh instructions
2022-10-21 05:12:35 -03:00
Rekai Nyangadzayi Musuka
c08e331f77
chore: move log statement
2022-10-21 05:12:35 -03:00
Rekai Nyangadzayi Musuka
a92989ed24
chore: remove magic numbers
2022-10-21 05:12:35 -03:00
Rekai Nyangadzayi Musuka
6c61eb3537
chore: remove unnecessary 32MB allocation
2022-10-21 05:12:34 -03:00
Rekai Nyangadzayi Musuka
05c1274ec1
chore: define more I/O read/writes
2022-10-21 05:12:34 -03:00
Rekai Nyangadzayi Musuka
f5bc78ae22
chore: update README
2022-10-21 05:12:34 -03:00
Rekai Nyangadzayi Musuka
27ad8772ea
feat: pass jsmolka memory.gba
2022-10-21 05:12:34 -03:00
Rekai Nyangadzayi Musuka
135987745c
chore: ignore instead of logging errors for perf reasons
2022-10-21 05:12:34 -03:00
Rekai Nyangadzayi Musuka
f039c891c7
feat: Initial Implementation of DMA Audio
2022-10-21 05:12:33 -03:00
Rekai Nyangadzayi Musuka
e69f4cfafe
chore: tick scheduler on memory access
2022-10-21 05:12:33 -03:00
Rekai Nyangadzayi Musuka
a4020400da
chore: log error on open bus in page 0x00 and 0x01
2022-10-21 05:12:33 -03:00
Rekai Nyangadzayi Musuka
d4aac22e34
chore: rewrite I/O read/writes
2022-10-21 05:12:33 -03:00
Rekai Nyangadzayi Musuka
601e717850
chore: reimplement bus read/writes
2022-10-21 05:12:33 -03:00
Rekai Nyangadzayi Musuka
886b9abf3d
fix: force align reads/writes in memory bus rather than in CPU
2022-10-21 05:12:32 -03:00
Rekai Nyangadzayi Musuka
9c87b9820e
fix: pass none.gba and kind of sram.gba from jsmolka test suite
2022-10-21 05:12:32 -03:00
Rekai Nyangadzayi Musuka
1fe332a44f
feat: implement GamePak out-of-bounds reads
2022-10-21 05:12:32 -03:00
Rekai Nyangadzayi Musuka
b6d2084c96
chore: run zigfmt
2022-10-21 05:12:32 -03:00
Rekai Nyangadzayi Musuka
ed896d976d
chore: change implementation of rotr
2022-10-21 05:12:32 -03:00
Rekai Nyangadzayi Musuka
677eecad41
chore: rewrite read/write methods for remainig Bus devices
2022-10-21 05:12:32 -03:00
Rekai Nyangadzayi Musuka
74b6fa2ecc
chore: mirror VRAM
2022-10-21 05:12:31 -03:00
Rekai Nyangadzayi Musuka
effb6315e9
chore: write generic read/write for VRAM
2022-10-21 05:12:31 -03:00
Rekai Nyangadzayi Musuka
3c8390a248
Merge branch 'main' of ssh://musuka.dev:2222/paoda/zba
2022-10-21 05:12:31 -03:00
Rekai Nyangadzayi Musuka
8337a6dcd9
chore: update dependencies
2022-10-21 05:12:31 -03:00
Rekai Nyangadzayi Musuka
ee194b03d0
chore: update README
2022-10-21 05:12:31 -03:00
Rekai Nyangadzayi Musuka
2d8fa9c2f7
fix: don't create un-needed save file
...
If we don't know if we support a game's save type yet, avoid
creating a file for it.
2022-10-21 05:12:30 -03:00
Rekai Nyangadzayi Musuka
b76481b34c
chore: don't assume 1cpi when stepping by a frame
2022-10-21 05:12:30 -03:00
Rekai Nyangadzayi Musuka
147f6ac9ec
Revert "chore: tick on memory access instead of 1cpi"
...
This reverts commit 7f555095f2
.
2022-10-21 05:12:30 -03:00
Rekai Nyangadzayi Musuka
84273cbdad
chore: tick on memory access instead of 1cpi
2022-10-21 05:12:30 -03:00
Rekai Nyangadzayi Musuka
885f92beeb
feat: implement Flash backup cartrige kinds
2022-10-21 05:12:30 -03:00
Rekai Nyangadzayi Musuka
f12800f2d0
chore: stub more apu I/O addresses
2022-10-21 05:12:30 -03:00
Rekai Nyangadzayi Musuka
a93b335dea
fix: account for subset of disallowed chars in save file names
2022-10-21 05:12:29 -03:00
Rekai Nyangadzayi Musuka
ad9463dcb9
feat: implement SRAM saving and loading
2022-10-21 05:12:29 -03:00
Rekai Nyangadzayi Musuka
242627199b
chore: properly deallocate OAM buffer
2022-10-21 05:12:29 -03:00
Rekai Nyangadzayi Musuka
22a8f67d81
fix: speed percentage in title is now accurate
...
We now properly account for full speed being 59.97Hz not, 59Hz or 60Hz
2022-10-21 05:12:29 -03:00
Rekai Nyangadzayi Musuka
4ee0eed2e5
chore: make some variables const
2022-10-21 05:12:29 -03:00
Rekai Nyangadzayi Musuka
20f39176c6
feat: minor performance improvements
2022-10-21 05:12:29 -03:00
Rekai Nyangadzayi Musuka
ed792d71d3
feat: switch from BGR555 to RGBA8888
2022-10-21 05:12:28 -03:00
Rekai Nyangadzayi Musuka
c3ae727ed1
fix: improve perf of instructions w/ rotr
2022-10-21 05:12:28 -03:00
Rekai Nyangadzayi Musuka
0116dcdbe1
fix: improve frame limiting and fps counting
2022-10-21 05:12:28 -03:00
Rekai Nyangadzayi Musuka
5ecbcc9f33
fix: implement proper SRAM mirroring and stub Flash
2022-10-21 05:12:28 -03:00
Rekai Nyangadzayi Musuka
2d16e4a4e6
chore: move DMA and Timers from io to bus
2022-10-21 05:12:28 -03:00
Rekai Nyangadzayi Musuka
bb9dc45e0c
feat: define APU registers
2022-10-21 05:12:27 -03:00
Rekai Nyangadzayi Musuka
9dcecc0d58
fix: move code in scheduler to ppu
2022-10-21 05:12:27 -03:00
Rekai Nyangadzayi Musuka
92e63f5dd6
chore: create different types of emuloops
2022-10-21 05:12:27 -03:00
Rekai Nyangadzayi Musuka
74cda6a1d0
fix: resolve relative sprite priority issues
2022-10-21 05:12:27 -03:00
Rekai Nyangadzayi Musuka
d7354cca33
chore: improve accuracy of frame limiter
2022-10-21 05:12:27 -03:00
Rekai Nyangadzayi Musuka
7684cf0f4a
chore: improve accuracy of thread sleep in emu thread
2022-10-21 05:12:27 -03:00
Rekai Nyangadzayi Musuka
3994c2c7c8
feat: implement video sync
2022-10-21 05:12:26 -03:00
Rekai Nyangadzayi Musuka
a768d28e7c
chore: organize io switch statements
2022-10-21 05:12:26 -03:00
Rekai Nyangadzayi Musuka
efd99f16e0
fix: mirror SRAM
...
SRAM is mirrored in 64K chunks
TODO: According to GBATEK SRAM chips are 32K and mirrored
2022-10-21 05:12:26 -03:00
Rekai Nyangadzayi Musuka
61d6288fec
chore: don't panic on unknown bus and io writes/reads
...
This will lead to emulation bugs due to devices I've yet to implement but by
doing this a lot of games become playable "by default" such as Doom or
Kirby: Nightmare in Dream Land.
When implementing feature and/or debuggin make sure to set:
panic_on_und_bus and panic_on_und_io to true so that the emu crashes
on unknown reads/writes
2022-10-21 05:12:26 -03:00
Rekai Nyangadzayi Musuka
e3e45cd129
feat: implement Timers
2022-10-21 05:12:26 -03:00
Rekai Nyangadzayi Musuka
15191aedca
fix: implement sprite coord overflow behaviour
2022-10-21 05:12:26 -03:00
Rekai Nyangadzayi Musuka
63486f13f2
fix: resolve issues with sprite mirroring
2022-10-21 05:12:25 -03:00
Rekai Nyangadzayi Musuka
17455e40d1
feat: Implement MVP of Mode 0 Sprites
2022-10-21 05:12:25 -03:00
Rekai Nyangadzayi Musuka
d54e593276
chore: clean up io
2022-10-21 05:12:25 -03:00
Rekai Nyangadzayi Musuka
c6a544a824
feat: fix tile flipping issue
2022-10-21 05:12:25 -03:00
Rekai Nyangadzayi Musuka
e3ae3635bc
chore: add some type definitions for sprites
2022-10-21 05:12:25 -03:00
Rekai Nyangadzayi Musuka
6723bfb364
feat: improve DMA Transfer support
2022-10-21 05:12:25 -03:00
Rekai Nyangadzayi Musuka
12c628e82c
chore(ppu): resolve integer overflow regression
2022-10-21 05:12:24 -03:00
Rekai Nyangadzayi Musuka
5f9abf69d3
feat(ppu): implement bg priority and transparency
2022-10-21 05:12:24 -03:00
Rekai Nyangadzayi Musuka
351a687a2d
chore: update README.md
2022-10-21 05:12:24 -03:00
Rekai Nyangadzayi Musuka
68b0601a42
chore: replace unnecessarily complex sign extension implementation
2022-10-21 05:12:24 -03:00
Rekai Nyangadzayi Musuka
9455ffe837
feat: pass beeg yoshi
2022-10-21 05:12:24 -03:00
Rekai Nyangadzayi Musuka
02d2ff3e0c
fix: palette id is a u16 not a u8
2022-10-21 05:12:24 -03:00
Rekai Nyangadzayi Musuka
02572dd15c
feat: DMA Transfer MVP
2022-10-21 05:12:23 -03:00
Rekai Nyangadzayi Musuka
6d253cc74e
feat(ppu): implement transparency + backdrop in mode 0
2022-10-21 05:12:23 -03:00
Rekai Nyangadzayi Musuka
4885a86833
chore(io): replace some bitfields with enums
2022-10-21 05:12:23 -03:00
Rekai Nyangadzayi Musuka
fd9ffb20b4
fix: better emulate behaviour of IO reads
2022-10-21 05:12:23 -03:00
Rekai Nyangadzayi Musuka
56ef2b077a
chore: document select unimplmented I/O registers
...
These registers are written to / read from Kirby: Nightmare in Dream Land
2022-10-21 05:12:23 -03:00
Rekai Nyangadzayi Musuka
d4c7cfdf8b
feat: impelement a barebones SRAM
2022-10-21 05:12:23 -03:00
Rekai Nyangadzayi Musuka
4d75d156e5
feat: pass retAddr.gba
2022-10-21 05:12:22 -03:00
Rekai Nyangadzayi Musuka
d30a4d7ee5
feat: implement Hblank and Vcount Interrupts
...
Also implemented unique behaviour when writing to IF
2022-10-21 05:12:22 -03:00
Rekai Nyangadzayi Musuka
d1fce8ba75
chore: improve Bus log + panic messages
2022-10-21 05:12:22 -03:00
Rekai Nyangadzayi Musuka
0f74e4fcf9
chore: improve io.zig
2022-10-21 05:12:22 -03:00
Rekai Nyangadzayi Musuka
4afcbd0957
feat: implement mirroring for IWRAM EWRAM, OAM and PALRAM
...
Also realized I confused IWRAM and EWRAM. This is also fixed
TODO: Implemnt Mirroring for VRRAM
2022-10-21 05:12:22 -03:00
Rekai Nyangadzayi Musuka
50dc31447d
fix: resolve integer overflow in BG0 Drawing
2022-10-21 05:12:22 -03:00
Rekai Nyangadzayi Musuka
acf1a10f91
chore: don't panic on 32-bit I/O
2022-10-21 05:12:21 -03:00
Rekai Nyangadzayi Musuka
606f9b959a
chore: stub CPU HALTing
2022-10-21 05:12:21 -03:00
Rekai Nyangadzayi Musuka
f19b42baf3
chore: correct logic errors in map size 1 and 3
2022-10-21 05:12:21 -03:00
Rekai Nyangadzayi Musuka
2a3d0c8b0d
chore: properly write to VOFS and HOFS in 32-bit bus
2022-10-21 05:12:21 -03:00
Rekai Nyangadzayi Musuka
4405fa6bbf
feat: implement hofs and vofs on io bus
2022-10-21 05:12:21 -03:00
Rekai Nyangadzayi Musuka
e2b2bf882a
feat: implement scrolling
2022-10-21 05:12:21 -03:00
Rekai Nyangadzayi Musuka
08e4eb1bf1
feat: add support for multiple BGs in Mode 0
2022-10-21 05:12:20 -03:00
Rekai Nyangadzayi Musuka
f4b176a813
feat: document mode 0
2022-10-21 05:12:20 -03:00
Rekai Nyangadzayi Musuka
efc7d817db
feat: Mode 0 MVP
2022-10-21 05:12:20 -03:00
Rekai Nyangadzayi Musuka
1b17b1eb0c
chore: use zig slices for fun
2022-10-21 05:12:20 -03:00
Rekai Nyangadzayi Musuka
fab6d4c2a2
chore: give DISPCNT DISPSTAT and VCOUNT to PPU struct
2022-10-21 05:12:20 -03:00
Rekai Nyangadzayi Musuka
223a3403c0
chore: give io read/write functions access to the entire Bus
2022-10-21 05:12:20 -03:00
Rekai Nyangadzayi Musuka
dfd0d064de
feat: implement BG Scrolling Registers
2022-10-21 05:12:19 -03:00
Rekai Nyangadzayi Musuka
0c4882e658
feat: impelemnt BG0,1,2CNT and IF
2022-10-21 05:12:19 -03:00
Rekai Nyangadzayi Musuka
bfdad9fa32
feat: implement OAM
2022-10-21 05:12:19 -03:00
Rekai Nyangadzayi Musuka
37fd8dab84
chore: squash bugs preventing swi_demo.gba from working
2022-10-21 05:12:19 -03:00
Rekai Nyangadzayi Musuka
c143aefb01
chore(cpu): reimplement bank switching logic
2022-10-21 05:12:19 -03:00
Rekai Nyangadzayi Musuka
05bf245b5a
fix: don't mask away MSB in THUMB.5 add
2022-10-21 05:12:19 -03:00
Rekai Nyangadzayi Musuka
f9e7128061
fix: properly decode format 11 instructions
2022-10-21 05:12:18 -03:00
Rekai Nyangadzayi Musuka
603e4b6fdf
chore: make use of scoped logging
2022-10-21 05:12:18 -03:00
Rekai Nyangadzayi Musuka
9ed37340cc
Merge branch 'main' of ssh://musuka.dev:2222/paoda/zba
2022-10-21 05:12:18 -03:00
Rekai Nyangadzayi Musuka
599a1f2973
chore: remove TODOs and some useless imports
2022-10-21 05:12:18 -03:00
Rekai Nyangadzayi Musuka
22424ca69c
fix: improper condition check and initialization of register
2022-10-21 05:12:18 -03:00
Rekai Nyangadzayi Musuka
67a785cc22
fix(cpu): force align thumb and arm block data transfers
2022-10-21 05:12:18 -03:00
Rekai Nyangadzayi Musuka
4a4663607e
chore: update README
2022-10-21 05:12:17 -03:00
Rekai Nyangadzayi Musuka
4eb3842606
feat: pass arm.gba
2022-10-21 05:12:17 -03:00
Rekai Nyangadzayi Musuka
1ee8b51b2b
chore: reimplement ARM LDM/STM
2022-10-21 05:12:17 -03:00
Rekai Nyangadzayi Musuka
130310e5cc
chore: improve arm ldm/stm
2022-10-21 05:12:17 -03:00
Rekai Nyangadzayi Musuka
e933d7e5c7
fix(cpu): force-align SWP reads and writes
2022-10-21 05:12:17 -03:00
Rekai Nyangadzayi Musuka
44e8b5b882
fix: force-align ARM STRH reads
2022-10-21 05:12:17 -03:00
Rekai Nyangadzayi Musuka
28361e8b7d
fix: implement the same LDRSH logic as THUMB LDRSH
2022-10-21 05:12:16 -03:00
Rekai Nyangadzayi Musuka
75921d6413
fix: PC is 12 ahead when it is rd in str and strb
2022-10-21 05:12:16 -03:00
Rekai Nyangadzayi Musuka
17226d8f75
fix: listen to my past self
...
By deleting this line I go from test 234 to test 355 in arm.gba
2022-10-21 05:12:16 -03:00
Rekai Nyangadzayi Musuka
0166999446
chore: update SDL.zig
2022-10-21 05:12:16 -03:00
Rekai Nyangadzayi Musuka
2cb1bf834a
chore: dont use std.mem.bytesToValue
...
the stdlib accounts for endianness, which isn't something we want.
2022-10-21 05:12:16 -03:00
Rekai Nyangadzayi Musuka
8006ca31e6
chore: remove unnecessary @as calls
2022-10-21 05:12:16 -03:00
Rekai Nyangadzayi Musuka
82b92b4733
feat: pass thumb.gba
2022-10-21 05:12:15 -03:00
Rekai Nyangadzayi Musuka
bf42d3ae2f
chore: account for empty rlist in THUMB LDM/STM
2022-10-21 05:12:15 -03:00
Rekai Nyangadzayi Musuka
f63ae76931
fix(cpu): handle edge case in LDRSH
2022-10-21 05:12:15 -03:00
Rekai Nyangadzayi Musuka
feded4ac25
chore: specify which compiler this project is built with
2022-10-21 05:12:15 -03:00
Rekai Nyangadzayi Musuka
f046787523
chore: reorganize util.zig
2022-10-21 05:12:15 -03:00
Rekai Nyangadzayi Musuka
bbd73550e8
fix: zero initialize all allocated memory
2022-10-21 05:12:15 -03:00
Rekai Nyangadzayi Musuka
fce560dd89
chore: don't commit *.sh files
2022-10-21 05:12:14 -03:00
Rekai Nyangadzayi Musuka
4776dc0788
Revert "fix: allow for 32-bit reads to KEYINPUT"
...
This reverts commit 3a51707280
.
2022-10-21 05:12:14 -03:00
Rekai Nyangadzayi Musuka
d8bd6da563
fix: resolve decoding mixup in THUMB format 8 instructions
2022-10-21 05:12:14 -03:00
Rekai Nyangadzayi Musuka
b569a32170
fix: allow for 32-bit reads to KEYINPUT
2022-10-21 05:12:14 -03:00
Rekai Nyangadzayi Musuka
06e20666bd
chore: refactor ARMv4 decoding
2022-10-21 05:12:14 -03:00
Rekai Nyangadzayi Musuka
36687c5c67
chore: add more debug information to CPU panic method
2022-10-21 05:12:14 -03:00
Rekai Nyangadzayi Musuka
dd9b20030a
chore: give more descriptive panic messages when changing mode fails
2022-10-21 05:12:13 -03:00
Rekai Nyangadzayi Musuka
c0db2a987b
chore: clean up THUMB instruction decoding
2022-10-21 05:12:13 -03:00
Rekai Nyangadzayi Musuka
c3ff2ed6c1
feat: parse cartridge header
2022-10-21 05:12:13 -03:00
Rekai Nyangadzayi Musuka
271f42cf0e
feat: rename ARM and THUMB SWI functions
2022-10-21 05:12:13 -03:00
Rekai Nyangadzayi Musuka
01e15584da
chore: group THUMB and select ARM instructions together (same file)
2022-10-21 05:12:13 -03:00
Rekai Nyangadzayi Musuka
17b91db2ef
feat: integrate zig-clap with ZBA
2022-10-21 05:12:13 -03:00
Rekai Nyangadzayi Musuka
3e786d02ac
fix(cpu): properly decode format 7 and 8
2022-10-21 05:12:12 -03:00
Rekai Nyangadzayi Musuka
c8f2db69df
fix(cpu): resolve edge cases in THUMB Format 5
2022-10-21 05:12:12 -03:00
Rekai Nyangadzayi Musuka
b4e0682801
fix(cpu): allow for select values to overflow
...
FuzzARM found these operations which panicked, when they should
have overflowed. These are now fixed
n = 8000
2022-10-21 05:12:12 -03:00
Rekai Nyangadzayi Musuka
af10c1b076
feat(cpu): implement format 13
...
While bugs do exist, at this point all THUMB and ARMv4 instructions
have been implemented! Yay!
2022-10-21 05:12:12 -03:00
Rekai Nyangadzayi Musuka
e6a0eab667
feat(cpu): implement THUMB format 17
2022-10-21 05:12:12 -03:00
Rekai Nyangadzayi Musuka
523b9d2736
feat(cpu): implement THUMB format11
2022-10-21 05:12:12 -03:00
Rekai Nyangadzayi Musuka
011d2f2f2a
chore: update to latest zig nightly
2022-10-21 05:12:11 -03:00
Rekai Nyangadzayi Musuka
c37546d273
chore: progress towards passing ldr/str thumb in armwrestler
2022-10-21 05:12:11 -03:00
Rekai Nyangadzayi Musuka
fbedebb938
fix(cpu): properly negate in NEG
2022-10-21 05:12:11 -03:00
Rekai Nyangadzayi Musuka
1773a3acc8
fix(cpu): reimplement THUMB offset shifts
2022-10-21 05:12:11 -03:00
Rekai Nyangadzayi Musuka
058c02150c
fix(cpu): op == 0b00 decodes to add in format 5
2022-10-21 05:12:11 -03:00
Rekai Nyangadzayi Musuka
8d841ead50
fix(cpu): account for overflow in THUMB alu MUL
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
152dafbdf7
chore: use if-else when decoding THUMB instructions
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
7dbd2fc556
fix(cpu): account for rn in rlist in block data transfer
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
85e0924669
feat: implement LDM/STM behaviour when S is set
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
97919f646d
feat(cpu): Pass all LDR/STR ARMwrestler tests
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
696cc1b359
feat(cpu): decode and implement all necessary ARM CPU instructions
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
151de2eab4
feat(cpu): implement ARM SWP and SWPB
2022-10-21 05:12:10 -03:00
Rekai Nyangadzayi Musuka
e7f6464564
fix: resolve off by n * 2 when accessing Palette during BG Mode 4
2022-10-21 05:12:09 -03:00
Rekai Nyangadzayi Musuka
da681c946e
feat(cpu): Implement Multiply Long ARM instructions
2022-10-21 05:12:09 -03:00
Rekai Nyangadzayi Musuka
e0e43eece5
fix: no buttons are pressed by default
2022-10-21 05:12:09 -03:00
Rekai Nyangadzayi Musuka
7013389288
feat(cpu): implement format 18 THUMB instructions
2022-10-21 05:12:09 -03:00
Rekai Nyangadzayi Musuka
443520ecae
chore: more detailed panic message
2022-10-21 05:12:09 -03:00
Rekai Nyangadzayi Musuka
96d7285111
feat(cpu): implement format 10 THUMB instructions
2022-10-21 05:12:08 -03:00
Rekai Nyangadzayi Musuka
7e6fc44191
feat(cpu): implement SWP
2022-10-21 05:12:08 -03:00
Rekai Nyangadzayi Musuka
9cb4ebaa7f
fix(cpu): perform MUL with u64s, throw away upper 32 bits
2022-10-21 05:12:08 -03:00
Rekai Nyangadzayi Musuka
3e4d7e7ed8
feat: implement keyboard input
2022-10-21 05:12:08 -03:00
Rekai Nyangadzayi Musuka
3a6951d93d
chore: don't panic on unsupported BG mode
2022-10-21 05:12:08 -03:00
Rekai Nyangadzayi Musuka
391096872e
chore: tempoarily disable fps counter
2022-10-21 05:12:08 -03:00
Rekai Nyangadzayi Musuka
eebf6fcae4
chore: zero-initialize VRAM
2022-10-21 05:12:07 -03:00
Rekai Nyangadzayi Musuka
8b7223cf35
chore: stub KeyInput I/O register
2022-10-21 05:12:07 -03:00
Rekai Nyangadzayi Musuka
e1fec48a0e
fix(cpu): properly decode multiply instructions
2022-10-21 05:12:07 -03:00
Rekai Nyangadzayi Musuka
0778ee8dd7
feat(cpu): implement ARM multiply instructions
2022-10-21 05:12:07 -03:00
Rekai Nyangadzayi Musuka
14d5160674
fix: allow 32-bit writes to DISPCNT
2022-10-21 05:12:07 -03:00
Rekai Nyangadzayi Musuka
eabf787305
fix(cpu): properly decode ldm stm thumb instructions
2022-10-21 05:12:07 -03:00
Rekai Nyangadzayi Musuka
980e4ff5dd
fix(cpu): properly decode THUMB PUSH and POP at comptime
2022-10-21 05:12:06 -03:00
Rekai Nyangadzayi Musuka
1ac193c506
fix(cpu): don't ignore 11th bit of THUMB BL offset
2022-10-21 05:12:06 -03:00
Rekai Nyangadzayi Musuka
d6ed071bc6
feat(cpu): implement thumb push / pop and stub format 13 thumb instrs
2022-10-21 05:12:06 -03:00
Rekai Nyangadzayi Musuka
a3d53d40fb
feat(cpu): implement THUMB format 9 loads / stores
2022-10-21 05:12:06 -03:00
Rekai Nyangadzayi Musuka
a17dfbe41f
fix(cpu): resolve issues with unexpected PC value in THUMB
2022-10-21 05:12:06 -03:00
Rekai Nyangadzayi Musuka
b9a81baa47
feat(cpu): implement THUMB ldmia stmia
2022-10-21 05:12:06 -03:00
Rekai Nyangadzayi Musuka
97b236225e
chore: implement THUMB format 4 instructions
2022-10-21 05:12:05 -03:00
Rekai Nyangadzayi Musuka
8113146b86
chore: dedup code in THUMB instructions
2022-10-21 05:12:05 -03:00
Rekai Nyangadzayi Musuka
e6625113db
chore: refactor and genericize ARM data processing calculations
2022-10-21 05:12:05 -03:00
Rekai Nyangadzayi Musuka
2643504eb5
chore: relocate barrel_shifter zig file
2022-10-21 05:12:05 -03:00
Rekai Nyangadzayi Musuka
f7518d1bab
feat(cpu): implement format2 THUMB instructions
2022-10-21 05:12:05 -03:00
Rekai Nyangadzayi Musuka
800ca798cd
feat(cpu): implement format19 THUMB instructions
2022-10-21 05:12:05 -03:00
Rekai Nyangadzayi Musuka
d714ffb4f9
chore: account for THUMB BL instruction when mimicking mGBA logs
2022-10-21 05:12:04 -03:00
Rekai Nyangadzayi Musuka
7bc186a03c
feat(cpu): implement format16 THUMB instructions
2022-10-21 05:12:04 -03:00
Rekai Nyangadzayi Musuka
b94b87d186
feat(cpu): implement format 1 THUMB instructions
2022-10-21 05:12:04 -03:00
Rekai Nyangadzayi Musuka
0289be60ef
fix: dont close file handle early
2022-10-21 05:12:04 -03:00
Rekai Nyangadzayi Musuka
93922b65e3
feat(cpu): implement format 6 THUMB instructions
2022-10-21 05:12:04 -03:00
Rekai Nyangadzayi Musuka
c6608748c6
chore: rename title
2022-10-21 05:12:04 -03:00
Rekai Nyangadzayi Musuka
8e383d55d7
chore: refactor GBA Display Timings
...
This change should reflect that the Hblank bit of DISPSTAT is toggled on all scanlines
while also ensuring that the Vblank bit is set on all Vblank scanlines
2022-10-21 05:12:03 -03:00
Rekai Nyangadzayi Musuka
8926026b5b
chore: move a single statement lol
2022-10-21 05:12:03 -03:00
Rekai Nyangadzayi Musuka
464479b986
chore: mark indexing methods as inline
2022-10-21 05:12:03 -03:00
Rekai Nyangadzayi Musuka
de1c84914c
feat: create emulator thread
2022-10-21 05:12:03 -03:00
Rekai Nyangadzayi Musuka
8e7766e694
chore: disable logging by default
2022-10-21 05:12:03 -03:00
Rekai Nyangadzayi Musuka
4858dbc5dc
chore: revert fastboot changes
2022-10-21 05:12:03 -03:00
Rekai Nyangadzayi Musuka
c4e131b92d
chore: binary logging + file logging + DP chanes + fastBoot changes
2022-10-21 05:12:02 -03:00
Rekai Nyangadzayi Musuka
90e0d9139c
chore: ignore .bin files
2022-10-21 05:12:02 -03:00
Rekai Nyangadzayi Musuka
2e54be76d6
chore: rename skipBios to fastBoot
2022-10-21 05:12:02 -03:00
Rekai Nyangadzayi Musuka
7914268702
chore: set correct values for select banked registers on fast boot
2022-10-21 05:12:02 -03:00
Rekai Nyangadzayi Musuka
4bdb85834c
feat(cpu): implement SWI
2022-10-21 05:12:02 -03:00
Rekai Nyangadzayi Musuka
f89a37936f
chore(bios): allow reading from BIOS
2022-10-21 05:12:02 -03:00
Rekai Nyangadzayi Musuka
8bb7ea6be6
fix(cpu): interim solution to weird program counter behaviour on illegal tst instruction
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
60a1f7fa99
chore(cpu): implement behaviour for undefined test instruction
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
b3b8182f85
fix(cpu): fix PC offset when barrel shifter and bit 4 of DP is set
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
19094b492e
chore: remove reccomended extension
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
56e660714c
fix(cpu): implement S set + rd == 15 case for data processing
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
eb632056a2
feat(cpu): implement banked registers
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
fbc9de0335
fix(cpu): improve MRS and MSR instructions
2022-10-21 05:12:01 -03:00
Rekai Nyangadzayi Musuka
5c7539cd26
feat(cpu): implement CMN
2022-10-21 05:12:00 -03:00
Rekai Nyangadzayi Musuka
7c20e5fdb5
fix(barrel_shifter): fix PC being 1 word ahead in barrel shifter
2022-10-21 05:12:00 -03:00
Rekai Nyangadzayi Musuka
f79e7126ee
feat(cpu): Implement RSC
2022-10-21 05:12:00 -03:00
Rekai Nyangadzayi Musuka
15e92bc6af
feat(cpu): implement RSB
2022-10-21 05:12:00 -03:00
Rekai Nyangadzayi Musuka
47fc96fe00
feat(cpu): implement BIC
2022-10-21 05:12:00 -03:00
Rekai Nyangadzayi Musuka
4ac5ad42c6
feat(cpu): implement EOR
2022-10-21 05:12:00 -03:00
Rekai Nyangadzayi Musuka
c93153672f
feat(cpu): implement ADD
2022-10-21 05:11:59 -03:00
Rekai Nyangadzayi Musuka
a46dd448f4
feat(cpu): implement fix for ADC and implement SBC
2022-10-21 05:11:59 -03:00
Rekai Nyangadzayi Musuka
01f75112ce
chore(barrel_shifter): remove panic from ASR
2022-10-21 05:11:59 -03:00
Rekai Nyangadzayi Musuka
051b98bc02
fix(barrel_shifter): should not modify cpsr when amount == 0
2022-10-21 05:11:59 -03:00
Rekai Nyangadzayi Musuka
5d0bc1b335
chore(cpu): refactor the barrel shifter once again
2022-10-21 05:11:59 -03:00
Rekai Nyangadzayi Musuka
43d011538e
feat(cpu): implement ADC
...
ADC interacting w/ the Barrel Shifter is not working though
2022-10-21 05:11:59 -03:00
Rekai Nyangadzayi Musuka
f3ad5e90ff
feat(cpu): implement RRX for Barrel Shifter
2022-10-21 05:11:58 -03:00
Rekai Nyangadzayi Musuka
9b867c02e0
feat(cpu): implement SUB in THUMB format 3
2022-10-21 05:11:58 -03:00
Rekai Nyangadzayi Musuka
2ba09868ba
feat(cpu): implement ARM SUB in data processing
2022-10-21 05:11:58 -03:00
Rekai Nyangadzayi Musuka
9394754593
feat(cpu): implement MVN
2022-10-21 05:11:58 -03:00
Rekai Nyangadzayi Musuka
41bab3d6ba
chore(cpu): refactor barrel shifter
2022-10-21 05:11:58 -03:00
Rekai Nyangadzayi Musuka
99b686b2d7
fix(cpu): use barrel shifter in data processing immediates
2022-10-21 05:11:58 -03:00
Rekai Nyangadzayi Musuka
daad98bbfe
feat(cpu): implement format 12 thumb instructions
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
2fb01577af
feat(cpu): implement some already decoded format 3 instructions
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
96d21f27a5
feat(cpu): implement THUMB format 5 instructions
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
793110f315
chore: mgba log now supports printing THUMB instructions
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
5ed5c5d52d
feat(cpu): implement like 1 THUMB instruction
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
01385ee46b
chore: distinguish between undefined ARM and THUMB instr
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
0eba3aca1f
chore(cpu): lay groundwork for THUMB instruction decoding and execution
2022-10-21 05:11:57 -03:00
Rekai Nyangadzayi Musuka
83a5370196
chore(cpu): refactor ARM functions to make room for THUMB
2022-10-21 05:11:56 -03:00
Rekai Nyangadzayi Musuka
b0b6247f06
fix(cpu): fix conditions for GT cond
2022-10-21 05:11:56 -03:00
Rekai Nyangadzayi Musuka
2a33716166
fix(cpu): fix imm value calculation in MSR
2022-10-21 05:11:56 -03:00
Rekai Nyangadzayi Musuka
9b26454c72
fix(cpu): resolve off-by-one error when executing LDM
2022-10-21 05:11:56 -03:00
Rekai Nyangadzayi Musuka
97b933d9ea
feat(cpu): implement branch and exchange
...
If I want to continue with armwrestler, I'll have to implement
THUMB instructions now
2022-10-21 05:11:56 -03:00
Rekai Nyangadzayi Musuka
ff70aadfdb
fix(cpu): make Data Processing instructions r15-aware
2022-10-21 05:11:55 -03:00
Rekai Nyangadzayi Musuka
ae53f92d40
fix(cpu): make LDRH and STRH aware of r15
2022-10-21 05:11:55 -03:00
Rekai Nyangadzayi Musuka
f51e1d3154
fix(cpu): account for r15 in LDR and STR instructions
2022-10-21 05:11:55 -03:00
Rekai Nyangadzayi Musuka
a21f94569f
fix(cpu): flip two branches in PSR Transfer execution
2022-10-21 05:11:55 -03:00
Rekai Nyangadzayi Musuka
b9255bffe7
feat(cpu): implement MSR and MRS
2022-10-21 05:11:55 -03:00
Rekai Nyangadzayi Musuka
e1f8400343
feat(cpu): stub PSR Transfer instructions
2022-10-21 05:11:55 -03:00
Rekai Nyangadzayi Musuka
52493831cc
chore(io): implement IE and IME
2022-10-21 05:11:54 -03:00
Rekai Nyangadzayi Musuka
00ba7afac4
chore: remove some magic constants
2022-10-21 05:11:54 -03:00
Rekai Nyangadzayi Musuka
c703352ac3
Merge branch 'main' of ssh://musuka.dev:2222/paoda/zba
2022-10-21 05:11:54 -03:00
Rekai Nyangadzayi Musuka
97e663febf
fix(bus): remove accidental recursion
2022-10-21 05:11:54 -03:00
Rekai Nyangadzayi Musuka
3891b54f42
chore: ignores for building on windows
2022-10-21 05:11:54 -03:00
Rekai Nyangadzayi Musuka
9a5959e46c
fix(cpu): write results of ORR to destination register
2022-10-21 05:11:54 -03:00
Rekai Nyangadzayi Musuka
780c717409
feat(cpu): implement TEQ
2022-10-21 05:11:53 -03:00
Rekai Nyangadzayi Musuka
34c6df344d
feat(cpu): Implement ORR
2022-10-21 05:11:53 -03:00
Rekai Nyangadzayi Musuka
670347d4a0
feat(bus): implement IWRAM and EWRAM
2022-10-21 05:11:53 -03:00
Rekai Nyangadzayi Musuka
e0c4b3b407
fix(ppu): properly access Mode 4 palette
2022-10-21 05:11:53 -03:00
Rekai Nyangadzayi Musuka
cffffab8ea
feat(cpu): refactor LDM/STM
2022-10-21 05:11:53 -03:00
Rekai Nyangadzayi Musuka
527bd2889e
feat(cpu): implement LDM/STM
2022-10-21 05:11:53 -03:00
Rekai Nyangadzayi Musuka
15dc4ce03a
chore(io): DISPSTAT bits 3 and 4 better match GBATEK documentation
2022-10-21 05:11:52 -03:00
Rekai Nyangadzayi Musuka
4f629227ab
fix(cpu): fix off-by-word bug in BL
2022-10-21 05:11:52 -03:00
Rekai Nyangadzayi Musuka
caa799853e
feat(bus): have VCOUNT be addressable on the bus
2022-10-21 05:11:52 -03:00
Rekai Nyangadzayi Musuka
3590215d33
feat(ppu): implement Mode 4
...
Implementation is not tested. Pending on LDM and STM so that I can
run beeg.gba
2022-10-21 05:11:52 -03:00
Rekai Nyangadzayi Musuka
d6aafc61bd
chore(io): rename some io bitfield fields
2022-10-21 05:11:52 -03:00
Rekai Nyangadzayi Musuka
357211a4cc
chore: remove premature inlines
2022-10-21 05:11:52 -03:00
Rekai Nyangadzayi Musuka
c4c4332485
chore: add FPS counter
2022-10-21 05:11:51 -03:00
Rekai Nyangadzayi Musuka
2cec8d9f70
chore: improve code clarity
2022-10-21 05:11:51 -03:00
Rekai Nyangadzayi Musuka
8348d7c4bc
feat(ppu): improve timings + implement BG mode 3 bitmap
2022-10-21 05:11:51 -03:00
Rekai Nyangadzayi Musuka
c33068d831
fix: allocate framebuf on heap
2022-10-21 05:11:51 -03:00
Rekai Nyangadzayi Musuka
f28b963f9d
chore: add code for heap alloc of white texture
2022-10-21 05:11:51 -03:00
Rekai Nyangadzayi Musuka
7fc77f993f
chore(gui): switch from RGBA8888 to BGR5555 to match BG Mode 3
2022-10-21 05:11:51 -03:00
Rekai Nyangadzayi Musuka
0e0b21d8c3
feat: draw white texture using SDL2
2022-10-21 05:11:50 -03:00
Rekai Nyangadzayi Musuka
f3ad0eb3aa
fix(ppu): deallocate palette RAM on cleanup
2022-10-21 05:11:50 -03:00
Rekai Nyangadzayi Musuka
036b861b05
chore: code cleanup
2022-10-21 05:11:50 -03:00
Rekai Nyangadzayi Musuka
880546468c
chore(bus): refactor bus.zig
2022-10-21 05:11:50 -03:00
Rekai Nyangadzayi Musuka
1a9c9ba4cb
chore: refactor instruction exec code
2022-10-21 05:11:50 -03:00
Rekai Nyangadzayi Musuka
a9e7140a88
chore(io): alias @This() to Self in io.zig
2022-10-21 05:11:50 -03:00
Rekai Nyangadzayi Musuka
808633deb7
chore: refactor bios.zig and pak.zig
2022-10-21 05:11:49 -03:00
Rekai Nyangadzayi Musuka
ee4fcd926b
fix: by convention deinit() should not take pointers to self
2022-10-21 05:11:49 -03:00
Rekai Nyangadzayi Musuka
9d1229fe0c
feat: implement PPU Timings in Scheduler
2022-10-21 05:11:49 -03:00
Rekai Nyangadzayi Musuka
d54c8df7b3
feat(sched): add HBlank and VBlank events to the scheduler
2022-10-21 05:11:49 -03:00
Rekai Nyangadzayi Musuka
d495f5b4c5
feat: implement S (when rd != 15) for several data processing instructions
2022-10-21 05:11:49 -03:00
Rekai Nyangadzayi Musuka
788bef188d
feat: implement dedicated Barrel Shifter SHL and SHR
2022-10-21 05:11:49 -03:00
Rekai Nyangadzayi Musuka
bff9be03cc
chore: stub TST
2022-10-21 05:11:48 -03:00
Rekai Nyangadzayi Musuka
44424e0687
chore: comment-out logging by default
2022-10-21 05:11:48 -03:00
Rekai Nyangadzayi Musuka
4b43dcd256
fix(cpu): improve LDR/STR write-back logic
2022-10-21 05:11:48 -03:00
Rekai Nyangadzayi Musuka
47805fb60c
feat(bus): implement Palette RAM and DISPSTAT
2022-10-21 05:11:48 -03:00
Rekai Nyangadzayi Musuka
abe2fc431e
fix(bus): restrict Game ROM and VRAM to a 16-bit bus
2022-10-21 05:11:48 -03:00
Rekai Nyangadzayi Musuka
46c694d95a
fix(cpu): properly implement SUB/CMP CSPSR carry bit condition
2022-10-21 05:11:48 -03:00
Rekai Nyangadzayi Musuka
faced77161
fix(cpu): resolve reversed if statement + write back on W = 0
2022-10-21 05:11:47 -03:00
Rekai Nyangadzayi Musuka
32f0b9d71c
chore: add mgba compatible (minus disasm) log function
2022-10-21 05:11:47 -03:00
Rekai Nyangadzayi Musuka
bbdcc0a8c2
chore: rename CPSR u32 from val to raw
2022-10-21 05:11:47 -03:00
Rekai Nyangadzayi Musuka
67bf975034
chore: remove print statements
2022-10-21 05:11:47 -03:00
Rekai Nyangadzayi Musuka
da7300a78c
chore: remove all memory leaks
2022-10-21 05:11:47 -03:00
Rekai Nyangadzayi Musuka
5c5179a553
feat(ppu): implement VRAM
2022-10-21 05:11:47 -03:00
Rekai Nyangadzayi Musuka
dcf78d0f76
fix(emu): prevent infinite loop when advancing scheduler
2022-10-21 05:11:46 -03:00
Rekai Nyangadzayi Musuka
4836ea3bcf
fix(io): fix DISPCNT is at wrong IO address
2022-10-21 05:11:46 -03:00
Rekai Nyangadzayi Musuka
182392bf1c
feat(cpu): properly implement STR STRH and STRB
2022-10-21 05:11:46 -03:00
Rekai Nyangadzayi Musuka
c6de540c8a
feat(cpu): implement skipBios method
2022-10-21 05:11:46 -03:00
Rekai Nyangadzayi Musuka
82fb5e7a93
chore: panic on read from BIOS
...
GBA Bios requires a lot of implemented features, so we're ignoring it
for now
2022-10-21 05:11:46 -03:00
Rekai Nyangadzayi Musuka
cbcc6282df
feat(bus): add Io Struct
...
Also, add more information to all panic messages
2022-10-21 05:11:46 -03:00
Rekai Nyangadzayi Musuka
614ac4a262
chore: rename consturctors to fit convention
2022-10-21 05:11:45 -03:00
Rekai Nyangadzayi Musuka
80d49e03d6
chore: move bitfield library to lib director
...
I'd presonally prefer to use a git submodule here but It doesn't quite
seem like git submodules are possible for individual files. I'll have to
check with FlorenceOS every once and a while to ensure that there are no
lingering soundness issues with the library.
Thanks to @N00byEdge for this wonderful library!
2022-10-21 05:11:45 -03:00
Rekai Nyangadzayi Musuka
7016fcdb79
chore: use bitfield library
2022-10-21 05:11:45 -03:00
Rekai Nyangadzayi Musuka
f030889d6c
feat(bus): emu is now able to read from user-provided BIOS
2022-10-21 05:11:45 -03:00
Rekai Nyangadzayi Musuka
d50aff30c9
feat(bus): implement Gameboy Advance MMIO
2022-10-21 05:11:45 -03:00
Rekai Nyangadzayi Musuka
5cbfae677a
feat: implement ROM CLI argument
2022-10-21 05:11:45 -03:00
Rekai Nyangadzayi Musuka
d660babecd
fix(cpu): purposely overflow when calculating PC during branch
2022-10-21 05:11:44 -03:00
Rekai Nyangadzayi Musuka
cb06c20864
feat(cpu): implement condition field behaviour
2022-10-21 05:11:44 -03:00
Rekai Nyangadzayi Musuka
c98e8d384a
chore: conform to zig style guides
2022-10-21 05:11:44 -03:00
Rekai Nyangadzayi Musuka
446eeba094
chore: run zig fmt
2022-10-21 05:11:44 -03:00
Rekai Nyangadzayi Musuka
e841bf44ca
chore(cpu): iron out some false assumptions
2022-10-21 05:11:44 -03:00
Rekai Nyangadzayi Musuka
1991bd8525
feat: implement LDR STR
2022-10-21 05:11:44 -03:00
Rekai Nyangadzayi Musuka
6c6d7d463d
chore: run zig fmt
2022-10-21 05:11:43 -03:00
Rekai Nyangadzayi Musuka
acdf13cb7b
chore: add reccomended vscode extensions
2022-10-21 05:11:43 -03:00