Commit graph

18 commits

Author SHA1 Message Date
Daniel Prilik
cd756d0a2d fix some gcc warnings, and maybe even a ppu bug?
first commit in a _long_ time, and it's just because I installed a
fresh linux distro and wanted to see if ANESE compiles on it.
It does, but I noticed a couple of warnings and bugs, so these are
some quick fixes.

looks like I had an unintended fallthrough in my bgr_fetch routine.
not sure how mission-critical this is, but maybe it fixes stuff?

other than that, g++ helpfuly noted some other silly errors and
unused vars, so I cleaned those up too.

lastly, I removed some code that skipped the first directory
returned by cute_files in the menu component. Not _super_ sure why
that was there in the first place, but directory traversal now
works on some more linux distros (such as the one I am running)
2018-12-03 14:04:27 -05:00
Daniel Prilik
2093dc058d save / load scenes to/from disk
that's it then, the final piece.
You can play games, record scenes, and boot games back up with the
recorded map.

It's not perfect, _far from it_, but it works!

There is still a lot of work to do, improving heuristics and such,
but I think wideNES is at a point where it can be merged into
master and shown off a bit :)

exciting!
2018-07-25 10:31:26 -07:00
Daniel
4768bfaf75 fix windows build 2018-07-17 21:52:55 -07:00
Daniel Prilik
871daf6aa1 tweaked callbacks + refactored SDL_inprint
I wanted to use SDL_inprint in multiple renderers, and that meant I
had to modify the library a little bit.

also, I just noticed that the smearing issue is back! Not as bad as
before, but MMC3 games seems to be affected when the screen scrolls
upwards...

wierd.
2018-07-12 11:28:54 -07:00
Daniel
82be50b3b9 "fixed" config saving on Windows
it's a pretty bad fix tho. instead of increasing the size of my
path buffers, I just removed the MAX_PATH check lol.
2018-06-29 22:54:05 -07:00
Daniel Prilik
245a8b4d97 basic persistent config
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...
2018-06-29 12:20:59 -07:00
Daniel Prilik
3bfe347fa5 begin work on custom APU
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...
2018-06-25 10:40:39 -07:00
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