msinger / dmg_cpu_b_map

Web-based map of the Gameboy DMG-CPU B with overlays
Other
4 stars 0 forks source link

Display cell types #1

Open ogamespec opened 1 week ago

ogamespec commented 1 week ago

Is there any way to enable showing cell types instead of/or in conjunction with their names?

example:

image

msinger commented 1 week ago

Right now, the only way to see the exact cell type is by clicking on a cell, so that the bubble opens. The border color of the cell also gives a hint, but not the exact type. It's better visible if you disable the floorplan. You may have noticed the legend at the top of the map.

I would like to avoid creating another layer just for the type names, because I'm getting close to the maximum storage usage of my web hosting contract. Putting the type names into the same layer as the cell names is tricky. The README.md file here is actually outdated. I'm not exporting the layers from Inkscape anymore. I automatically create them from my netlists in the schematics repository using this tool. This tool automatically chooses a fitting text size for all the cell names and in the DMG map it currently looks good. But in the SM83 map, which is not finished yet, it's not working that great. Many labels are reaching into neighboring cells or are even cut off. It was easier when the names were all just four letters. I need to overhaul the code that places these labels, so that it fits them better in all scenarios. Maybe I can add the type names then when I'm at it. But first I need to finish the SM83 stuff. I'm currently recreating the layout in Electric VLSI and in parallel update the netlists for the map and the cell documentation.

I agree, the type name is an important information that would be nice to have next to the cell name. I'm also dreaming of having the net names written along the wires like the street names in google maps. :melting_face:

ogamespec commented 1 week ago

I don't think specifying the cell type will take megabytes. How many of them are there? 10-15k? Say type is max 10 characters, that's an extra 150k bytes. I personally am not a fan of any kind of pop-up stuff in the interface. It's more convenient to see everything at once in front of my eyes. Besides, Furrtek cryptologic names look very dumb, I would be glad to hide them or replace them with usual ordinal numbers (g1, g2, etc.). But all these are wishes, if you don't want to add cell types, you can close Issue - I found netlist of all cells as text files.

msinger commented 1 week ago

Ah, no. All overlays on the map, including the labels, are implemented as PNG images. And those images get generated for six or seven different zoom levels. And they are cut into tiles of 256x256 pixels. That's how the Leaflet map needs it. This is the reason why it costs a few hundred megabytes for adding a new layer for the type names. Maybe it's possible to create a text object for each name, instead of having these PNGs, but I don't know if so many objects can be handled by Leaflet or the browser. Changing that would be some work.

I will close the issue when I have implemented the type names in any way.