Commit graph

2121 commits

Author SHA1 Message Date
Clownacy
bcfcf2c017 Rename 'BUILD_DOCONFIG' to just 'DOCONFIG' 2020-04-20 12:50:53 +01:00
Clownacy
2978db4d30 More cleanup 2020-04-20 12:48:42 +01:00
Clownacy
2f7db28da8 Wii U backend cleanup 2020-04-20 12:46:36 +01:00
Clownacy
5ca12ae22a Tweak Wii U coordinates 2020-04-20 12:42:50 +01:00
Clownacy
65b470ba20 It seems we don't need the colour-buffer (Wii U) 2020-04-20 12:39:55 +01:00
Clownacy
e470b91501 Cleanup and documentation 2020-04-20 02:46:46 +01:00
Clownacy
a112001886 Add complete shader sources 2020-04-20 02:15:55 +01:00
Clownacy
f2ffab48e1 Make Wii U controls more Nintendo-y 2020-04-20 01:35:08 +01:00
Clownacy
b89207b586 Merge branch 'accurate' into portable 2020-04-20 01:17:19 +01:00
Clownacy
c52812664e Fix bosses flicking across the screen when hurt
The Wii U's wacky PowerPC architecture highlighted a cool
platform-dependency: the boss rendering code only properly works on
platforms where `char` is signed by default.

Granted, it's possible Pixel explicitly marked this variable as
signed. Who knows. Either way, CSE2 didn't, and now that's been
fixed.
2020-04-19 22:40:03 +01:00
Clownacy
76dc1f81ec Fix Wii U Pro Controller input oddities 2020-04-19 21:27:32 +01:00
Clownacy
e667844801 Fix Pro Controller support 2020-04-19 21:19:02 +01:00
Clownacy
ba65ebf3fe Add Wii U Pro Controller support
The controller doesn't seem to want to connect yet though.
2020-04-19 21:00:19 +01:00
Clownacy
91bda89661 Restore proper 4:3 aspect ratio 2020-04-19 20:48:48 +01:00
Clownacy
5c575a0be9 Fix crash
Dammit my build process wasn't actually updating the binary I was
testing.
2020-04-19 20:15:20 +01:00
Clownacy
cfe523589d Add the blooming Wii U shader
Geez, this has been missing for ages.
2020-04-19 19:46:01 +01:00
Clownacy
93cf72e269 Add sanity checks to the Wii U hardware mixer
The other audio backends have these - probably for a good reason,
too.
2020-04-19 19:45:09 +01:00
Clownacy
4f80ff4139 Correct a typo 2020-04-19 19:44:06 +01:00
Clownacy
04faccb259 More cleanup 2020-04-19 19:43:57 +01:00
Clownacy
01a444ff8c More cleanup 2020-04-19 19:37:16 +01:00
Clownacy
5704035b9b Cleanup 2020-04-19 19:31:21 +01:00
Clownacy
9e3b158973 Add stereo support to Wii U software mixer 2020-04-19 19:27:02 +01:00
Clownacy
288c2dccee Wii U - Use a frame callback instead of a thread 2020-04-19 19:05:25 +01:00
Clownacy
07ee648181 Add Wii U software audio mixer
The hardware-accelerated one is suffering from a bizarre-ass bug that
I can't fix for the life of me.
2020-04-19 19:03:00 +01:00
Clownacy
745783a025 Wii U samples are signed 2020-04-19 13:51:45 +01:00
Clownacy
7d95fb8ea3 Wii U audio backend cleanup
Still bugging-out though
2020-04-19 13:46:10 +01:00
Clownacy
9e9b86c6e9 Add new Wii U window backend
This uses basic hardware-acceleration to bounce the software-rendered
frame to both the gamepad *and* the TV!

The previous method only supported the gamepad, suffered from V-tear,
and used slightly more CPU (my test with the end of Egg Corridor ran
at 52FPS, while this new method runs at 55FPS).
2020-04-19 13:34:45 +01:00
Clownacy
0b6e90abd0 Work-around some global namespace polution
With GLFW, you're supposed to `#include` your extension loader before
it, but this header made that extremely awkward. The previous "fix"
would cause build errors on Windows when compiling the software
renderer.
2020-04-19 01:37:49 +01:00
Clownacy
320e891a70 Fix keyboard input on Windows 2020-04-19 01:33:52 +01:00
Clownacy
11b04fe93b Update other audio backends 2020-04-18 01:38:25 +01:00
Clownacy
011cb94f73 More guards 2020-04-18 01:23:25 +01:00
Clownacy
873566a19e Attempt 100 of trying to fix Wii U audio hangs
There's a new bug I've noticed: sometimes, an instrument will just
'disappear', and refuse to ever play again.

This stuff is practically impossible to debug, so I'm just throwing
things at the wall. This time, I'm going to make more use of the
`AXVoiceBegin` and `AXVoiceEnd` functions. I have no idea what
they're meant to do: code I found online uses it inconstently, and
Decaf doesn't have it implemented at all!

Hopefully, all of my problems have just been race conditions caused
by not using these guard functions (assuming that's what they are).
2020-04-18 01:16:36 +01:00
Clownacy
bbfcc48e2a Update Wii U instructions 2020-04-18 01:01:53 +01:00
Clownacy
f78f6b7105 Split Organya callback data
The function pointer only ever needs to be set once, unlike the
timer. This should avoid any scary race-conditions.
2020-04-18 00:54:24 +01:00
Clownacy
1ad6fdf539 Rename mutex 2020-04-17 23:52:00 +01:00
Clownacy
b06e1e1312 Remove old junk 2020-04-17 23:48:40 +01:00
Clownacy
051d12f434 Stop shouldn't rewind the sound
According to the DirectSound docs, stop doesn't rewind.

https://docs.microsoft.com/en-us/previous-versions/ms817375%28v%3dmsdn.10%29
2020-04-17 23:47:45 +01:00
Clownacy
5bcc0ec393 New way to allocate Wii U voices
The previous method wasn't good enough: we were still maxing-out at
96 (did the Decaf devs misread that as hex? Is that why the
emulator's limit is 150 instead?).

Anyway, this new solution is a little brutish, but I can't think of
anything else that would work: right now, I have the Organya thread
constantly polling a linked-list of the currently-loaded sounds, and
checking if their voices have finished playing or not. If they've
finished, they get freed.

When AudioBackend_PlaySound is called, if checks if the sound's voice
has been freed or not, and reallocates it if it has.

There doesn't seem to be a noticable overhead to this, and it keeps
the number of currently-allocated voices *very* low (from 10 to 20 on
average).
2020-04-17 23:43:17 +01:00
Clownacy
617f7a25d4 Wii U video tweaks and fixes 2020-04-17 23:42:18 +01:00
Clownacy
b123e3743e Clean-up the weird buggy code
I'mma just assume each sound needs their struct preserving for some
reason.
2020-04-17 21:48:34 +01:00
Clownacy
db14899b3e Try to fix Wii U audio hang part 2
I encountered a hang earlier, so the previous attempt obviously
didn't work.
2020-04-17 18:34:26 +01:00
Clownacy
670f49db77 Optimise Wii U video code a little 2020-04-17 18:07:54 +01:00
Clownacy
76e7a6f857 Revert some suspicious code
I'm getting some rare audio hangs. I tried doing some
regression-testing, but it's so random that I'm getting anomalous
results. That said, there were suspicious results around this change
(and also the way `mix_data` is initialised/cleared), so I'm
reverting this for now, and restoring it next time I encounter a
hang.
2020-04-17 16:58:07 +01:00
Clownacy
c2a857d4f5 Flush the screen buffer on Wii U
Weird cache stuff I don't know
2020-04-17 15:51:27 +01:00
Clownacy
d025fecf54 Minor cleanup 2020-04-17 15:47:56 +01:00
Clownacy
274de9e0f9 Replace Liberation Mono with DejaVu Sans Mono
Looks better at 320x240
2020-04-17 14:18:32 +01:00
Clownacy
93ad3ae7c5 Make font look better at 320x240
This restores some vanilla logic, where at 320x240, the font would
use a slightly larger size, in order to not look terrible.
2020-04-17 14:16:49 +01:00
Clownacy
24bcbb8dfd Upscale 320x240 to 640x480 on the Wii U
For performance reasons, I'm going to switch to 320x240 for Wii U
builds.
2020-04-17 14:15:59 +01:00
Clownacy
a177f44b88 Clean up Wii U audio backend 2020-04-17 14:15:23 +01:00
Clownacy
9eacc74ee2 Got music working on Wii U! 2020-04-17 01:47:23 +01:00