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

Bgmap #140

Merged
merged 7 commits into from
Nov 11, 2023
Merged

Bgmap #140

merged 7 commits into from
Nov 11, 2023

Conversation

ElectroDeoxys
Copy link
Collaborator

Added a tool so that we can convert the CGB tilemaps from tilemap + attributes format to the interleaved format that should be included in the ROM. These intermediate files are distinguished by their .bgmap file extension, and are built from the .bin files that have the tile+attribute pair bytes, for ease of use in tools such as Tilemap Studio. As a consequence, the dimensions of these tilemaps have to be added as files and are not hardcoded inside the .asm code.

@dannye
Copy link
Member

dannye commented Nov 8, 2023

The entirety of src/data/maps/permissions/gb/ and src/data/maps/permissions/cgb/ are identical so I say we take this opportunity to create just a single src/data/maps/permissions/ and INCBIN each permissions file twice.

@dannye
Copy link
Member

dannye commented Nov 8, 2023

We could also combine all the duplicate/identical *.dimensions files. Not immediately sure of the best folder organization for that though. (Probably just src/data/maps/dimensions/)

@dannye
Copy link
Member

dannye commented Nov 8, 2023

All the .lz.match files in src/data/maps/tiles/gb/ are .bin.lz.match but in src/data/maps/tiles/cgb/ they are all .bgmap.lz.match.
I assume they are all supposed to be .bgmap.lz.match?

src/gfx.asm Outdated
dw NULL
db TRUE ; cgb mode
INCBIN "data/maps/tiles/card_pop.bin.lz"
INCBIN "data/maps/tiles/cgb/card_pop_noncgb.bgmap.lz"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The card_pop_noncgb files are in the cgb folder, but I assume that is because this tilemap has db TRUE ; cgb mode.
What do you think about moving the card_pop_noncgb files to the gb folder (and renaming them to card_pop) for the sake of symmetry?

(Do you think the db TRUE ; cgb mode is a mistake?)

@@ -25,3 +25,4 @@
*.2bpp binary diff=hex
*.1bpp binary diff=hex
*.lz binary diff=hex
*.bgmap binary diff=hex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should *.dimensions be added around line 20?

@ElectroDeoxys
Copy link
Collaborator Author

The entirety of src/data/maps/permissions/gb/ and src/data/maps/permissions/cgb/ are identical so I say we take this opportunity to create just a single src/data/maps/permissions/ and INCBIN each permissions file twice.

Yep that makes a lot of sense, and it matches. Actually it's important that they are the same for both systems because then you could run into problems if you saved in one system and tried to run in another where the permission is different, so a way to enforce that is to include it twice.

We could also combine all the duplicate/identical *.dimensions files. Not immediately sure of the best folder organization for that though. (Probably just src/data/maps/dimensions/)

Also makes sense to consolidate, mmmh. I'll play around with the Makefile to see if I can pull that off, instead of deriving the dimensions path through the tool.

All the .lz.match files in src/data/maps/tiles/gb/ are .bin.lz.match but in src/data/maps/tiles/cgb/ they are all .bgmap.lz.match.
I assume they are all supposed to be .bgmap.lz.match?

My thought process is that .bgmap is only an intermediary file with the tiles and attributes interleaved, but GB tilemaps don't have attributes, so they can be compressed right away. It wouldn't make sense to have a .bgmap for those cases where attributes don't exist.

@dannye
Copy link
Member

dannye commented Nov 8, 2023

My thought process is that .bgmap is only an intermediary file with the tiles and attributes interleaved, but GB tilemaps don't have attributes, so they can be compressed right away. It wouldn't make sense to have a .bgmap for those cases where attributes don't exist.

Ahh. That makes sense. It's a tiny bummer that when I compare the gb/ and cgb/ folders in Beyond Compare, the different extensions means I can't easily cross-check, but that's not the end of the world.

@dannye dannye merged commit 0677ed2 into pret:master Nov 11, 2023
1 check 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