Skip to content

Update hucc-function-reference.md - #126

Merged
jbrandwood merged 3 commits into
pce-devel:masterfrom
Ryusennin:doc-changes
Aug 13, 2026
Merged

jbrandwood merged 3 commits into
pce-devel:masterfrom
Ryusennin:doc-changes

Conversation

@Ryusennin

Copy link
Copy Markdown
  • Added some notes to the #incchr directive description.
  • Added more information to the Color Functions.

Added some notes to the #inchchr directive description.
Added some more information to the Color Functions.
@jbrandwood

jbrandwood commented Jul 5, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for continuing to update the documentation!

However, either these updates are not strictly accurate, or there are some bugs in the graphics conversion functions that I need to fix!

For instance, you have written that the begin_x and begin_y must be 0 when using _OPTIMIZE, and that absolutely should not be the case. If it is, then there is a bug that must be fixed!

The description of #inctile is mixing the usage of BLOCK (aka BLK) and TILE in a confusing way, and it is referring to TILEs as metatiles when they are not.

A BLOCK is a 16x16 pixel area that is comprised of 4 references to individual 8x8 CHARACTERS from a character set, where each character can use a different palette. It is a classic instance of a METATILE (i.e. something that is made up from a group of other things).

A TILE (from HuC3/HuC4) is a 16x16 pixel area that is a 16x16 bitmap that is all drawn in a single palette. It is NOT a METATILE even though its underlying implementation in VRAM is as 4 contiguous 8x8 CHARACTERS. It behaves as an individual 16x16 bitmap.

Also, maps created with TILEs can quite happily be processed with #incmap, you absolutely do not need to export your maps from Mappy (FMP) or ProMotion (STM)! You certainly can do so, but you definitely do not need to do so. Not that anyone should be using TILEs anyway in HuCC, they offer no practical benefits and just limit your art pipeline.

Why have you marked set_color_rgb() as producing artefacts, but not marked set_color() in the same way? Both functions immediately write to the VCE's palette RAM, and so both produce artefacts if the screen is being drawn at the time.

The important difference is that set_color() does the math at compile time and so is both smaller and a lot faster than set_color_rgb().

Does that all make sense?

Best wishes,

John

@Ryusennin

Copy link
Copy Markdown
Author

Thank you John for the clear explanation of the difference between the HUCC block/metatile and the HuC "tile". In general literature, the "tile" word is often used to describe a pattern of any size (8x8, 16x16, 32x32 even). The old HuC notes are quite confusing and don't always make a distinction between a character and a "tile".

I'll try to rephrase the reference doc a bit better.

As for the bug (?) I encountered with the OPTIMIZE paramater, I'll post later a short code example so you can have a look at it.

@Ryusennin
Ryusennin marked this pull request as draft July 8, 2026 11:48
Made more obvious the difference between old-style TILES and new-style BLOCKS.
@Ryusennin

Copy link
Copy Markdown
Author

Hi John!

I tried to make the difference between old-style TILES and new-style BLOCKS more obvious. Hopefully the doc is more understandable.

I also removed the note about the OPTIMIZE quirk, as I'm not sure if it's an actual bug or if I'm doing something wrong. I'll create a separate issue for this, with a test example.

@jbrandwood
jbrandwood marked this pull request as ready for review August 13, 2026 13:48
@jbrandwood
jbrandwood merged commit 32d04b0 into pce-devel:master Aug 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants