<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.mamedev.org/index.php?action=history&amp;feed=atom&amp;title=Using_MAME%27s_tilemap_system</id>
	<title>Using MAME&#039;s tilemap system - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mamedev.org/index.php?action=history&amp;feed=atom&amp;title=Using_MAME%27s_tilemap_system"/>
	<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;action=history"/>
	<updated>2026-04-19T15:21:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=4334&amp;oldid=prev</id>
		<title>Cuavas: /* Manipulating Tilemaps */</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=4334&amp;oldid=prev"/>
		<updated>2014-11-14T14:20:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Manipulating Tilemaps&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:20, 14 November 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l119&quot;&gt;Line 119:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 119:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MAME can do a few tricks with tilemaps with no work on your part.  The most common tilemap manipulation functions are detailed here.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MAME can do a few tricks with tilemaps with no work on your part.  The most common tilemap manipulation functions are detailed here.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_t::set_user_data(&#039;&#039;user_data&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;void &lt;/ins&gt;tilemap_t::set_user_data(&#039;&#039;user_data&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sets an arbitrary kept by the tilemap that you can retrieve later by calling &amp;#039;&amp;#039;&amp;#039;tilemap_t::user_data&amp;#039;&amp;#039;&amp;#039; (e.g. in your tile info callback).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sets an arbitrary kept by the tilemap that you can retrieve later by calling &amp;#039;&amp;#039;&amp;#039;tilemap_t::user_data&amp;#039;&amp;#039;&amp;#039; (e.g. in your tile info callback).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_t::set_palette_offset(&#039;&#039;offset&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;void &lt;/ins&gt;tilemap_t::set_palette_offset(&#039;&#039;offset&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Apply a palette offset to the color values for a tilemap, to be added to each pixel value before looking up the palette.  &amp;#039;&amp;#039;offset&amp;#039;&amp;#039; is the palette offset.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Apply a palette offset to the color values for a tilemap, to be added to each pixel value before looking up the palette.  &amp;#039;&amp;#039;offset&amp;#039;&amp;#039; is the palette offset.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_t::enable(&#039;&#039;enable&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;void &lt;/ins&gt;tilemap_t::enable(&#039;&#039;enable&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Enable or disable drawing of a tilemap.  When a tilemap is disabled, requests to draw it are ignored.  The default value for &amp;#039;&amp;#039;enable&amp;#039;&amp;#039; is &amp;#039;&amp;#039;&amp;#039;true&amp;#039;&amp;#039;&amp;#039;, so calling with no arguments will enable the tilemap.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Enable or disable drawing of a tilemap.  When a tilemap is disabled, requests to draw it are ignored.  The default value for &amp;#039;&amp;#039;enable&amp;#039;&amp;#039; is &amp;#039;&amp;#039;&amp;#039;true&amp;#039;&amp;#039;&amp;#039;, so calling with no arguments will enable the tilemap.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_t::set_flip(&#039;&#039;attributes&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;void &lt;/ins&gt;tilemap_t::set_flip(&#039;&#039;attributes&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_manager::set_flip_all(&#039;&#039;attributes&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;void &lt;/ins&gt;tilemap_manager::set_flip_all(&#039;&#039;attributes&#039;&#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Set flipping for a tilemap, or for all tilemaps created by a tilemap manager.  &amp;#039;&amp;#039;attributes&amp;#039;&amp;#039; should be zero, &amp;#039;&amp;#039;&amp;#039;TILEMAP_FLIPX&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;TILEMAP_FLIPY&amp;#039;&amp;#039;&amp;#039; or the logical sum of these values.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Set flipping for a tilemap, or for all tilemaps created by a tilemap manager.  &amp;#039;&amp;#039;attributes&amp;#039;&amp;#039; should be zero, &amp;#039;&amp;#039;&amp;#039;TILEMAP_FLIPX&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;TILEMAP_FLIPY&amp;#039;&amp;#039;&amp;#039; or the logical sum of these values.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cuavas</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=4333&amp;oldid=prev</id>
		<title>Cuavas at 14:19, 14 November 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=4333&amp;oldid=prev"/>
		<updated>2014-11-14T14:19:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;amp;diff=4333&amp;amp;oldid=1434&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Cuavas</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=1434&amp;oldid=prev</id>
		<title>Cuavas: /* Scrolling */</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=1434&amp;oldid=prev"/>
		<updated>2007-12-23T13:47:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Scrolling&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:47, 23 December 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l123&quot;&gt;Line 123:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 123:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_set_scrollx(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;row&amp;#039;&amp;#039;, &amp;#039;&amp;#039;value&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_set_scrollx(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;row&amp;#039;&amp;#039;, &amp;#039;&amp;#039;value&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Scrolls one row of the tilemap horizontally, where &#039;&#039;tmap&#039;&#039; is the tilemap pointer, &#039;&#039;row&#039;&#039; is the row number (0 for top row up to &#039;&#039;scroll_rows&#039;&#039; - 1 for bottom row) and &#039;&#039;value&#039;&#039; is the amount to scroll by (in pixels).  Positive &#039;&#039;value&#039;&#039; moves the row to the right, and negative &#039;&#039;value&#039;&#039; moves the row to the left.  Note that &#039;&#039;value&#039;&#039; is absolute (not relative to the current scroll value for the row), and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;everything is &lt;/del&gt;reversed if the tilemap is flipped &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;horizontally&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Scrolls one row of the tilemap horizontally, where &#039;&#039;tmap&#039;&#039; is the tilemap pointer, &#039;&#039;row&#039;&#039; is the row number (0 for top row up to &#039;&#039;scroll_rows&#039;&#039; - 1 for bottom row) and &#039;&#039;value&#039;&#039; is the amount to scroll by (in pixels).  Positive &#039;&#039;value&#039;&#039; moves the row to the right, and negative &#039;&#039;value&#039;&#039; moves the row to the left.  Note that &#039;&#039;value&#039;&#039; is absolute (not relative to the current scroll value for the row), and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;things are &lt;/ins&gt;reversed if the tilemap is flipped.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_set_scrolly(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;col&amp;#039;&amp;#039;, &amp;#039;&amp;#039;value&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  tilemap_set_scrolly(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;col&amp;#039;&amp;#039;, &amp;#039;&amp;#039;value&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Scrolls one column of the tilemap vertically, where &#039;&#039;tmap&#039;&#039; is the tilemap pointer, &#039;&#039;col&#039;&#039; is the column number (0 for leftmost column up to &#039;&#039;scroll_cols&#039;&#039; - 1 for rightmost column) and &#039;&#039;value&#039;&#039; is the amount to scroll by (in pixels).  Positive &#039;&#039;value&#039;&#039; moves the column down, and negative &#039;&#039;value&#039;&#039; moves the column up.  Note that &#039;&#039;value&#039;&#039; is absolute (not relative to the current scroll value for the column), and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;everything is &lt;/del&gt;reversed if the tilemap is flipped &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vertically&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Scrolls one column of the tilemap vertically, where &#039;&#039;tmap&#039;&#039; is the tilemap pointer, &#039;&#039;col&#039;&#039; is the column number (0 for leftmost column up to &#039;&#039;scroll_cols&#039;&#039; - 1 for rightmost column) and &#039;&#039;value&#039;&#039; is the amount to scroll by (in pixels).  Positive &#039;&#039;value&#039;&#039; moves the column down, and negative &#039;&#039;value&#039;&#039; moves the column up.  Note that &#039;&#039;value&#039;&#039; is absolute (not relative to the current scroll value for the column), and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;things are &lt;/ins&gt;reversed if the tilemap is flipped.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==When Things Change==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==When Things Change==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cuavas</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=1433&amp;oldid=prev</id>
		<title>Cuavas: /* Scrolling */</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=1433&amp;oldid=prev"/>
		<updated>2007-12-23T13:46:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Scrolling&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:46, 23 December 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l83&quot;&gt;Line 83:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 83:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Scrolling===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Scrolling===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sorry&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I haven&lt;/del&gt;&#039;t &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;got &lt;/del&gt;to writing this &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;yet&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Although some games use tilemaps that are the same size as the display area (and therefore fit on the screen neatly)&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;many use tilemaps that are much larger than the screen and scroll them around as necessary.  Lots of games can scroll parts of a tilemap independently, too.  MAME caters for most of the common cases very elegantly.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;One thing to note before going further is that MAME considers tilemaps to be circular: if you scroll it so the left edge is off the left edge of the screen, MAME will wrap the right edge of the tilemap around to fill in the space and vice versa (and likewise vertically).  If that isn&lt;/ins&gt;&#039;t &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the behaviour you want (for example if you want the space to be all transparent), you will need &lt;/ins&gt;to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tell MAME that the tilemap is bigger than it really is when you create it, and write a custom mapper function to make life easier when &lt;/ins&gt;writing &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;your tile info callback.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Let&#039;s start with the simple functions that scroll the whole tilemap.  These functions may be called in the &#039;&#039;&#039;VIDEO_START&#039;&#039;&#039; handler to set up global scroll offsets, or they may be called in write handlers for control registers that scroll the whole tilemap:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_set_scrolldx(&#039;&#039;tmap&#039;&#039;, &#039;&#039;dx&#039;&#039;, &#039;&#039;dx_if_flipped&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This function scrolls the entire tilemap horizontally, where &#039;&#039;tmap&#039;&#039; is the pointer to the tilemap, &#039;&#039;dx&#039;&#039; is the amount to scroll by when the tilemap is not flipped horizontally, and &#039;&#039;dx_if_flipped&#039;&#039; is the amount to scroll by if the tilemap is flipped horizontally (both in pixels).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Positive &#039;&#039;dx&#039;&#039; moves the tilemap to the right and negative &#039;&#039;dx&#039;&#039; moves the tilemap to the left.  Since &#039;&#039;dx_if_flipped&#039;&#039; applies when the tilemap is flipped horizontally, its behaviour is the inverse: positive values move the tilemap to the left and negative values move the tilemap to the right.  Note that values passed to &lt;/ins&gt;this &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;function are absolute, in that they are not relative to the current horizontal scroll offset of the tilemap.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_set_scrolldy(&#039;&#039;tmap&#039;&#039;, &#039;&#039;dy&#039;&#039;, &#039;&#039;dy_if_flipped&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This is the equivalent function for scrolling the entire tilemap vertically: &#039;&#039;tmap&#039;&#039; is the pointer to the tilemap, &#039;&#039;dy&#039;&#039; is the amount to scroll by when the tilemap is not flipped vertically, and &#039;&#039;dy_if_flipped&#039;&#039; is the amount to scroll by if the tilemap is flipped vertically (both in pixels).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Positive &#039;&#039;dy&#039;&#039; moves the tilemap down and negative &#039;&#039;dy&#039;&#039; moves the tilemap up.  Since &#039;&#039;dy_if_flipped&#039;&#039; applies when the tilemap is flipped vertically, its behaviour is the inverse: positive values move the tilemap up and negative values move the tilemap down.  Note that values passed to this function are absolute, in that they are not relative to the current vertical scroll offset of the tilemap.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You can also get the current overall scroll offsets for a tilemap:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_get_scrolldx(&#039;&#039;tmap&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_get_scrolldy(&#039;&#039;tmap&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;These functions return the horizontal and vertical scroll offsets for the tilemap passed in &#039;&#039;tmap&#039;&#039;, respectively.  The values returned are appropriate for the current flip state of the tilemap (you can&#039;t easily retrieve the values for the opposite flip states).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;That&#039;s all very well and good if you only want to scroll the whole tilemap at once, which may be all the hardware can do.  But that isn&#039;t the always the case: often a machine is capable of independently scrolling parts of the tilemap.  This is often called row/column scroll.  Before you can scroll parts of a tilemap, you need to tell MAME how many independently scrollable rows and/or columns the hardware supports:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_set_scroll_rows(&#039;&#039;tmap&#039;&#039;, &#039;&#039;scroll_rows&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_set_scroll_cols(&#039;&#039;tmap&#039;&#039;, &#039;&#039;scroll_cols&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;These functions set the number of independently scrollable rows and columns, respectively, where &#039;&#039;tmap&#039;&#039; is a pointer to the tilemap, &#039;&#039;scroll_rows&#039;&#039; is the number of independently scrollable rows and &#039;&#039;scroll_cols&#039;&#039; is the number of independently scrollable columns.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;These functions are usually called in the &#039;&#039;&#039;VIDEO_START&#039;&#039;&#039; handler, as this is generally a fixed hardware capability.  If you don&#039;t call these functions, MAME will assume the tilemap consists of one row and one column: that is, you can only scroll the whole lot at once.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;How does MAME know how tall each row is and how wide each column is?  It just divides the height and width by the number of rows and columns, respectively.  If your hardware has uneven or unusual size columns, you&#039;ll need to do something fancier.  MAME does a very good job for the common cases.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Now that you&#039;ve told MAME how many independent rows and columns there are, you can scroll parts of the tilemap.  These functions are usually called from write handlers for the tilemap chip&#039;s control registers:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_set_scrollx(&#039;&#039;tmap&#039;&#039;, &#039;&#039;row&#039;&#039;, &#039;&#039;value&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Scrolls one row of the tilemap horizontally, where &#039;&#039;tmap&#039;&#039; is the tilemap pointer, &#039;&#039;row&#039;&#039; is the row number (0 for top row up to &#039;&#039;scroll_rows&#039;&#039; - 1 for bottom row) and &#039;&#039;value&#039;&#039; is the amount to scroll by (in pixels).  Positive &#039;&#039;value&#039;&#039; moves the row to the right, and negative &#039;&#039;value&#039;&#039; moves the row to the left.  Note that &#039;&#039;value&#039;&#039; is absolute (not relative to the current scroll value for the row), and everything is reversed if the tilemap is flipped horizontally.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; tilemap_set_scrolly(&#039;&#039;tmap&#039;&#039;, &#039;&#039;col&#039;&#039;, &#039;&#039;value&#039;&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Scrolls one column of the tilemap vertically, where &#039;&#039;tmap&#039;&#039; is the tilemap pointer, &#039;&#039;col&#039;&#039; is the column number (0 for leftmost column up to &#039;&#039;scroll_cols&#039;&#039; - 1 for rightmost column) and &#039;&#039;value&#039;&#039; is the amount to scroll by (in pixels).  Positive &#039;&#039;value&#039;&#039; moves the column down, and negative &#039;&#039;value&#039;&#039; moves the column up.  Note that &#039;&#039;value&#039;&#039; is absolute (not relative to the current scroll value for the column), and everything is reversed if the tilemap is flipped vertically&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==When Things Change==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==When Things Change==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cuavas</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=1405&amp;oldid=prev</id>
		<title>Cuavas: New page: Many arcade systems have features for displaying tilemaps.  Unlike a bitmap or pixelmap, which specifies an image in terms of a grid of pixels, a tilemap specifies an image in terms of a g...</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Using_MAME%27s_tilemap_system&amp;diff=1405&amp;oldid=prev"/>
		<updated>2007-12-12T11:04:36Z</updated>

		<summary type="html">&lt;p&gt;New page: Many arcade systems have features for displaying tilemaps.  Unlike a bitmap or pixelmap, which specifies an image in terms of a grid of pixels, a tilemap specifies an image in terms of a g...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Many arcade systems have features for displaying tilemaps.  Unlike a bitmap or pixelmap, which specifies an image in terms of a grid of pixels, a tilemap specifies an image in terms of a grid of tiles.  Why use tilemaps?  First of all, with all the tiles drawn in advance, the game can be simpler because it just needs to say where to place the tiles, rather than drawing each pixel.  Second, you can save storage space by reusing tiles.&lt;br /&gt;
&lt;br /&gt;
Some games use fixed, ROM-based tilemaps, where the arrangement of tiles is stored in ROM.  One example of this is background in some scrolling vertical shooters: the graphics ROM contains reusable terrain tiles, and the tilemap ROM contains the tile codes and attributes.  Some games use dynamic, RAM-based tilemaps, where the game stores the tile codes and attributes in RAM.&lt;br /&gt;
&lt;br /&gt;
This page gives a general overview of how you can use MAME&amp;#039;s tilemap system.  For more detailed information, look at the comments in src/emu/tilemap.h.  For more examples, look through src/mame/video for games with tilemaps.&lt;br /&gt;
&lt;br /&gt;
==Core Concepts==&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;tilemap&amp;#039;&amp;#039;&amp;#039; is a 2D grid of rectangular tiles.  Each tile has its own characteristics that determine how it is rendered.  When creating a tilemap, you specify the number of rows and columns, and the size of the tiles in pixels.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;tile&amp;#039;&amp;#039;&amp;#039; is a single rectangular element within a tilemap.  Tiles may be any size, but all tiles in a tilemap must be the same size as each other.&lt;br /&gt;
&lt;br /&gt;
A 4-bit &amp;#039;&amp;#039;&amp;#039;category&amp;#039;&amp;#039;&amp;#039; can be specified for each tile.  Each category can be rendered independently.&lt;br /&gt;
&lt;br /&gt;
Depending on the pen, each pixel will be assigned to a &amp;#039;&amp;#039;&amp;#039;layer&amp;#039;&amp;#039;&amp;#039;.  There are three layers, but in general, only layer 0 is used.  If a pixel doesn&amp;#039;t belong to a layer, it will be considered transparent.&lt;br /&gt;
&lt;br /&gt;
==Creating your Tilemaps==&lt;br /&gt;
&lt;br /&gt;
In MAME, a tilemaps are created by calling &amp;#039;&amp;#039;&amp;#039;tilemap_create&amp;#039;&amp;#039;&amp;#039;.  You usually create tilemaps when initialising the video hardware emulation.  Before you can create a tilemap, you need to answer two questions: how big are the tiles, and how big is the tilemap?  The answer to the first question is usually obvious: it will be the size of the graphics elements used by the hardware.  The answer to the second question may seem obvious, too: wouldn&amp;#039;t you just make it as big as what the hardware deals with?  Usually yes, but some games use absolutely massive ROM-based tilemaps, and making MAME render the whole thing just wastes a lot of memory.  In these cases, it&amp;#039;s better to your tilemap smaller than what the hardware sees, and invalidate it when the game scrolls out of range.&lt;br /&gt;
&lt;br /&gt;
 tilemap *tilemap_create(&amp;#039;&amp;#039;tile_get_info&amp;#039;&amp;#039;, &amp;#039;&amp;#039;mapper&amp;#039;&amp;#039;, &amp;#039;&amp;#039;type&amp;#039;&amp;#039;, &amp;#039;&amp;#039;tilewidth&amp;#039;&amp;#039;, &amp;#039;&amp;#039;tileheight&amp;#039;&amp;#039;, &amp;#039;&amp;#039;cols&amp;#039;&amp;#039;, &amp;#039;&amp;#039;rows&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Pass a pointer to your tile info callback for &amp;#039;&amp;#039;tile_get_info&amp;#039;&amp;#039; (this is discussed later).&lt;br /&gt;
&lt;br /&gt;
Pass a pointer to a function that converts a row and column position to a tile index as &amp;#039;&amp;#039;mapper&amp;#039;&amp;#039;.  You can write your own if you need to, but usually you can just use one of the predefined tilemap mappers:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_rows&amp;#039;&amp;#039;&amp;#039; scans rows from left to right consecutively from top to bottom (so in a 2x2 tilemap, 0 is top left, 1 is top right, 2 is bottom left and 3 is bottom right)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_rows_flip_x&amp;#039;&amp;#039;&amp;#039; scans rows from right to left consecutively from top to bottom (so in a 2x2 tilemap, 0 is top right, 1 is top left, 2 is bottom right and 3 is bottom left)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_rows_flip_y&amp;#039;&amp;#039;&amp;#039; scans rows from left to right consecutively from bottom to top (so in a 2x2 tilemap, 0 is bottom left, 1 is bottom right, 2 is top left and 3 is top right)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_rows_flip_xy&amp;#039;&amp;#039;&amp;#039; scans rows from right to left consecutively from bottom to top (so in a 2x2 tilemap, 0 is bottom right, 1 is bottom left, 2 is top right and 3 is top left)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_cols&amp;#039;&amp;#039;&amp;#039; scans columns from top to bottom consecutively from left to right (so in a 2x2 tilemap, 0 is top left, 1 is bottom left, 2 is top right and 3 is bottom right)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_cols_flip_x&amp;#039;&amp;#039;&amp;#039; scans columns from top to bottom consecutively from right to left (so in a 2x2 tilemap, 0 is top right, 1 is bottom right, 2 is top left and 3 is bottom left)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_cols_flip_y&amp;#039;&amp;#039;&amp;#039; scans columns from bottom to top consecutively from left to right (so in a 2x2 tilemap, 0 is bottom left, 1 is top left, 2 is bottom right and 3 is top right)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tilemap_scan_cols_flip_xy&amp;#039;&amp;#039;&amp;#039; scans columns from bottom to top consecutively from right to left (so in a 2x2 tilemap, 0 is bottom right, 1 is top right, 2 is bottom left and 3 is top left)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;type&amp;#039;&amp;#039; controls how pixels are assigned to layers.  Currently, the only recommended value &amp;#039;&amp;#039;&amp;#039;TILEMAP_TYPE_PEN&amp;#039;&amp;#039;&amp;#039;, which means the raw pen value is looked up in a table to determine which layer a pixel belongs to.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;tilewidth&amp;#039;&amp;#039; and &amp;#039;&amp;#039;tileheight&amp;#039;&amp;#039; are the width and height of the tiles in pixels.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;cols&amp;#039;&amp;#039; and &amp;#039;&amp;#039;rows&amp;#039;&amp;#039; are the number of rows and columns in the tilemap, respectively.  The size of the tilemap in pixels can be found by multiplying the number of columns by the tile width and the number of rows by the tile height.&lt;br /&gt;
&lt;br /&gt;
Tilemaps are tracked by the MAME core, so they are automatically saved and freed.  There is no corresponding call to manually dispose of a tilemap.&lt;br /&gt;
&lt;br /&gt;
===The Tile Info Callback===&lt;br /&gt;
&lt;br /&gt;
When MAME wants to know what to draw at a particular location in your tilemap, it calls the tile info callback function that you supplied when you created the tilemap.  This function takes the tile index as a parameter, and sets the tile information.  You can declare tile info callbacks with the &amp;#039;&amp;#039;&amp;#039;TILE_GET_INFO&amp;#039;&amp;#039;&amp;#039; macro.  The two most important parameters are &amp;#039;&amp;#039;&amp;#039;tile_index&amp;#039;&amp;#039;&amp;#039; (the tile index), and &amp;#039;&amp;#039;&amp;#039;param&amp;#039;&amp;#039;&amp;#039; (a user-specified value set with &amp;#039;&amp;#039;&amp;#039;tilemap_set_user_data&amp;#039;&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
You usually set the tile information with the &amp;#039;&amp;#039;&amp;#039;SET_TILE_INFO&amp;#039;&amp;#039;&amp;#039; macro:&lt;br /&gt;
&lt;br /&gt;
 SET_TILE_INFO(&amp;#039;&amp;#039;gfx&amp;#039;&amp;#039;, &amp;#039;&amp;#039;code&amp;#039;&amp;#039;, &amp;#039;&amp;#039;color&amp;#039;&amp;#039;, &amp;#039;&amp;#039;flags&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;gfx&amp;#039;&amp;#039; is the graphics bank to take the tile from, &amp;#039;&amp;#039;code&amp;#039;&amp;#039; is the graphics code and &amp;#039;&amp;#039;color&amp;#039;&amp;#039; is the color code.  You can combine the following values for the &amp;#039;&amp;#039;flags&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILE_FLIPX&amp;#039;&amp;#039;&amp;#039; to flip the tile horizontally&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILE_FLIPY&amp;#039;&amp;#039;&amp;#039; to flip the tile vertically&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILE_4BPP&amp;#039;&amp;#039;&amp;#039; if the tile data is packed four bits per pixel format&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILE_FORCE_LAYER0&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;TILE_FORCE_LAYER1&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;TILE_FORCE_LAYER2&amp;#039;&amp;#039;&amp;#039; to force all pixels in the tile to be assigned to a particular layer (&amp;#039;&amp;#039;&amp;#039;TILE_FORCE_LAYER0&amp;#039;&amp;#039;&amp;#039; is often used to force a tile to be opaque)&lt;br /&gt;
&lt;br /&gt;
===Setting Up Transparency===&lt;br /&gt;
&lt;br /&gt;
Sorry, haven&amp;#039;t written this yet.&lt;br /&gt;
&lt;br /&gt;
==Manipulating Tilemaps==&lt;br /&gt;
&lt;br /&gt;
MAME can do a few tricks with tilemaps with no work on your part.  The most common tilemap manipulation functions are detailed here.&lt;br /&gt;
&lt;br /&gt;
 tilemap_set_user_data(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;user_data&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Sets the value passed to a tilemap&amp;#039;s tile info callback as &amp;#039;&amp;#039;&amp;#039;param&amp;#039;&amp;#039;&amp;#039;.  &amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; is the tilemap pointer and &amp;#039;&amp;#039;user_data&amp;#039;&amp;#039; is the value (void pointer).&lt;br /&gt;
&lt;br /&gt;
 tilemap_set_palette_offset(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;offset&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Apply a palette offset to the color values for a tilemap, to be added to each pixel value before looking up the palette..  &amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; is the tilemap pointer and &amp;#039;&amp;#039;offset is the palette offset.&lt;br /&gt;
&lt;br /&gt;
 tilemap_set_enable(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;enable&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Enable or disable drawing of a tilemap.  When a tilemap is disabled, requests to draw it are ignored.  &amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; is the tilemap pointer; pass non-zero for &amp;#039;&amp;#039;enable&amp;#039;&amp;#039; to enable the tilemap, or zero to disable it.&lt;br /&gt;
&lt;br /&gt;
 tilemap_set_flip(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;attributes&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Set flipping for a tilemap, or for all tilemaps.  &amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; is the tilemap pointer, or &amp;#039;&amp;#039;&amp;#039;ALL_TILEMAPS&amp;#039;&amp;#039;&amp;#039; to apply the transform to all tilemaps; &amp;#039;&amp;#039;attributes&amp;#039;&amp;#039; should be a zero, &amp;#039;&amp;#039;&amp;#039;TILEMAP_FLIPX&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;TILEMAP_FLIPY&amp;#039;&amp;#039;&amp;#039; or the logical sum of these values.&lt;br /&gt;
&lt;br /&gt;
===Scrolling===&lt;br /&gt;
&lt;br /&gt;
Sorry, I haven&amp;#039;t got to writing this yet.&lt;br /&gt;
&lt;br /&gt;
==When Things Change==&lt;br /&gt;
&lt;br /&gt;
MAME caches tilemaps aggressively to avoid unnecessary CPU load, so you need to let it know when parts of a tilemap need to be redrawn.  Examples of when this may happen are when the game writes to tilemap memory for a RAM-based tilemap, or when the tilemap scrolls out of range when you&amp;#039;re only rendering part of a large ROM-based tilemap.  There are two functions that can be used: &amp;#039;&amp;#039;&amp;#039;tilemap_mark_tile_dirty&amp;#039;&amp;#039;&amp;#039; marks a single tile as needing to be redrawn, and &amp;#039;&amp;#039;&amp;#039;tilemap_mark_all_tiles_dirty&amp;#039;&amp;#039;&amp;#039; marks entire tilemaps as needing to be redrawn.&lt;br /&gt;
&lt;br /&gt;
 tilemap_mark_tile_dirty(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;, &amp;#039;&amp;#039;memory_index&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Marks a single tile as needing to be redrawn.  &amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; is the tilemap pointer and &amp;#039;&amp;#039;memory_index&amp;#039;&amp;#039; is the index of the tile to be redrawn.&lt;br /&gt;
&lt;br /&gt;
 tilemap_mark_all_tiles_dirty(&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Marks entire tilemaps as needing to be redrawn.  &amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; the tilemap pointer, or &amp;#039;&amp;#039;&amp;#039;ALL_TILEMAPS&amp;#039;&amp;#039;&amp;#039; to mark all tilemaps as needing to be redrawn.&lt;br /&gt;
&lt;br /&gt;
==Drawing Tilemaps==&lt;br /&gt;
&lt;br /&gt;
You can draw a tilemap into a bitmap any time you want.  In general, though, you do this in your &amp;#039;&amp;#039;&amp;#039;VIDEO_UPDATE&amp;#039;&amp;#039;&amp;#039; callback, to get graphics onto the emulated display.  The most common function used for this is &amp;#039;&amp;#039;&amp;#039;tilemap_draw&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 tilemap_draw(dest, cliprect, tmap, flags, priority)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;dest&amp;#039;&amp;#039; is the destination bitmap.  Usually, you pass the &amp;#039;&amp;#039;&amp;#039;bitmap&amp;#039;&amp;#039;&amp;#039; argument you received in your &amp;#039;&amp;#039;&amp;#039;VIDEO_UPDATE&amp;#039;&amp;#039;&amp;#039; callback.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;cliprect&amp;#039;&amp;#039; is the clipping rectangle.  Drawing will be restricted to this area.  You usually pass the &amp;#039;&amp;#039;&amp;#039;cliprect&amp;#039;&amp;#039;&amp;#039; argument that you received in your &amp;#039;&amp;#039;&amp;#039;VIDEO_UPDATE&amp;#039;&amp;#039;&amp;#039; callback.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;tmap&amp;#039;&amp;#039; is the tilemap pointer.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;flags&amp;#039;&amp;#039; is a combination of the following values:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILEMAP_DRAW_CATEGORY(&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;x&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039; specifies the category of tiles to draw (default 0)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILEMAP_DRAW_LAYER0&amp;#039;&amp;#039;&amp;#039; to draw only layer 0&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILEMAP_DRAW_LAYER1&amp;#039;&amp;#039;&amp;#039; to draw only layer 1&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILEMAP_DRAW_LAYER2&amp;#039;&amp;#039;&amp;#039; to draw only layer 2&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILEMAP_DRAW_OPAQUE&amp;#039;&amp;#039;&amp;#039; to draw everything, even if it&amp;#039;s normally transparent&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;TILEMAP_DRAW_ALPHA&amp;#039;&amp;#039;&amp;#039; to draw with alpha blending&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;priority&amp;#039;&amp;#039; is the priority value to store in the priority bitmap for pixels that are not transparent.&lt;br /&gt;
&lt;br /&gt;
===Advanced Tilemap Drawing===&lt;br /&gt;
&lt;br /&gt;
Haven&amp;#039;t thought about this section yet, either.  It should cover priority masks, ROZ, etc.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Will get to this when time permits.&lt;/div&gt;</summary>
		<author><name>Cuavas</name></author>
	</entry>
</feed>