<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[ChipMusic.org - GBA Slideshow Builder - Need help rewriting + compiling]]></title>
		<link>https://chipmusic.org/forums/topic/6865/gba-slideshow-builder-need-help-rewriting-compiling/</link>
		<description><![CDATA[The most recent posts in GBA Slideshow Builder - Need help rewriting + compiling.]]></description>
		<lastBuildDate>Tue, 24 Apr 2012 16:19:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: GBA Slideshow Builder - Need help rewriting + compiling]]></title>
			<link>https://chipmusic.org/forums/post/102153/#p102153</link>
			<description><![CDATA[<b><i>nitro2k01 says:</i></b><p>Are you getting any error messages when trying to compile?</p>]]></description>
			<pubDate>Tue, 24 Apr 2012 16:19:21 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/102153/#p102153</guid>
		</item>
		<item>
			<title><![CDATA[Re: GBA Slideshow Builder - Need help rewriting + compiling]]></title>
			<link>https://chipmusic.org/forums/post/102127/#p102127</link>
			<description><![CDATA[<b><i>_-_- says:</i></b><p>I knew I could count on you. <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>No pun intended.</p><p>Thanks!</p>]]></description>
			<pubDate>Tue, 24 Apr 2012 14:35:27 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/102127/#p102127</guid>
		</item>
		<item>
			<title><![CDATA[Re: GBA Slideshow Builder - Need help rewriting + compiling]]></title>
			<link>https://chipmusic.org/forums/post/102123/#p102123</link>
			<description><![CDATA[<b><i>nitro2k01 says:</i></b><div class="codebox"><pre><code> // react to joypad presses
  while(1)
  {
    waitVSync();

    countdown++;
    if (countdown&gt;60){
      countdown=0;
      imgNew++;
    }

    // copy current index
    imgNew = imgCurrent;
    if (!(PADREG &amp; PAD_RIGHT)) imgNew++;
    if (!(PADREG &amp; PAD_LEFT)) imgNew--;
    // wrap around if neccesary
    imgNew = (imgNew+imgCount) %imgCount;


    // copy image
    if (imgNew != imgCurrent)
    {
      copyImage(pScreen, imageinfo.list-&gt;start[imgNew]);
      imgCurrent = imgNew;
      // wait keyDelay frames
      for(keyDelayCount = keyDelay; keyDelayCount &gt; 0; keyDelayCount--) 
      {
        // next time use shorter delay
        keyDelay = KEYREPEATDELAY;
        waitVSync();
        // both keys are released ?
        if ((PADREG &amp; PAD_RIGHT) &amp;&amp; (PADREG &amp; PAD_LEFT)) 
        {
          // use initial delay 
          keyDelay = KEYWAITDELAY;
          // break from loop
          break;
        }
      }
      countdown=0;
    }
  }
}</code></pre></div><p>Something like this-ish maybe a little bit? Note that I&#039;ve shuffled things around a bit, so copy all of the code as is.</p><p>You also need to declare the countdown variable (or technically countup) somewhere near the start of the function. This is where all the other variables are defined.<br /></p><div class="codebox"><pre><code>int countdown;</code></pre></div><p>The time taken waited between each frame image is controlled by &quot;if (countdown&gt;60){&quot;. 60 here means 60 frames, which is one second.</p>]]></description>
			<pubDate>Tue, 24 Apr 2012 14:25:40 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/102123/#p102123</guid>
		</item>
		<item>
			<title><![CDATA[GBA Slideshow Builder - Need help rewriting + compiling]]></title>
			<link>https://chipmusic.org/forums/post/102121/#p102121</link>
			<description><![CDATA[<b><i>_-_- says:</i></b><p>Hello!</p><p>I don&#039;t know much about coding, especially not C, ASM or anything hardware related. <br />But I really, really need to finish a project before this week ends. </p><p>What I need to do is rewrite a small piece of the source rom for the GBA Slideshow Builder, I need it to change picture every second instead of using the buttons to manually advance the slides.</p><p>I&#039;ve got Devkit Advance running, I can compile some things fine, but not the .bin I need to use for this.<br />There&#039;s a file called makefile.mak that I tried making into a .bat (read a tutorial on compiling for the gba), but that didn&#039;t work.</p><div class="codebox"><pre><code>CFLAGS    = -I c:\gba\include -c -g -O2 -mthumb-interwork -Wall -ffreestanding
ASFLAGS    = -mthumb-interwork
LDFLAGS = -L c:\gba\lib -T gbarom2mb

all : ufgbass.bin

ufgbass.bin : ufgbass.elf
    objcopy -v -O binary ufgbass.elf ufgbass.bin

ufgbass.elf : main.o
    ld $(LDFLAGS) -o ufgbass.elf main.o

main.o : main.c
    gcc $(CFLAGS) main.c</code></pre></div><p>I don&#039;t know if this is for a different compiler or devkit or something, I have no idea at all.<br />I just know I need this project to be finished asap and would appreciate help.</p><p>And, I need the code to change the slides automatically.<br />I&#039;m thinking I need to change these lines of code:<br /></p><div class="codebox"><pre><code> // react to joypad presses
  while(1)
  {
    // copy current index
    imgNew = imgCurrent;
    if (!(PADREG &amp; PAD_RIGHT)) imgNew++;
    if (!(PADREG &amp; PAD_LEFT)) imgNew--;
    // wrap around if neccesary
    if (imgNew &lt; 0) imgNew = imgCount - 1;
    if (imgNew &gt;= imgCount) imgNew = 0;
    // copy image
    if (imgNew != imgCurrent)
    {
      waitVSync();
      copyImage(pScreen, imageinfo.list-&gt;start[imgNew]);
      imgCurrent = imgNew;
      // wait keyDelay frames
      for(keyDelayCount = keyDelay; keyDelayCount &gt; 0; keyDelayCount--) 
      {
        // next time use shorter delay
        keyDelay = KEYREPEATDELAY;
        waitVSync();
        // both keys are released ?
        if ((PADREG &amp; PAD_RIGHT) &amp;&amp; (PADREG &amp; PAD_LEFT)) 
        {
          // use initial delay 
          keyDelay = KEYWAITDELAY;
          // break from loop
          break;
        }
      }
    }
  }
}</code></pre></div><p>Here is a link to the program:<br /><a href="http://www.gameboy-advance.net/emulated/gba_slide_show.htm" target="_blank">http://www.gameboy-advance.net/emulated &#133; e_show.htm</a></p><p>Here is the sourcerom:<br /><a href="http://moire.se/sourcerom.zip" target="_blank">http://moire.se/sourcerom.zip</a></p><p>It would mean alot to me if I could get some help with this.</p>]]></description>
			<pubDate>Tue, 24 Apr 2012 13:49:52 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/102121/#p102121</guid>
		</item>
	</channel>
</rss>
