You are not logged in.

Read the FAQ and Knowledge Base before posting.
WiFi not emulated and not supported!!
We won't make a 3DS/2DS emulator.



#1 2007-04-21 18:10:03

zefiris
Member
Registered: 2007-03-24
Posts: 7

Some random thoughts and ideas :)

I know that I suck at programming, so I decided just to explain few my ideas with my implementation so that they could be adjusted to fit your style :) They all are windows version-related I think.

1) Savestates should not unpause game if it is paused.
Http://www.everfall.com/paste/id.php?01j8xzshd8o4

2) Storing input in separate variable.
http://www.everfall.com/paste/id.php?nw98atap2jjt
There's one reason behind it - currently if you save state holding right, then release it and load state - button will be held in game. This modification however removes this effect.

3) I don't know how to do it yet, but avi output would be really nice, especially if output was 60 fps movie without skipped frames.

Edited after some IRC discussion.

Last edited by zefiris (2007-04-21 20:15:01)

Offline

#2 2007-04-21 21:25:20

shash
Administrator
Registered: 2007-03-17
Posts: 897

Re: Some random thoughts and ideas :)

I'm quite fond of how to do proper movie recording, as I've implemented it a few times in the past, but I seriously doubt you could get 60fps AND movie recording.

Offline

#3 2007-04-21 23:11:26

zefiris
Member
Registered: 2007-03-24
Posts: 7

Re: Some random thoughts and ideas :)

shash, I mean you should record AVI with emulation speed, but recorded movie should be 60 fps and have every frames, no lags and anything else. PCSX can do it already, you play at 20fps and record movie, but AVI plays at 60 FPS and everything looks like it was running on full speed.

Offline

#4 2007-04-21 23:21:12

SCHUMI-4-EVA
Member
Registered: 2007-03-19
Posts: 97

Re: Some random thoughts and ideas :)

Just use FRAPS?

Offline

#5 2007-04-21 23:24:20

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: Some random thoughts and ideas :)

The fastest/easiest way I can think of is to set 0 frame skip and dump a screenshot every frame (a bit of code hacking required). Then use some external program to convert the screens to an avi (or whatever format you want).

This saves a lot of coding and means the slow part (the video encoding) can be done separately with a lot more options for the output format. Have a google to find free software for the conversion.

Offline

#6 2007-04-22 07:19:17

zefiris
Member
Registered: 2007-03-24
Posts: 7

Re: Some random thoughts and ideas :)

Fraps does not do what I want, masscat's method works better smile Exporting bmps wil take a lot of hard disk space though sad

Offline

#7 2007-04-22 12:11:15

evilynux
Member
From: Montréal
Registered: 2007-03-17
Posts: 118
Website

Re: Some random thoughts and ideas :)

zefiris wrote:

Fraps does not do what I want, masscat's method works better smile Exporting bmps wil take a lot of hard disk space though sad

Well... export bmp, convert to jpg or png with imagemagick then create a movie with mencoder?

Offline

#8 2007-04-22 14:25:05

zefiris
Member
Registered: 2007-03-24
Posts: 7

Re: Some random thoughts and ideas :)

I know how to convert moltiple image, but it's no use if I record whole movie to bmps first as they will still take all the place. If there was export to pngs... sad

Offline

#9 2007-04-22 15:08:36

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: Some random thoughts and ideas :)

Buy yourself a nice big USB hard drive.

Or, the cheaper solution, implement PNG export. libpng is pretty easy to use for simply dumping RGB data to a PNG file. Here is a section of code that uses it to write out a bitmap image.

FILE *fp;

fp = fopen( filename, "wb");

png_structp png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING,
                                               (png_voidp)NULL, NULL, NULL);

if ( png_ptr != NULL) {
  png_infop info_ptr = png_create_info_struct( png_ptr);

  if ( info_ptr != NULL) {
    if ( setjmp( png_jmpbuf( png_ptr)) == 0) {
      png_byte **rows_buffer = malloc( total_height * sizeof( png_byte *));

      // give the library the file pointer
      png_init_io( png_ptr, fp);

      // fill in the information
      png_set_IHDR( png_ptr, info_ptr, width, total_height, 1,
                    PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE,
                    PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);

      // allocate the row buffer things
      if ( rows_buffer != NULL) {
        int i, j;
        int byte_width = (width + 7) / 8;
        int row_index = 0;

        for ( j = 0; j < num; j++) {
          for ( i = 0; i < heights[j]; i++, row_index++) {
            rows_buffer[row_index] = &buffers[j][i * (byte_width)];
          }
        }
        png_set_rows( png_ptr, info_ptr, rows_buffer);

        // write the image
        png_write_png( png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
        free( rows_buffer);

        join_good = TRUE;
      }
      else {
        LOG( LOG_ERROR, "Failed to allocate the row pointer buffer");
      }
    }
    else {
      LOG( LOG_ERROR, "The libpng calls failed somewhere");
    }

    png_destroy_info_struct( png_ptr, &info_ptr);
  }
  else {
    LOG( LOG_ERROR, "Failed to allocate the png info structure");
  }
  png_destroy_write_struct( &png_ptr, (png_infopp)NULL);
}

Offline

#10 2007-04-22 17:21:17

zefiris
Member
Registered: 2007-03-24
Posts: 7

Re: Some random thoughts and ideas :)

yay, thanks smile

Offline

Board footer

Powered by FluxBB