Commit graph

131 commits

Author SHA1 Message Date
Daniel Prilik
8ad770c589 fix windows build 2017-12-20 00:19:30 -05:00
Daniel Prilik
73883fb814
remove file that broke pulling on windows 2017-12-20 00:05:08 -05:00
Daniel Prilik
edb40e42e7 APU courtesy of Blargg's 💯 nes_snd_emu library
I started looking into how to make the APU, and boy, let me tell
ya, it's going to be a massive undertaking.

Undoubtedly a fun undertaking, but still...

Since it's a personal goal to get Super Mario Bros 2 running
before new years (after all, that game has won
game-of-the-year i don't even know _how_ many years in a row),
i've decided to just use Blargg's venerable `nes_snd_emu` library
for now.

It took some wrestling, it it's in, and it works!

Almost.

I still don't know why enabling the Frame IRQ kills most games, but
i'll look into that!

Welp, on to bigger and better things!
Namely: MMC1, which will give me Zelda and... Super Mario Bros 2!
2017-12-20 00:00:56 -05:00
Daniel Prilik
1893508fec misc cleanup + some apu tests 2017-12-19 16:14:50 -05:00
Daniel Prilik
46a1454cf6 sprite cutoff fix 2017-12-18 22:48:03 -05:00
Daniel Prilik
c0e9556e1d add support for zipped roms
golly, i sure do hate cmake.
why does c++ package management have to be so bloody hard?
2017-12-18 22:26:56 -05:00
Daniel Prilik
0538ae0517 add fast-forward mode 2017-12-18 13:52:36 -08:00
Daniel Prilik
8c8177dc29 sprite 0 hit - MARIO WORKS HOLY SHIT
HOLY SHIT THE DAY THAT I'VE BEEN WORKING TOWARDS FINALLY CAME!

SUPAH.
MAHRIO.
BROS.
1.
WORKS!

Now, mind you, it's not flawless.

There are some issues I still need to work out, but nevertheless,
IT BLOODY RUNS!

I have a suspicion that it's relying on more accurate timings,
since right now, movement is pretty jank, and the time is ticking
far too quickly...

I'll look into the Frame IRQ now, hopefully that will be the last
piece of the puzzle :)

...

I'M SO HAPPY!

...

PS: I'm writing this from a plane as I fly home from vancouver.
It's pretty rad that I got this working on a plane :D
2017-12-17 13:40:41 -08:00
Daniel Prilik
baa01f12e9 BACKGROUND RENDERING PROPERLY! DONKEY KONG WORKS!
It happened! IT FINALLY HAPPENED!
I reimplemented how background pixels are rendered, and by golly,
IT SEEMS TO WORK! And you know what that means... DONKEY KONG
FUCKING WORKS. YES!

This is a _huge_ win for me, and i'm super stoked.

Up next, i'm going to look into redoing sprite rendering properly,
and getting the sprite-0 hit working. Hopefully, that will get SMB1
booting (unless it also needs the Frame IRQ implemented...)

WOOT!
2017-12-16 20:20:22 -08:00
Daniel Prilik
d83fce06f3 minor controller fix 2017-12-16 17:30:27 -08:00
Daniel Prilik
2222f959f0 fix mapper detect + better error msgs 2017-12-15 16:33:55 -08:00
Daniel Prilik
cd6c1aefe3 fix nametable corruption
golly, aren't I a idiot.
I forgot to add an if statement that prevented nametable fetches
from occuring during vblank, thereby causing the ppu to keep
updating the v register even during vblank (i.e: while the CPU was
doing writes too)

now, the last critical bug is actually just nailing the background
rendering, since once that's in place, all that'll be left to do is
add proper Sprite 0 detection, and a rudimentary APU Frame IRQ, and
BAM, most games should "just work" TM

hurrah! looks like this project will play Super Mario Bros before
the new year after all!
2017-12-15 15:55:47 -08:00
Daniel Prilik
14d278e5d2 ui and build improvements
added some 3rd party libs today! man, cmake is pretty complicated,
so it took a while to figure out, but hey, it seems to be working,
so that's good!

I added two libraries:
- `tinyfiledialogs` to handle opening a file-select window (that
  varies per platform) in the case that no rom is specified on the
  commandline.
- `args` handles parsing and validation of commandline arguments.
  As I start to add more and more flags, it's probably a good idea
  to set up a more extensible framework to configure ANESE

Oh, and FYI, this is all me procrastinating working on the PPU.

weeeeeeee!! isn't emulation fun?!
2017-12-14 16:17:51 -08:00
Daniel Prilik
36aa4e222c fix major PPU bug
goddamit. i misread the spec.
i didn't set the vbl flag if i didn't generate a vbl.

goddamit.

this fixes quite a few issues.

afaik, the major issue with ANESE right now is that the NMI is not
set properly. hopefully, i can hammer out the proper timing soon.
2017-12-13 19:31:08 -08:00
Daniel Prilik
61f45d68f6 rudimentary controller support (neat!) 2017-12-13 17:57:23 -08:00
Daniel Prilik
466fa9d0eb very minor logo tweak 2017-12-13 14:09:43 -08:00
Daniel Prilik
c47461cdc0 add logo + windows exe icon 2017-12-13 13:58:39 -08:00
Daniel Prilik
8b7c5f525e switch msvc to use Release config
yeah, i'm a bit of a dummy. I was building ANESE in _Debug_ config
with MSVC, and wondering why it was so bloody slow. Well, no shit
it's slow, it's not even being optimized!

I've set all the flags properly now, and have killed the windows
clang portion of the cmake script. Clang is a massive pain in the
ass to set up on windows with visual studio, so finally getting
MSVC to run ANESE properly is awesome.
2017-12-13 11:35:56 -08:00
Daniel
cabc5d5054 fixed a very silly mistake 2017-12-12 23:10:35 -08:00
Daniel Prilik
c586bc9e11 dma fix + small tweaks 2017-12-12 16:57:57 -08:00
Daniel Prilik
5c19d78761 more tests 2017-12-12 16:56:26 -08:00
Daniel Prilik
85849956c1 more misc edits + timing fixes?
nah, i didn't spend all day on these. I went skating, and i'm just
commiting these changes from earlier. Fun!
2017-12-10 21:32:04 -08:00
Daniel Prilik
283ecf7fb6 slightly better shortcuts 2017-12-10 13:34:53 -08:00
Daniel Prilik
d7c60781b2 implement joypad interface + standard controller
basically i'm just procrastinating, since getting the PPU working is
a _real_ grind
2017-12-10 13:17:32 -08:00
Daniel Prilik
ec1e89408c i want to die 2017-12-09 22:52:08 -08:00
Daniel Prilik
fd43f2bc13 add apu foundations 2017-12-09 20:54:14 -08:00
Daniel Prilik
d90a452ad0 trying random stuff to get things working
let's start with the good:

- well, graphics are a *bit* less janky now, since I fixed the bgr
fetch timings a bit. so that's nice.
- I found out that I forgot to emulate a instruction (CLI). (darn
NESTEST didn't ever test that one!)

and, well, that's it. shit's still fucked yo.

as a hail mary, i'm going to look into emulating some basic APU
stuff, hoping that it will magically make the timings align.

also, i'm starting to get a sneaking suspicion that my fancy
operator overloading and template magic shenanigans are breaking
things in very subtle ways. that fucking terrifies me. it's going
to be a massive shitshow to debug if that is the case.

anyhoo, that's where i'm at right now. time to get some dinner :)
2017-12-09 17:33:10 -08:00
Daniel Prilik
d6c467a04c a bit of reorg 2017-12-08 17:08:29 -08:00
Daniel Prilik
145a46914a add clang build to windows
At this point in development, MSVC is not generating optimized
code for ANESE, and struggles to hit 60 fups.

Clang makes beautifully performant builds though :D
2017-12-04 09:49:35 -08:00
Daniel Prilik
4d02e57a92 work on background rendering - getting closer!
golly gee whiz what a day.

This morning, I seem to have gotten sprite rendering working.
It's not super _accurate_, but hey, it renders basic stuff okay,
so i'm happy.

Background rendering is proving to be a annoying beast to tackle,
and has been causing me quite a bit of headache. Even now, it's not
working just right, and honestly, i'm running out of energy to try
to debug it today.

I have a feeling that my PPU <-> CPU bridge isn't working super
properly, since I feel as though I _should_ be able to run simple
games using my "draw debug nametable to main screen" hack, but
it still doesn't seem to be the case...

Maybe if I implement sprite-0 hit, it'll finally work...

Anyhoo, yeah. Work's chugging along.

I just want to play supah mario bros before new years hits, is that
so much to ask?
2017-12-03 21:35:16 -08:00
Daniel Prilik
01c6acbe30 split sprite eval and sprite pixel fetch 2017-12-03 14:52:31 -08:00
Daniel Prilik
2918634125 shuffle code around for readability 2017-12-03 14:29:42 -08:00
Daniel Prilik
2f616870aa slight modification to CPU interrupt handling 2017-12-03 13:03:10 -08:00
Daniel Prilik
e1da1e65d3 work on sprite rendering
this isn't going well.

i've decided to forget accuracy for the moment, and to focus on
just getting the damn thing working with simple stuff, like the
Zelda title-screen demo, or Donkey Kong.

But fuck me man, this shit is complicated.

I'm going to bed now, and hopefully, next time I work on this,
i'll be able to get sprite rendering working properly.

hell, maybe i'll just scrap that, and instead focus on rendering
the background properly. I have a feeling that's going to be
a bit easier...

Right now, I really want to give up, and call it quits on this
project, because holy crap am I getting annoyed.
But then I remember that one day soon, everything is going to
work, and all this effort will have been worth it.

I hope that day comes soon.
2017-11-20 01:26:31 -08:00
Daniel Prilik
4a755cdbd6 nametable debug view!
holy moley donkey kong is actually rendering nametables golly gee
whiz that's amazing! I mean, nothing really works yet per-se, but
this is some really great progress!

I could try to make a OAM debug view, but I think i'll hold off on
that for now. Instead, i'll try to actually begin implementing the
core render loop.
2017-11-13 17:58:45 -08:00
Daniel Prilik
4866710da8 Set theme jekyll-theme-minimal 2017-11-12 12:58:40 -08:00
Daniel Prilik
ed2554fb65 move docs to research 2017-11-12 12:48:01 -08:00
Daniel Prilik
49f36bec2a dma rework + iNES debug + fups speedup
lmao I left a sin function in the core loop, and that was slow af.
i took it out and i'm back at 60 fups.
2017-11-05 18:59:51 -08:00
Daniel Prilik
8b78cddbbb clean up DEBUG_PPU + start nametable debug
goddam i really hope things start working once I start implementing
the PPU loop propertly.
2017-11-04 21:55:52 -07:00
Daniel Prilik
e5ee0c606a add interupt lines (for NMI)
I wasn't planning on reworking interrupts today, but one thing led
to another, and... yeah.

All I really wanted to do today was get a Palette Table debug view,
but for some reason, it isn't being populated! I had a suspicion
that maybe implementing interrupts would make something click, but
alas, interrupts are in, and no data is being written to the
palette tables :(

I'm just going to leave it be for now, and hope that as more of the
PPU comes together, it will just start working.
2017-11-04 17:52:54 -07:00
Daniel Prilik
e35d61dc93 render pattern tables in debug window
i'm still not entirely sure how the hell i'm supposed to write the
core render loop, but hey, at least I can see some tiles!

my plan right now is to slap together a couple more debug windows
for the various parts of the PPU's memory map, and get a feel for
how all the graphics are layed out in memory.
2017-11-02 22:23:02 -07:00
Daniel Prilik
fbcf280392 improve test scripts + inconsequential edits 2017-11-01 21:51:51 -07:00
Daniel Prilik
7d722d9132 fix g++ and MSVC warnings + do some cppcheck linting 2017-10-31 17:03:23 -07:00
Daniel Prilik
a9d8f56204 moved ram/rom into nes subdirectory 2017-10-30 20:13:54 -07:00
Daniel Prilik
98fe81f7ef add cmake option for NESTEST builds 2017-10-30 19:20:00 -07:00
Daniel Prilik
8d2b632ded rework DMA 2017-10-30 19:03:56 -07:00
Daniel Prilik
344bbb083e overload operator[] for Memory interface 2017-10-30 18:36:28 -07:00
Daniel Prilik
9b1446e4b2 memory map ppu registers + tweaks to logs 2017-10-29 19:32:50 -07:00
Daniel Prilik
f2a4fe55ee inconsequential changes 2017-10-29 16:41:49 -07:00
Daniel Prilik
d72fb7ffc6 ppu register outline and dma rework 2017-10-29 16:11:10 -07:00