Why did Windows 95 store image list bitmaps four-across instead of as a strict vertical strip?


We learned some time ago that bitmap strips should be stored vertically in order to improve data locality.

If you dig back into your dusty archives, you might discover that Windows 95 sort-of-but-not-quite followed this advice. It kept image lists in a mostly-vertical format, rather than a strictly-vertical format. In particular, It stored four images across.

In other words, instead of

A
B
C
D
E
F
G
H
I
J
K
L

Windows 95 stored images like this:

A B C D
E F G H
I J K L

Why didn't Windows 95 use fully vertical bitmaps?

Because Windows 95 still had a 16-bit coordinate space.

The system image list could contain hundreds of icons, and the user could set their screen DPI as high as 120 (whoa!), which meant that large icons were 48 pixels tall. If the icons were kept in a single vertical strip, you could have up to ⌊32767÷48⌋ = 682 icons before overflowing a 16-bit signed integer.

This was an uncomfortably low number, so the shell team decided to trade off a little bit of locality for increased range and arranged icons four across instead of single-file. This bumped the limit to over 2000, which was a significant amount of breathing room.

Comments (3)

  1. Antonio Rodríguez says:

    It also means that with 16-color, 48-pixel icons, a group of four icons would be 4608 bytes, so they would span two 4096-byte pages. Of course, greater color depths would worsen the problem (at 16 bit color, a row of 32-pizel icons would take exactly two pages, if correctly aligned). Anyway, I guess loading or swapping two contiguous pages is a lot faster than taking care of two separate ones.

  2. henke37 says:

    I take it that the shell team didn’t want the complexity of switching to more files only when running at high DPI settings.

  3. Alex Marshall says:

    Very interesting read. Thank you for this Raymond.

Skip to main content