Commit Graph

71 Commits

Author SHA1 Message Date
Lephenixnoir 56e0d05640
Fix some textures not being rendered, like STARGR2 in E2M3
This occurs if all texture IDs on a particular line are multiples of
256 (like STARGR2 = 256) since the cast to boolean (byte) destroys
significant bits.
2021-08-12 14:03:56 +02:00
Lephenixnoir 5520a6e5ee
Restore video mode after an error
When using direct-DD access, the window size would not be restored,
producing complete nonsense.
2021-08-12 13:12:48 +02:00
Lephenixnoir 64452f9f74
Fix probabilistic crash in Quit Game menu entry 2021-08-11 20:23:05 +02:00
Lephenixnoir 292581f87c
Fix FPS counter not acocunting for frameskip 2021-08-05 09:51:35 +02:00
Lephenixnoir d9f23fc156
Show FPS counter in its own top-right widget 2021-08-04 19:15:25 +02:00
Lephenixnoir fb796d7611
Fix blue key showing up as yellow
Not sure how we got there?!
2021-08-04 19:01:35 +02:00
Lephenixnoir 9c6ed32fee
G3A update 2021-08-04 18:50:00 +02:00
Lephenixnoir 40fe796d85
Add a main screen option to warp to any episode 2021-08-04 18:44:59 +02:00
Lephenixnoir 4dd99b0695
Improve number input in main screen 2021-08-04 18:44:29 +02:00
Lephenixnoir 92c8dcf56e
Restore white frame less agressively
OS does it on its own, so the transition is cleaner like that.
2021-08-04 18:24:37 +02:00
Lephenixnoir 18e583dad4
G3A update with direct-DD access 2021-08-04 15:59:11 +02:00
Lephenixnoir 4832390802
Add secondary VRAM as heap when using direct-DD access
Ultimate Doom E1M6 now loads!
2021-08-04 15:58:40 +02:00
Lephenixnoir 8c643db6a4
Set a black frame when using direct-DD access 2021-08-04 15:38:13 +02:00
Lephenixnoir db01fa04f2
Set a black frame when not using direct-DD access 2021-08-04 15:11:03 +02:00
Lephenixnoir 57624763e3
Add a compile-time option to use direct-DD access 2021-08-04 14:53:24 +02:00
Lephenixnoir 977f23a965
Add FPS counter, toggled with [(] 2021-08-04 14:26:36 +02:00
Lephenixnoir 33ec8b4651
G3A update with a lot of new levels 2021-08-04 13:40:19 +02:00
Lephenixnoir 6a73494e2c
Force lump allocation for unaligned Flash addresses 2021-08-04 12:08:07 +02:00
Lephenixnoir bb86fd1145
Add an option to start at any map 2021-08-04 11:34:02 +02:00
Lephenixnoir 8b7649c824
Restore all menu options to sane behavior
Load/Save game is still not supported.
2021-08-04 11:07:14 +02:00
Lephenixnoir 27f40b003e
Add brightness setting (gamma correction) on FRAC 2021-08-04 10:22:35 +02:00
Lephenixnoir 5e420d7c4a
TODO list update 2021-08-04 10:02:34 +02:00
Lephenixnoir 6d2bac49a2
Put all screens in SaveVRAMBuffer
This removes 6400 bytes from the Z_Malloc heap. There is about 27 kB
left in the secondary VRAM for further use.
2021-08-04 09:57:03 +02:00
Lephenixnoir 4c3b0b8fe6
Place WAD fragment map in PRAM0 2021-08-04 09:56:24 +02:00
Lephenixnoir 3e79691ad1
Report CGDMalloc failures 2021-08-04 09:55:36 +02:00
Lephenixnoir 58e007be85
DOOM -> Doom 2021-08-04 09:55:07 +02:00
Lephenixnoir b0c1f019e3
Find fragments in file map by binary search
This makes a noticeable difference in Ultimate Doom, which has a lot
more fragments by sheer file size.
2021-08-03 18:43:45 +02:00
Lephenixnoir 1e98b33a93
TODO list update 2021-08-03 17:54:12 +02:00
Lephenixnoir 9baaeb6d19
Store fragments' file address, not length
Cumulating lengths will allow a binary search for faster lookup. This is
important because performance seems to vary wildly with the number of
fragments, which I suspect is related to the linear search algorithms
(as there are often several hundred fragments).

Performance had dropped to 3.5s from 2.9s since last test, and
surprisingly this change pulls it back up to 2.9s, even though the
number of fragments now (150) is still more than during the first test
(100).

I suspect binary search will improve performance again. This would be
very helpful, as it would prove that WAD access is the primary
bottleneck for the game. Unlike actual game code, WAD access is
something we can look at and even optimize.
2021-08-03 17:50:27 +02:00
Lephenixnoir 92c1cfe522
Restore the V_Clear function
I removed it before because I had missed the point about clearing the
screen when changing "details" (= the level of detail).
2021-08-03 17:50:27 +02:00
Lephenixnoir e4c06f1ec5
Enable all composite textures (for now) 2021-08-03 14:55:12 +02:00
Lephenixnoir c7961f7992
G3A update with main UI and options 2021-08-02 22:02:19 +02:00
Lephenixnoir 0f9658279b
Add the LICENSE file and description 2021-08-02 22:00:46 +02:00
Lephenixnoir dce39fcbf5
Offer Bfile vs. mmap dynamically 2021-08-02 21:55:39 +02:00
Lephenixnoir b1f8a97983
UI improvements and sprintf 2021-08-02 21:11:13 +02:00
Lephenixnoir 4e7fa7781e
Add some custom UI for game selection and options 2021-08-02 19:19:42 +02:00
Lephenixnoir 4a6825a2eb
Enable options screen in menu 2021-08-02 19:19:19 +02:00
Lephenixnoir d64ef29d58
Properly credit authors of Nspire ports 2021-08-01 13:22:58 +02:00
Lephenixnoir b8eed6f5d0
Enable menu (X,O,T is ESCAPE, log is RETURN)
This is temporary, the keymap will likely be changed later.
2021-07-30 17:42:44 +02:00
Lephenixnoir 1ada53589f
TODO list update 2021-07-30 16:46:26 +02:00
Lephenixnoir b6291e524f
G3A update 2021-07-30 12:01:04 +02:00
Lephenixnoir e14149c646
Improved, parallel controls with KEYSC driver
This change adds proper key control by querying the KEYSC directly
instead of using PRGM_GetKey(). This allows for the very distinctive
advantage of pressing multiples keys at once.

Controls are still quite hard to use, I'll think of an alternative
keymap.
2021-07-29 20:43:44 +02:00
Lephenixnoir cf6c10ed29
Update icon to the new style 2021-07-29 18:43:13 +02:00
Lephenixnoir b9c676ea4e
Support multiple zones in Z_Malloc and add user stack leftover
lumpinfo is now allocated in Z_Malloc because it's needed for some
larger WADs.

More heap is needed to compensate and to support larger WADs fully, so
the unused part of the user stack is added as a second zone.

This makes at least the start of the DOOM Ultimate WAD playable.
2021-07-29 16:45:26 +02:00
Lephenixnoir e18b08d5e4
Add a file loading progress bar
The bar takes up a little bit of time too, but I think it's a plus.
Currently it's limited to ~20 frames which is normally < 0.3s. A frame
every fragment is disastrous in comparison (loading time x3 lol).
2021-07-29 11:40:09 +02:00
Lephenixnoir dc7519fe3e
Fix level end screen
This was using screens[1] which I had deallocated when fixing the status
bar (I incorrectly assumed it was used only for that).

While the CGDOOM technique to share screens[1] to avoid allocating the
320x20 buffer for the status bar makes clear sense with that new
information, I think I'll keep this 6.4 kB buffer there and rather
search for ways to use more memory zones.
2021-07-29 10:13:00 +02:00
Lephenixnoir bba94dcc32
G3A for optimized version 2021-07-28 23:16:45 +02:00
Lephenixnoir 72ab09a35a
Remove performance indications 2021-07-28 23:16:28 +02:00
Lephenixnoir 55f9d43237
Optimize loading speed (x2.7) and game speed (+35%)
Loading is measured by RTC_GetTicks().

* Initial version: 9.8s
  This was a regression due to using 512-byte sectors instead of 4 kiB
  clusters as previously.

* Do BFile reads of 4 kiB: 5.2s (-47%)
  Feels similar to original code, I'll take this as my baseline.

* Test second half of Flash first: 3.6s (-31%)
  By reading from FLASH_FS_HINT to FLASH_END first many OS sectors can
  be skipped (without missing on other sectors just in case).

* Load to XRAM instead or RAM with BFile
  The DMA is 10% slower to XRAM than to RAM, but this benefits memcmp()
  because of faster memory accesses through the operand bus. No effect
  at this point, but ends up saving 8% after memcmp is optimized.

* Optimize memcmp for sectors: 3376 ms (-8%)
  The optimized memcmp uses word accesses for ROM (which is fastest),
  and weaves loop iterations to exploit superscalar parallelism.

* Search sectors most likely to contain data first: 2744 ms (-19%)
  File fragments almost always start on 4-kiB boundaries between
  FLASH_FS_HINT and FLASH_END, so these are tested first.

* Index most likely sectors, improve FLASH_FS_HINT: 2096 ms (-24%)
  Most likely sectors are indexed by first 4 bytes and binary searched,
  and a slightly larger region is considered for hints. The cache hits
  119/129 fragments in my case.

* Use optimized memcmp for consecutive fragments: 1408 ms (-33%)
  I only set it for the search of the first sector in each fragment and
  forgot to use it where it is really needed. x)

Game speed is measured roughly by the time it takes to hit a wall by
walking straight after spawning in Hangar.

* Initial value: 4.4s

* Use cached ROM when loading data from the WAD: 2.9s (-35%)
  Cached accesses are quite detrimental for sector search, I assume
  because everything is aligned like crazy, but it's still a major help
  when reading sequential data in real-time.
2021-07-28 23:06:42 +02:00
Lephenixnoir c04efa5319
Measure file mapping time 2021-07-27 18:43:20 +02:00