Commit Graph

7 Commits

Author SHA1 Message Date
Lephenixnoir cf6c10ed29
Update icon to the new style 2021-07-29 18:43:13 +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 271d9d588d
Clean up more warnings 2021-07-27 11:34:35 +02:00
Lephenixnoir e52f315de2
Silence some warnings 2021-07-26 10:18:52 +02:00
Lephenixnoir 58e22d75d4
Build system
* Use sh-elf-gcc (as used on Planète Casio)
* Link with libfxcg -DFXCG_MINI_COMPAT
* Disable LTO as it caused problems (hopefully could be reenabled later)
2021-07-17 10:46:35 +02:00
Computer Nerd 6bd7e296b4 Possible CG-50 update. 2019-04-04 00:11:35 -05:00
ComputerNerd bd6bb43473 Inital commit 2015-04-14 19:16:51 -05:00