cross-platform support man. it's tricky.
I didn't want to include more libraries, but I really didn't want to
deal with cross-platform pathfinding, or coming up with a custom
config format.
I still had to slap together a janky solution for getting a folder's
absolute path across platforms, but it seems to get the job done...
I have no idea what i'm doing lol.
I'm starting with the noise channel, since I think that might be the
easiest to do?
I _think_ I implemented it properly, since sniffing the output gives
reasonable volumes, but I don't really understand how to generate
sound waves from it yet...
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.
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.
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!
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?!