profi200 / open_agb_firm

open_agb_firm is a bare metal app for running GBA homebrew/games using the 3DS builtin GBA hardware.
GNU General Public License v3.0
929 stars 46 forks source link

Displaying position when scaler=0 #81

Open a92126 opened 2 years ago

a92126 commented 2 years ago

When I set the scaler to zero, the image with original size is displaying in the bottom of the top screen.

Is there a way to make the image displaying in the center of the top screen? Or some source code to generate the gbaGPUInitList?

profi200 commented 2 years ago

The code used to generate the GPU command list is here. However open_agb_firm does patch the cmd list at runtime and multiple addresses in the cmd list need to be fixed.

Since i have no proper GPU driver yet adding more patches for centering would be a bit much.

a92126 commented 2 years ago

The code used to generate the GPU command list is here. However open_agb_firm does patch the cmd list at runtime and multiple addresses in the cmd list need to be fixed.

Since i have no proper GPU driver yet adding more patches for centering would be a bit much.

From the source, the scaler 0 and 1 implemented by command list, and 2 by legacy frame buffer translate. The output will get some burrs on edge, which cause by the lack of sampling. I wonder if a pixel shader is possible to filter the source of gba video. I think a scaler of 3 can apply a xBRZ shader to create a 720x480 render target and downscale it to 360x240.

profi200 commented 2 years ago

Unfortunately no fancy shaders are possible. There are only fixed fragment shader stages (6 tex envs). No real fragment shaders. I wanted to do a GBA color shader similar to what mGBA offers but it's very tricky to do without fragment shaders.

profi200 commented 2 years ago

No reason to close this. The original request of centering the output is valid and doable. It just won't happen for a while.

a92126 commented 2 years ago

Oh, I forgot the original request. Thanks.

aylaisnice commented 1 year ago

this is fixed now, isn't it?

profi200 commented 1 year ago

I guess? But it's still hardcoded.