+#if NEW_TILESIZE
+#if 0
+ int pseudo_sxsize = SXSIZE * TILESIZE / TILESIZE_VAR;
+ int pseudo_sysize = SYSIZE * TILESIZE / TILESIZE_VAR;
+#endif
+#endif
+ int border1_offset = (menBorder ? 1 : 2);
+ int border2_offset = (menBorder ? 0 : TILESIZE / 2);
+
+ /* scroll correction for border frame (1 tile) or border element (2 tiles) */
+ ScrollMinX = 0;
+ ScrollMinY = 0;
+#if NEW_TILESIZE
+#if 1
+ ScrollMaxX = (DisplayMaxX + border1_offset - SCR_FIELDX) * TILEX;
+ ScrollMaxY = (DisplayMaxY + border1_offset - SCR_FIELDY) * TILEY;
+#else
+ ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - pseudo_sxsize;
+ ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - pseudo_sysize;
+#endif
+#else
+ ScrollMaxX = (DisplayMaxX + border1_offset) * TILEX - SXSIZE;
+ ScrollMaxY = (DisplayMaxY + border1_offset) * TILEY - SYSIZE;
+#endif
+
+ /* scroll correction for border element (half tile on left and right side) */
+ ScrollMinX += border2_offset;
+ ScrollMinY += border2_offset;
+ ScrollMaxX -= border2_offset;
+ ScrollMaxY -= border2_offset;
+
+ /* scroll correction for even number of visible tiles (half tile shifted) */
+ ScrollMinX -= game_sp.scroll_xoffset;
+ ScrollMaxX -= game_sp.scroll_xoffset;
+ ScrollMinY -= game_sp.scroll_yoffset;
+ ScrollMaxY -= game_sp.scroll_yoffset;
+
+#if 0
+ printf("::: (%ld, %ld), (%ld, %ld) -> (%d, %d), (%d, %d)\n",
+ DisplayMinX, DisplayMinY, DisplayMaxX, DisplayMaxY,
+ ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY);
+#endif