Log In  

I am trying to recreate the background used in the sfx tool.

In main.lua, the sfx tool uses a combination of fillp() and rectfill(). When I use that same combo in my own cart, all I get is a black screen. In the tool, the rectfill color is specified as 32 | (33*256). To me that seems to be a complicated way to specify color. It's also well outside the 32 defined colors. Additionally, when I change the color to be a value in [0,31], I get the correct pattern but the wrong color (obviously).

Further research suggests there are ways to manipulate the color palette. The is seemingly a hidden color palette even!

Could anyone offer insight into what is going on? Or how to make the background found in the sfx tool?

P#144520 2024-03-26 12:52 ( Edited 2024-03-26 12:52)

1

I am no poke/color expert but I wanted to weigh in on what I was able to find. In the SFX tool code a few lines down from the fillp() and rectfill() he defines a custom display palette

-- custom display palette
-- at end.. something in :draw_all() probably calls pal()
   poke4(0x5000+32*4, 0x202020)

If all you want to do is recreate the background the easier way using pal() would be something like

    pal(32,0x202020,2) -- set color 32 with 0xRRGGBB, 2 is this define a color by rgb value mode
    fillp(~0x8239) -- brushed metal? something industrial
    rectfill(0,0,480,270,32)
    fillp()

Hopefully this helps.

P#144723 2024-03-27 17:10

Thanks! I actually discovered that last night! I also found this doc about the gfx system as well. I need to learn more about the pal command I think.

I also noticed that when creating a background like the one in the SFX tool, it blacks out when another window is in focus. I haven't found the cause. Maybe the draw loop is blocked.

P#144923 2024-03-29 00:31

[Please log in to post a comment]