Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to output tilemap bigger than 256x224 or output two tilemaps #112

Open
gizaha opened this issue Sep 11, 2022 · 6 comments
Open

need to output tilemap bigger than 256x224 or output two tilemaps #112

gizaha opened this issue Sep 11, 2022 · 6 comments

Comments

@gizaha
Copy link

gizaha commented Sep 11, 2022

Hello. I have a picture 256x448, i need to output two 256x224 tilemaps.
I don't use tile reduction, so the upper picture tileset is $7000 length, and the same for the lower.

I understand that a single tilemap cannot address 256x448, so i need two tilemaps of 256x224 each and using the common palette.
So i cannot split the image in two and edit two seperate images because it's the same image that will be scrolled.
During streaming tileset+tilemap data will be updated and the scroll register shifts. Pallete must be unchanged because it will be accessed from the remaining tiles.

Another solution would be to convert a 256x224 picture while using an input palette file from another picture.

@alekmaul
Copy link
Owner

I do not understand what you want exacty and why ytou open an issue for that, sorry.
Perhaps it could be better to go on pvsneslib discord for your question ?

@gizaha
Copy link
Author

gizaha commented Sep 11, 2022

I want a vertical scrolling background 32x64 with pixel length 256x448.
Tileset and tilemap would be streamed each frame while scrolling.
I opened an issue because i run gfx2snes at a 256x448 picture and the tilemap it extracted wasn't right (thus bug of the program).

@alekmaul alekmaul reopened this Sep 12, 2022
@alekmaul
Copy link
Owner

ok, I will check gfx2snes. If you have a code example, it could help a lot :)

@gizaha
Copy link
Author

gizaha commented Sep 12, 2022

sample.zip
Here is a sample. Try gfx2snes to this image and put output data to bsnes to see the problem.

I need two tilemaps but pointing to common palette (if i split the image in two and make them seperately, then different palettes will be created).

For code example is not very clean and comments are in greek, so it will not help you. After all, is a tile streaming scroll as in most games.

Thank you.

@daniel-starke
Copy link
Contributor

The issue appears to be an invalid memory access in

map[idx] = t;

and
map[idx] += t;

due to the fact that it tries to initializes all 32x32 tiles but allocates only as many tiles as it derived from the input image dimensions in
map = malloc((size_t)tile_x * tile_y * sizeof(int));

@alekmaul
Copy link
Owner

thanks for your reply, I will try to check this issue this week

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

No branches or pull requests

3 participants