Commit Graph

15 Commits

Author SHA1 Message Date
Antonio Niño Díaz
82171bbf69 chore: Simplify copyright years in notices
Instead of listing every individual year, keep only the first and last
years.
2024-03-09 01:42:29 +00:00
Antonio Niño Díaz
6e53a01d83 library: tests: Add function to search free space within a range
This is needed to load compressed textures, as it is needed to look for
empty space in two banks at the same time.
2022-10-29 14:10:35 +01:00
Antonio Niño Díaz
63a74c71f2 library: Support allocating chunks at specified addresses 2022-10-28 01:12:42 +01:00
Antonio Niño Díaz
3b09697a91 library: tests: Add function to allocate from end of pool
Add tests for it.
2022-10-27 23:07:28 +01:00
Antonio Niño Díaz
4ec6488068 library: Add comment 2022-10-27 01:32:58 +01:00
Antonio Niño Díaz
f3f4af0daf library: Refactor allocator
Remove support for asking for a specific alignment. Now, the only
supported alignment is 16 bytes, and all sizes are rounded up to 16
bytes. This is the minimum alignment needed for some palettes, which is
the most restrictive case.

This change is a bit wasteful, but it only really matters for 4-color
palettes and textures, which can be aligned to 8 bytes, and it isn't a
problem because:

- 4-color palettes, which can be aligned to 8 bytes, would rarely use
  fewer than 4 colors. Even if they do use fewer than 4 colors, it would
  only waste 8 bytes.

- Textures: It's impossible that a texture doesn't have a size that is
  multiple of 16. It can only happen if the texture has a width of 8
  pixels and a height that isn't a multiple of two... which is a very
  unusual situation.

The benefit of this change is that the code is much easier to understand
and much more maintainable, which will be needed when support for
compressed textures is added, as the code will need to support more
features.
2022-10-27 01:14:40 +01:00
Antonio Niño Díaz
76ccdc379e library: Cleanup source code files 2022-10-16 02:58:48 +01:00
Antonio Niño Díaz
ae7e4104d4 library: Cleanup some more files 2022-10-15 00:36:28 +01:00
Antonio Niño Díaz
c05b5ab2e1 library: Clean code and documentation of some files 2022-10-14 02:50:35 +01:00
Antonio Niño Díaz
b1856d453a Minor fixes to comments 2019-06-14 13:03:23 +01:00
Antonio Niño Díaz
62bb24f88a Fix types in NEMemInfo struct 2019-06-09 20:41:38 +01:00
Antonio Niño Díaz
c9b3321317 Fix NE_Alloc() prototype types 2019-06-09 17:45:00 +01:00
Antonio Niño Díaz
5be032ed44 Fix coding style of library
With a bit of help of `indent -linux`, but mostly by hand. Also used
`iconv -f ISO-8859-1 -t UTF-8//TRANSLIT` to convert to UTF-8.

There is still some refactoring left to do.
2019-06-04 01:02:56 +01:00
Antonio Niño Díaz
8f8bf4d249 Run dos2unix on library source files 2019-05-30 18:45:00 +01:00
Antonio Niño Díaz
f042d0be3e
Initial dump of code of v0.6.1
This commit is a simple dump of the files of [1]. This needs to undergo
some reorganization.

[1] http://www.skylyrac.net/old-site/nitroengine.html
2019-05-29 01:01:57 +01:00