Commit graph

11 commits

Author SHA1 Message Date
Daniel Prilik
f65b943078 replace heavyweight args with single-header clara
oh, and fixed a bug where I didn't clear save-states across game
loads / saves.
2018-06-19 18:58:48 -07:00
Daniel
e5b69f599b fixed windows build - stupid Windows.h >:(
Windows, y u be so annoying, defining macros left-and-right with no
regard for anyone's code smh >:(
2018-06-11 23:02:27 -07:00
Daniel Prilik
1cab46c15d fix crashing appbundle macOS
not entirely sure how to fix windows build yet...
2018-06-11 18:58:28 -07:00
Daniel Prilik
e99b7d13c3 added a SDL filepicking UI
tinyfiledialogs was a good band-aid, but it was always kind-of a
janky solution. Mind-you, this file-browser I threw together ain't
the nicest either, but at least it's within the main SDL window.

Now that the menu is in place, it's possible to switch between
games without restarting! Also, opening the file-picker pauses
ANESE, so that's good to finally have.

Thanks a bunch to cute_headers for a neat little cross-platform
directory traversal library, and also SDL_inprint for a quick-and-
dirty embedded font for use in the menu. Not having to bring-in
SDL_ttf is a huge load off my shoulders.

Oh, and i've noticed that `gui.cc` has started to get bloated, so
now I need to get around to cleaning it up weeeeee.
2018-06-11 18:36:48 -07:00
Daniel Prilik
cfe1d2b94d Mapper 1 Support
So, lots of early assumptions proved to be wrong.
This meant that there was a bunch of code that had to be rewritten.

1) iNES format stores ROMs in 16k / 8k chunks, but that does _not_
   mean that all mappers bank along those lines!

I rewrote the entire ROM File parsing logic, and instead of chunking
the raw ROM into banks at the iNES parsing stage, it is done on a
mapper-per-mapper basis

2) Cartridges are _not_ just dumb data storage devices, and can have
   cycle-dependant logic!

To be fair, I knew I would have to cross this bridge someday. I had
to expand the Cartridge / Mapper interfaces to expose more of the
NES's. This is in both directions: Giving the Cartridge acess to the
NES's cycling logic, and also giving the NES a direct way to get
mirror modes from the cartridge (dynamically)

I was hoping that getting Mapper 1 working would also get Zelda
working, but alas, it's crasahing for some reason! As usual, I
suspect it's some shitty timings, and I can confirm, I am failing
a bunch of the NMI timing tests...

I _really_ don't want to go back into the hellhole that is the PPU,
but gosh darnit, I wanna play Zelda!

But hey, at least Megaman II works now :D

PS: I've been working on this commit for probably, oh, 8h total?
Not all at once mind you, it's been over the span of several days.
Now that i'm back in Toronto, i've been a bit busy, what with the
holidays, and old friends, and Wolfenstein II / DOOM taking up my
time.
2017-12-27 16:34:48 -05:00
Daniel Prilik
dfd561600e >tfw you fix windows and break osx 2017-12-20 10:15:03 -05:00
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
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
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