Commit Graph

337 Commits

Author SHA1 Message Date
Rekai Nyangadzayi Musuka c100d64fcb chore: tick scheduler on memory access 2022-04-09 19:43:27 -03:00
Rekai Nyangadzayi Musuka 5da84aff36 chore: log error on open bus in page 0x00 and 0x01 2022-04-09 18:01:17 -03:00
Rekai Nyangadzayi Musuka 76789aa8bc chore: rewrite I/O read/writes 2022-04-08 17:07:36 -03:00
Rekai Nyangadzayi Musuka 80e714e2eb chore: reimplement bus read/writes 2022-04-08 16:48:43 -03:00
Rekai Nyangadzayi Musuka 37a360ec07 fix: force align reads/writes in memory bus rather than in CPU 2022-04-08 15:17:31 -03:00
Rekai Nyangadzayi Musuka a976a5769e fix: pass none.gba and kind of sram.gba from jsmolka test suite 2022-04-08 14:38:35 -03:00
Rekai Nyangadzayi Musuka 6df55c2d86 feat: implement GamePak out-of-bounds reads 2022-04-08 02:34:08 -03:00
Rekai Nyangadzayi Musuka a1008738d2 chore: run zigfmt 2022-04-08 02:13:58 -03:00
Rekai Nyangadzayi Musuka 11a034658a chore: change implementation of rotr 2022-04-08 02:13:41 -03:00
Rekai Nyangadzayi Musuka aac01b0bfe chore: rewrite read/write methods for remainig Bus devices 2022-04-08 02:08:26 -03:00
Rekai Nyangadzayi Musuka 5310c12669 chore: mirror VRAM 2022-04-08 01:10:12 -03:00
Rekai Nyangadzayi Musuka 9b9de11e0c chore: write generic read/write for VRAM 2022-04-08 00:44:52 -03:00
Rekai Nyangadzayi Musuka f8018854be Merge branch 'main' of ssh://musuka.dev:2222/paoda/zba 2022-04-07 17:23:22 -03:00
Rekai Nyangadzayi Musuka fae4b430ab chore: update dependencies 2022-04-07 17:23:07 -03:00
Rekai Nyangadzayi Musuka 3046e6243a chore: don't assume 1cpi when stepping by a frame 2022-03-29 09:06:26 -03:00
Rekai Nyangadzayi Musuka e127669549 Revert "chore: tick on memory access instead of 1cpi"
This reverts commit 7f555095f2.
2022-03-29 08:58:57 -03:00
Rekai Nyangadzayi Musuka 7f555095f2 chore: tick on memory access instead of 1cpi 2022-03-29 08:50:12 -03:00
Rekai Nyangadzayi Musuka 29da7b294e feat: implement Flash backup cartrige kinds 2022-03-28 19:41:22 -03:00
Rekai Nyangadzayi Musuka bf7b533b3c chore: stub more apu I/O addresses 2022-03-28 19:40:47 -03:00
Rekai Nyangadzayi Musuka 37c039fb92 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-03-22 15:03:05 -03:00
Rekai Nyangadzayi Musuka 4c172cff70 fix: account for subset of disallowed chars in save file names 2022-03-22 14:55:08 -03:00
Rekai Nyangadzayi Musuka bd54cba8a0 feat: implement SRAM saving and loading 2022-03-22 14:41:18 -03:00
Rekai Nyangadzayi Musuka da4bb17782 chore: properly deallocate OAM buffer 2022-03-22 11:41:17 -03:00
Rekai Nyangadzayi Musuka 5dd69500ca fix: speed percentage in title is now accurate
We now properly account for full speed being 59.97Hz not, 59Hz or 60Hz
2022-03-22 10:39:42 -03:00
Rekai Nyangadzayi Musuka eff25a0ab2 chore: make some variables const 2022-03-19 02:00:53 -03:00
Rekai Nyangadzayi Musuka 1901a471e4 feat: minor performance improvements 2022-03-18 09:49:49 -03:00
Rekai Nyangadzayi Musuka 3d61c0dba4 feat: switch from BGR555 to RGBA8888 2022-03-18 07:52:54 -03:00
Rekai Nyangadzayi Musuka 39ab363afa fix: improve perf of instructions w/ rotr 2022-03-16 22:56:37 -03:00
Rekai Nyangadzayi Musuka 1921218c7b fix: improve frame limiting and fps counting 2022-03-16 21:25:32 -03:00
Rekai Nyangadzayi Musuka 40968f0990 fix: implement proper SRAM mirroring and stub Flash 2022-03-15 21:54:55 -03:00
Rekai Nyangadzayi Musuka 04d54ec97a chore: move DMA and Timers from io to bus 2022-03-15 08:25:26 -03:00
Rekai Nyangadzayi Musuka 1fd80c1c23 feat: define APU registers 2022-03-15 08:09:07 -03:00
Rekai Nyangadzayi Musuka 48679fa4ca fix: move code in scheduler to ppu 2022-03-15 08:09:07 -03:00
Rekai Nyangadzayi Musuka bdea19f280 chore: create different types of emuloops 2022-03-15 03:46:33 -03:00
Rekai Nyangadzayi Musuka 5579643d65 fix: resolve relative sprite priority issues 2022-03-15 00:37:29 -03:00
Rekai Nyangadzayi Musuka c6e6b42869 chore: improve accuracy of frame limiter 2022-03-14 20:38:29 -03:00
Rekai Nyangadzayi Musuka 3623362f72 chore: improve accuracy of thread sleep in emu thread 2022-03-14 08:54:48 -03:00
Rekai Nyangadzayi Musuka c538079ad4 feat: implement video sync 2022-03-14 05:16:02 -03:00
Rekai Nyangadzayi Musuka 8e3f48837d chore: organize io switch statements 2022-03-13 07:50:19 -03:00
Rekai Nyangadzayi Musuka 025f295c08 fix: mirror SRAM
SRAM is mirrored in 64K chunks
TODO: According to GBATEK SRAM chips are 32K and mirrored
2022-03-13 05:53:32 -03:00
Rekai Nyangadzayi Musuka 017ec407f5 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-03-13 05:39:09 -03:00
Rekai Nyangadzayi Musuka 4a76611fca feat: implement Timers 2022-03-13 05:35:01 -03:00
Rekai Nyangadzayi Musuka cb10dfbdfd fix: implement sprite coord overflow behaviour 2022-03-12 03:46:41 -04:00
Rekai Nyangadzayi Musuka 0c50ef1e6d fix: resolve issues with sprite mirroring 2022-03-11 23:52:56 -04:00
Rekai Nyangadzayi Musuka 05e67da181 feat: Implement MVP of Mode 0 Sprites 2022-03-11 01:43:47 -04:00
Rekai Nyangadzayi Musuka f1df3d6615 chore: clean up io 2022-03-04 22:55:04 -04:00
Rekai Nyangadzayi Musuka c5b4b51ae0 feat: fix tile flipping issue 2022-03-03 03:08:35 -04:00
Rekai Nyangadzayi Musuka 2e4854c2ff chore: add some type definitions for sprites 2022-03-03 02:10:33 -04:00
Rekai Nyangadzayi Musuka 85f0b13f4a feat: improve DMA Transfer support 2022-03-03 02:10:29 -04:00
Rekai Nyangadzayi Musuka dccd00782b chore(ppu): resolve integer overflow regression 2022-03-02 23:15:10 -04:00
Rekai Nyangadzayi Musuka 3d8c944bcc feat(ppu): implement bg priority and transparency 2022-03-02 01:39:05 -04:00
Rekai Nyangadzayi Musuka cb4d3a9a51 chore: replace unnecessarily complex sign extension implementation 2022-02-28 20:38:50 -04:00
Rekai Nyangadzayi Musuka ddb68a7952 feat: pass beeg yoshi 2022-02-28 18:24:24 -04:00
Rekai Nyangadzayi Musuka 97de5d1a96 fix: palette id is a u16 not a u8 2022-02-28 17:32:10 -04:00
Rekai Nyangadzayi Musuka d6ef53fd67 feat: DMA Transfer MVP 2022-02-28 12:34:00 -06:00
Rekai Nyangadzayi Musuka b65f833b28 feat(ppu): implement transparency + backdrop in mode 0 2022-02-26 18:33:16 -06:00
Rekai Nyangadzayi Musuka ac0486be1b chore(io): replace some bitfields with enums 2022-02-24 17:20:23 -06:00
Rekai Nyangadzayi Musuka 441ebc38c7 fix: better emulate behaviour of IO reads 2022-02-24 17:20:20 -06:00
Rekai Nyangadzayi Musuka be2dfb379a chore: document select unimplmented I/O registers
These registers are written to / read from Kirby: Nightmare in Dream Land
2022-02-22 17:14:30 -06:00
Rekai Nyangadzayi Musuka bc66be6c06 feat: impelement a barebones SRAM 2022-02-22 17:14:26 -06:00
Rekai Nyangadzayi Musuka 5368ff912d feat: pass retAddr.gba 2022-02-21 15:34:46 -06:00
Rekai Nyangadzayi Musuka c2cf2d2965 feat: implement Hblank and Vcount Interrupts
Also implemented unique behaviour when writing to IF
2022-02-21 14:45:47 -06:00
Rekai Nyangadzayi Musuka e5ab8b51a9 chore: improve Bus log + panic messages 2022-02-19 11:48:43 -05:00
Rekai Nyangadzayi Musuka c767e88e8d chore: improve io.zig 2022-02-19 11:48:17 -05:00
Rekai Nyangadzayi Musuka 9e2e8c3d1a 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-02-19 10:08:31 -05:00
Rekai Nyangadzayi Musuka e426f2459e fix: resolve integer overflow in BG0 Drawing 2022-02-19 06:55:30 -04:00
Rekai Nyangadzayi Musuka 3746cf6025 chore: don't panic on 32-bit I/O 2022-02-19 06:45:39 -04:00
Rekai Nyangadzayi Musuka f6c8d7ca07 chore: stub CPU HALTing 2022-02-17 00:27:34 -04:00
Rekai Nyangadzayi Musuka 07343efdf3 chore: correct logic errors in map size 1 and 3 2022-02-16 23:49:08 -04:00
Rekai Nyangadzayi Musuka 4018f3875b chore: properly write to VOFS and HOFS in 32-bit bus 2022-02-16 23:23:41 -04:00
Rekai Nyangadzayi Musuka 034f2e8d1d feat: implement hofs and vofs on io bus 2022-02-16 04:29:04 -04:00
Rekai Nyangadzayi Musuka d275a4890f feat: implement scrolling 2022-02-16 03:37:25 -04:00
Rekai Nyangadzayi Musuka ce97a52868 feat: add support for multiple BGs in Mode 0 2022-02-16 03:27:06 -04:00
Rekai Nyangadzayi Musuka d2d4667f7b feat: document mode 0 2022-02-16 03:05:19 -04:00
Rekai Nyangadzayi Musuka 5835b509e4 feat: Mode 0 MVP 2022-02-16 02:27:15 -04:00
Rekai Nyangadzayi Musuka 338122ed43 chore: use zig slices for fun 2022-02-13 05:28:56 -04:00
Rekai Nyangadzayi Musuka e5a76a3c02 chore: give DISPCNT DISPSTAT and VCOUNT to PPU struct 2022-02-13 04:28:15 -04:00
Rekai Nyangadzayi Musuka 31fa06ac4a chore: give io read/write functions access to the entire Bus 2022-02-13 04:13:06 -04:00
Rekai Nyangadzayi Musuka ec25a9aae4 feat: implement BG Scrolling Registers 2022-02-13 04:04:10 -04:00
Rekai Nyangadzayi Musuka b238a3e8f3 feat: impelemnt BG0,1,2CNT and IF 2022-02-13 03:23:09 -04:00
Rekai Nyangadzayi Musuka aca7fc9a60 feat: implement OAM 2022-02-13 02:30:02 -04:00
Rekai Nyangadzayi Musuka d2740e30d9 chore: squash bugs preventing swi_demo.gba from working 2022-02-13 02:29:53 -04:00
Rekai Nyangadzayi Musuka 8ab7a178c1 chore(cpu): reimplement bank switching logic 2022-02-12 04:33:32 -04:00
Rekai Nyangadzayi Musuka d897c2fdcc fix: don't mask away MSB in THUMB.5 add 2022-02-12 03:23:55 -04:00
Rekai Nyangadzayi Musuka 783706193b fix: properly decode format 11 instructions 2022-02-12 03:13:38 -04:00
Rekai Nyangadzayi Musuka b93bd53529 chore: make use of scoped logging 2022-02-11 01:33:33 -04:00
Rekai Nyangadzayi Musuka ee27053db3 chore: remove TODOs and some useless imports 2022-02-06 19:07:23 -04:00
Rekai Nyangadzayi Musuka 7441dd151c fix: improper condition check and initialization of register 2022-02-06 18:41:16 -04:00
Rekai Nyangadzayi Musuka bbd4447734 fix(cpu): force align thumb and arm block data transfers 2022-02-06 17:08:12 -04:00
Rekai Nyangadzayi Musuka 225c0f7d55 feat: pass arm.gba 2022-02-06 05:06:25 -04:00
Rekai Nyangadzayi Musuka fcde905ae1 chore: reimplement ARM LDM/STM 2022-02-06 04:34:45 -04:00
Rekai Nyangadzayi Musuka 798987eba0 chore: improve arm ldm/stm 2022-02-05 23:29:34 -04:00
Rekai Nyangadzayi Musuka adfd501fc4 fix(cpu): force-align SWP reads and writes 2022-02-05 23:18:23 -04:00
Rekai Nyangadzayi Musuka 9581e3b3cb fix: force-align ARM STRH reads 2022-02-05 23:09:13 -04:00
Rekai Nyangadzayi Musuka 1b9ab1f1d7 fix: implement the same LDRSH logic as THUMB LDRSH 2022-02-05 23:09:02 -04:00
Rekai Nyangadzayi Musuka c52dc5adb1 fix: PC is 12 ahead when it is rd in str and strb 2022-02-05 21:42:04 -04:00
Rekai Nyangadzayi Musuka 7bfb87a859 fix: listen to my past self
By deleting this line I go from test 234 to test 355 in arm.gba
2022-02-05 21:35:26 -04:00
Rekai Nyangadzayi Musuka 0aece06107 chore: dont use std.mem.bytesToValue
the stdlib accounts for endianness, which isn't something we want.
2022-02-05 21:05:08 -04:00
Rekai Nyangadzayi Musuka 2842345111 chore: remove unnecessary @as calls 2022-02-05 21:01:39 -04:00
Rekai Nyangadzayi Musuka aa6f3c7a92 feat: pass thumb.gba 2022-02-05 20:39:15 -04:00