Commit graph

190 commits

Author SHA1 Message Date
Clownacy
e732534e91 3DS - Fix hang on shutdown 2020-10-14 18:40:37 +01:00
Clownacy
c478cf242b Add a missing #include 2020-10-10 15:25:58 +01:00
Clownacy
94dd419858 Add explicit parameter for render targets
With the new Wii U upscaling code, 640x480 uses too much MEM1.

Honestly, maybe I should just overhaul how render targets work on the
Wii U. Surely there's a way to dynamically allocate only one colour
buffer at a time?
2020-10-04 14:19:16 +01:00
Clownacy
d3e18d795d Merge branch 'accurate' into portable 2020-09-17 22:10:24 +01:00
Clownacy
620a25d75c Made out ASM-accurate
It just so happens that a path buffer and a FILE pointer both take up
the right amount of stack space *and* have the correct stack frame
ordering, so maybe this is actually what the original source code
did.
2020-09-17 21:44:13 +01:00
Clownacy
3a3530252b Document some leftover debug-related code 2020-09-17 21:07:49 +01:00
Clownacy
c0a6441bcb Fix another typo 2020-09-17 21:07:48 +01:00
Clownacy
527328c303 Fix a typo 2020-09-17 21:07:48 +01:00
Clownacy
2b848ad16e Finally, Windows-accurate font sizing
And of course Windows has some weird bug that has to be emulated with
FreeType.
2020-09-17 15:02:42 +01:00
Clownacy
c9f17c4411 Rename FreeType font functions 2020-09-17 15:02:42 +01:00
Clownacy
9973dddbbd Restore the FreeType code
Now you can select either the FreeType fonts or the pre-rendered
fonts with CMake's 'FREETYPE_FONTS' option.
2020-09-17 15:02:42 +01:00
Clownacy
aac1c9c844 Get 640x480 and Japanese builds working again 2020-09-17 15:02:42 +01:00
Clownacy
fe76fe6dea Big scary messy unfinished font overhaul
This is currently hardcoded to 640x480 English builds.

What I've done is temporarily gutted the FreeType2 font renderer, and
instead introduced a system where the font is read from a
pre-rendered font atlas. This allows me to get 100% accurate font
rendering to Windows XP... because I literally created these atlases
with Windows XP.

So not only does this eliminate the issue of FreeType producing
misshapen glyphs, but it also works around the copyright issue
regarding bundling the Courier New and MS Gothic fonts with CSE2.

You see, font files can be copyrighted like any old software, however
typefaces have a lot less protection - they're basically fair-game.
IANAL, of course - look it up yourself.

I don't really want to throw away the FreeType font system since I
spent a ton of time working on it, it allows you to use other font
files, and I'll probably wind up needing it for CSE2EX. I guess I'll
just have to find some way to either have the two systems coexist, or
make it so one or the other can be selected at compile-time.
2020-09-17 15:02:36 +01:00
Clownacy
d1560da217 Fix bitmaps at 640x480 2020-09-16 17:45:15 +01:00
Clownacy
142db71cb9 Move sanity checks to Draw.cpp
There, no need to keep track of a bunch of duplicate sanity checks
2020-09-15 00:07:10 +01:00
Clownacy
6b18ec91be Replace LockSurface with UploadSurface
The old locking/unlocking API was plain inefficient. Soon I'll move
upscaling to the backend anyway, to minimise the overhead where
possible.

Currently only the software renderer has been updated.
2020-09-14 23:03:23 +01:00
Clownacy
17da39fa14 Rename FontObject to Font
Explicitly calling it an object just seems unnecessarily verbose,
2020-09-14 11:54:37 +01:00
Clownacy
5b33d0280d Merge branch 'accurate' into portable 2020-09-12 00:30:03 +01:00
Clownacy
f54dc8ce05 Ramble about the broken font sizes 2020-09-11 23:55:25 +01:00
Clownacy
0324d1532b Apply SurfaceID type 2020-09-10 21:29:25 +01:00
Clownacy
1f88f7ffaf Make some code uniform 2020-09-10 21:26:22 +01:00
Clownacy
988f1128dd Convert a bunch of ints to size_t
ints are dumb - only use them when you have to
2020-09-10 17:36:21 +01:00
Clownacy
7cff891452 Remove that FRAMERATE thing 2020-09-03 21:31:49 +01:00
Clownacy
0c367cecf7 Add FIX_MAJOR_BUGS option
This one specifically fixes bugs that either invoke undefined
behaviour or cause memory leaks. Essentially, they affect stability.
Bugs that just affect gameplay will remain covered by FIX_BUGS.
2020-09-03 21:05:14 +01:00
Gabriel Ravier
ca8b5ccaa1 Merge branch 'portable' into portableMinimizeHeaders
# Conflicts:
#	src/BulHit.cpp
2020-07-02 15:26:33 +02:00
Clownacy
28964f166c Merge branch 'accurate' into portable 2020-07-02 02:24:15 +01:00
Clownacy
5983b8e234 Don't mark out as static
Causes it to be put in the wrong part of the EXE for some reason,
even though we know from the Mac port that it *was* static.
2020-07-01 21:57:57 +01:00
Gabriel Ravier
32c8795ead src: Cleaned up includes to only (and always) include what we use
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-01 18:26:22 +02:00
Clownacy
e934cae696 Merge branch 'accurate' into portable 2020-06-30 17:32:19 +01:00
Clownacy
770f3be74e Make font sizes more accurate to the vanilla EXE
This is such a nightmare
2020-06-30 16:04:25 +01:00
Clownacy
27a1fd900f Revert more unnecessary edits 2020-06-30 13:48:46 +01:00
Gabriel Ravier
a62141e185 src: Added back stddef.h where accurate to get NULL/size_t properly (stdio.h provides them, but it's for file I/O, not essential definitions and types)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 01:52:38 +02:00
Gabriel Ravier
66e4995135 src: Remove unnecessary includes
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 00:12:17 +02:00
Gabriel Ravier
771b944d17 src: Some cleanup for the MAX_PATH std::string PR
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-29 19:02:25 +02:00
Gabriel Ravier
564d42dbd2 src: Change from using asprintf-based code to using std::string-based code
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-29 18:33:22 +02:00
Gabriel Ravier
32a879ca58 src: Removed MAX_PATH and made the path/string handling better in general (ported over from supportPathsAboveFilenameMax)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-29 00:14:30 +02:00
Clownacy
4403d10c14 Merge branch 'accurate' into portable 2020-05-04 18:24:23 +01:00
Clownacy
70a3badc0d Cleanup 2020-05-04 18:21:44 +01:00
Clownacy
2f682a102f Merge branch 'accurate' into portable 2020-05-04 18:17:39 +01:00
Clownacy
03250d62a0 Make variables more accurate
This commit changes which variables are static: the Mac (and
presumably the Linux) debug data tells you what variables are static,
by prefixing their names with double_underscores.

The variable names themselves also hint at this: global variables are
prefixed with 'g', and use upper-camelcase, while static variables
use whatever_you_call_this.
2020-05-03 20:28:56 +01:00
Clownacy
16f29f6fb7 Merge branch 'accurate' into portable 2020-04-26 00:56:40 +01:00
Clownacy
43c0b670ab Figured out the mystery values in RestoreSurfaces
They're ASCII characters.
2020-04-26 00:07:45 +01:00
Clownacy
e4e8453ba6 Make some logic more like vanilla 2020-04-25 17:58:19 +01:00
Clownacy
a7f2ec6a5e Safely-handle LockSurface failing
Fixes crash on Wii U at 1280x720 (LockSurface fails there because
CreateSurface fails - maybe it's running out of memory again)
2020-04-23 19:53:33 +01:00
Clownacy
a2cdd9ac18 Allow surfaces to be marked as not-render-targets
The Wii U has a very limited pool of memory for render targets
(32MB), so we should only use it if we have to.

This 'fixes' a bug in the enhanced branch, where if you use 2x
sprites at 854x480, the third line of the text box will be corrupted
(text will appear on the second line instead, and be black instead of
white).

The other renderers haven't been updated for the API change yet.
2020-04-23 13:23:10 +01:00
Clownacy
bfc2d4e326 ...Maybe I should test my fixes before commit 2020-04-21 14:59:05 +01:00
Clownacy
afb3c834a7 Do not draw sprites with backwards/empty RECTs
Previously, each backend had to guard against it, which is messy,
results in duplication, and leaves new backends open to the risk
of not guarding against it (the Wii U GX2 renderer didn't).
2020-04-21 14:54:29 +01:00
Clownacy
b89207b586 Merge branch 'accurate' into portable 2020-04-20 01:17:19 +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
8f49276d5e Note some not-so-authentic variable names 2020-04-16 14:44:53 +01:00