Capture Screen Shots of Your Yaroze with Screen Grabber

This issue's "Spotlight" came to me kind of suddenly. I was recently reading the Yaroze newsgroups and came across a message from David Nyo describing how to transfer memory card contents to the PC (and thus making your saved games available to everyone). I wondered if SIOCONS also gave you any commands for transferring video memory to your PC; I've been looking for a way to make screenshots of Yaroze games. Sure enough, the commands are there! Now all I needed was a provision whereby I can press some buttons during a game and have it capture that screen. I created a couple of routines and data structures to do just this.

Unfortunately there is a major limitation in the current release. You see, the process that I use involves copying the video buffer to the Yaroze memory and then to the PC. Since we must first put the screen shot in the Yaroze memory we need to make sure we have enough space to store it. A single hi-res (640x480) image takes about 600kb. Since the Yaroze only has 1.5M available (2M minus the 0.5M for the libraries), that leaves only 900kb for your actual game code. And if you're not taking screen shots, that 600kb is just empty wasted space. Of course if you're using a lower resolution then the requirements are substantially less. What we need is some way to transfer the video memory directly to the PC. Until that time the RAM transfer is still necessary.

With that said, here is the process to transfer a screen to your PC.

  1. Include the "scrnshot.c" and "scrnshot.h" files in your project.
  2. Change the "#defines" in "scrnshot.h" to select the part of the video buffer that gets grabbed.
  3. Set up some code to call the "scrnshot_store" function within your game (I call it when I press L1, L2, R1, and R2 together).
  4. Run your game and when you want to grab the screen hit the button combination you chose.
  5. Note on your SIOCONS output the address and length that get printed. You will use these values when you copy RAM contents to the PC.
  6. Get back to the SIOCONS prompt. Unfortunately the only way to do this is to quit your game (as long as you don't RESET the Yaroze the RAM will still hold your screen shot).
  7. At the SIOCONS prompt enter the following:
  8.   <F10><F4>
      Dsave> <filename> <addr> <len>

    Pick a file name and substitute the address and length given by step 5 above. Depending on the size of the screen shot this could take a while.

  9. Now you have a memory dump on your PC. To make a picture of it you can run the provided utility "mem2bmp". The usage is as follows:
  10.   mem2bmp.exe <width> <height> <input> <output>

    This will take the raw memory data and add the appropriate information to change it to a 24-bit BMP file. You should probably name the output with .bmp just for clarity.

Again, once I write a more sophisticated program to transfer data to the PC the RAM limitation will be lifted.

To get the necessary files click the link below. (16k)


This web page and all other pages on this site are © 1997 Scott Cartier