Posts for blip

1 2 3 4 5 6 7
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
WalkerBoh wrote:
Now when I try to run it I can´t decrease my emulator speed.
Try editing your famtasia.ini with a text editor. Here are the settings in my .ini file:
[Speed]
DrawFrame=1
ExecSpeed=100
Occupation=1
Benchmark=0
AutoFrame=0
FullSpeed=0
With these settings, I can set the execution speed to whatever I want. I hope this helps.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Updated the greatest hits archive:
added:  walkerboh-deadly-feet-(wizwar).fmv
added:  walkerboh-glitches-(wizwar).fmv
added:  genisto-the-juggler-(arkanoid).fmv
added:  genisto-the-juggler-2-(arkanoid).fmv
renamed:  genisto-1ups-(smb3j).fmv
renamed:  genisto-stunts-8-2-(smb3j).fmv
Post subject: Re: What exactly is "cool"?
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
pierrot wrote:
The whole point of being satisfied with beating these things was that they were so hard and that you HAD to do it in one run.
It takes a completely different skill to make these movies: cleverness. The skilled player uses all of the tricks available to him, glitches, bugs, wacky game physics, and the advantages given to him by the emulator to shave seconds off his performance. The thrill comes when a new timeattack is posted that beats the previous time. Whenever this happens, I ask "HOW did they do it?" The answer is usually very entertaining. Note: I wrote this reply for the benefit of the other users of this forum. You seem content with your viewpoint.
Post subject: Greatest Hits
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
After a bit of effort, I managed to compile a "Greatest Hits" collection: http://www.altvox.com/~squid/greatest-hits.zip Once again, you'll need the latest patched famtasia from the vending machine (with the "from now" fix turned on), and all of the relevant roms. Here's a file list of what's in the .zip. Hopefully it gives a good enough idea of what's inside:
feitclub-goes-commando-(hitlernf).fmv
geniso-smacks-birdo-(smb2).fmv
genisto-boss-critical-hit-(cv).fmv
genisto-goes-through-walls-(cv3j).fmv
genisto-sneaky-peach-(smb2).fmv
genisto-stunts-(smb3j).fmv
genisto-stunts-2-(smb3j).fmv
genisto-vs-dracula-(cv3j).fmv
genisto-vs-giant-bat-(cv3j).fmv
linnom-vs-joker-(batman).fmv
mfried-stunts-(smb).fmv
mfried-stunts-2-(smb2j).fmv
morimoto-is-speedy-(gradius).fmv
morimoto-is-speedy-2-(gradius).fmv
morimoto-teleports-(rockman2).fmv
morimoto-teleports-2-(rockman2).fmv
morimoto-teleports-3-(rockman2).fmv
morimoto-vs-bowser-(smb3j).fmv
morimoto-vs-flashman-(rockman2).fmv
morimoto-vs-quickman-(rockman2).fmv
sleepz-darknuts-go-boom-(loz).fmv
sleepz-smacks-triclyde-(smb2).fmv
sleepz-vs-blade-(rcr).fmv
sleepz-vs-ivan-(rcr).fmv
sleepz-vs-mojo-(rcr).fmv
sleepz-vs-rocko-(rcr).fmv
sleepz-vs-thor-(rcr).fmv
sleepz-vs-wizzrobes-(loz).fmv
sleepz-vs-wizzrobes-2-(loz).fmv
I'll probably take this .zip offline in a couple of days, so grab it while you can. Unfortunately, I wasn't able to get Battletoads working at all. The movies kept desyncing. :( Note to whomever is going to make the movie: I have a version of Famtasia that writes a raw .avi file. This might be of some use. It can also be modified to suppress the "MOVIE REPLAY" etc messages. Contact me directly if you want a copy.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
feitclub wrote:
This didn't work for me. Observe:
After seeing this, the .fmv you tried to open has been corrupted. You'll probably need to download again.
Post subject: Movie clips
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
And now, I present my latest hack: Sleepz-Vs-Thor.FMV I found a way to extract a portion of an .fmv into another, smaller .fmv. The clip above is the battle with Thor from Sleepz' River City Ransom time attack. To watch it, you'll need my previous hack, and the River City Ransom (USA) rom. And now, for your enjoyment, is the Sleepz Greatest Hits collection: http://www.altvox.com/~squid/sleepz-greatest-hits.zip I'm afraid the process of creating a smaller clip from an .fmv is a little complicated, otherwise I would post the tools so others could do it. Now, I guess I should go through and collect clips of peoples' favorite parts from the time attacks...
Post subject: Re: Trailer ideas
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
Background music would preferably be something specifically composed for this movie (don't rip copyrighted stuff!), with the game soundeffects still hearable.
I think it would be best to use a video game remix from a site such as VGMix or OC Remix. It would probably be easy to get permission from the author and also it's kind of fitting with the theme.
Post subject: Famtasia fix - "from now" recording bugfix
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Have you ever wondered why recording a movie "from now" in Famtasia never worked quite right? This patch should fix it:
		/* "from now" recording fix */
		{ 0x1b0,     1, "\xf0" },
		{ 0x2f067,   5, "\xe9\x64\x05\x01\x00" },
		{ 0x3f5d0,0x20, "\xc7\x05\x58\x83\x46\x00\x00\x00\x00\x00\xe8\x31\x9f\xfe\xff\xc7\x05\x58\x83\x46\x00\x01\x00\x00\x00\xe9\x7e\xfa\xfe\xff\x90\x90" },
This patch fixes a bug in the movie load routine. The movie creation routine appears to be fine. I would like people to consider this an "experimental" patch, since it *does* mess with the movie load routine. Edit: Updated the patch to be compatible with the sound logging patch. Note to Bisqwit: in the sound logging patch, the byte at $1b0 should also be $f0.
Post subject: Re: Convert .fmv to .vmv files
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
Why's that? To get a savestate to the beginning?
The goal is to get a savestate at the *absolute* beginning, immediately after the system was reset. It seems easiest to do this using a movie recording that automatically resets and saves the state for you. I don't know of any other way to guarantee that a savestate is made immediately after system reset. Edit: You might be right about only needing a single generic savestate. I haven't tested this, though.
Post subject: Occupation slider fix
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
It seems Famtasia does have separate resources for the Japanese and English versions. The following patch should fix both versions:
		/* occupation slider fix */
		{ 0x5268f, 1, "\x50" },
		{ 0x57a7f, 1, "\x50" },
Post subject: Convert .fmv to .vmv files
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Converting an .fmv to a .vmv is slighly more complicated than converting in the other direction. Before you convert, you need to make a movie that was recorded from reset. It's easy though, just go to Options->Movie in VirtuaNES, and check the box "Start a record from reset". Open the ROM, record a movie, stop the movie, then exit. Once you have that, then here's in the C code that will do the conversion:
// convert .fmv to .vmv
// example:
// convert C:\GAMES\fam510\genisto-smb2.fmv "C:\GAMES\VirtuaNes\movie\Super Mario Bros 2 (U) (PRG 0).vmv" smb2.vmv
// convert C:\GAMES\fam510\sleepzteam-zelda.fmv "C:\GAMES\VirtuaNes\movie\Legend of Zelda, The (U) (PRG 0).vmv" zelda.vmv

static unsigned long crc_table[256];

void gen_crc_table(void)
{
	unsigned long crc, poly;
	int i, j;

	poly=0x04c11db7L;
	for(i=0; i<256; i++)
	{
		crc=i<<24;
		for(j=8; j>0; j--)
		{
			if(crc&0x80000000L)
				crc=(crc<<1)^poly;
			else
				crc<<=1;
		}
		crc_table[i]=crc;
	}
}

unsigned long get_crc(unsigned char* buf, int length)
{
	register unsigned long crc;
	int i;

	crc=0xffffffffL;
	for(i=0; i<length; ++i)
	{
		crc=(crc<<8)^crc_table[(crc>>24)^buf[i]];
	}

	return crc^0xffffffffL;
}

static const char* vmv_header_string="VirtuaNES MV\x00\x03\x78\x00";

int main(int argc, char** argv)
{
	if(argc<4)
	{
		printf("usage: convert <input_fmv_file> <input_vmv_from_reset> <output_vmv_file>\n");
		exit(0);
	}

	FILE* f_in=fopen(argv[2], "rb");
	if(!f_in)
	{
		perror("fopen\n");
		exit(0);
	}

	unsigned char vmv_header_buf[0x40];
	fread(vmv_header_buf, 1, 0x40, f_in);
	unsigned long save_state_len=*(unsigned long*)(&vmv_header_buf[0x34])-0x40;
	unsigned long save_state_chksum=*(unsigned long*)(&vmv_header_buf[0x14]);
	unsigned char* save_state_buf=(unsigned char*)malloc(save_state_len);
	fread(save_state_buf, 1, save_state_len, f_in);
	fclose(f_in);

	memset(vmv_header_buf, 0, 0x40);
	memcpy(vmv_header_buf, vmv_header_string, 0x10);

	f_in=fopen(argv[1], "rb");
	if(!f_in)
	{
		perror("fopen\n");
		exit(0);
	}

	unsigned char ctr_flags;
	unsigned long rerecord_count;
	unsigned long num_samples;
	fseek(f_in, 5, SEEK_SET);
	fread(&ctr_flags, 1, 1, f_in);
	fseek(f_in, 10, SEEK_SET);
	fread(&rerecord_count, 1, 4, f_in);
	fseek(f_in, 0, SEEK_END);
	num_samples=ftell(f_in)-0x90;
	unsigned long num_frames=num_samples;
	if(ctr_flags & 0x40)
	{
		num_frames=num_samples>>1;
	}

	vmv_header_buf[0x10]=(ctr_flags & 0x40) ? 0x83 : 0x81;
	*(unsigned long*)(&vmv_header_buf[0x14])=save_state_chksum;
	*(unsigned long*)(&vmv_header_buf[0x1c])=rerecord_count+1;
	memcpy(&vmv_header_buf[0x20], "\x03\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", 0x10);
	*(unsigned long*)(&vmv_header_buf[0x30])=0x40+save_state_len+num_samples;
	*(unsigned long*)(&vmv_header_buf[0x34])=0x40+save_state_len;
	*(unsigned long*)(&vmv_header_buf[0x38])=num_frames;
	gen_crc_table();
	*(unsigned long*)(&vmv_header_buf[0x3c])=get_crc(vmv_header_buf, 0x3c);

	FILE* f_out=fopen(argv[3], "wb");
	if(!f_out)
	{
		perror("fopen\n");
		exit(0);
	}

	fwrite(vmv_header_buf, 1, 0x40, f_out);
	fwrite(save_state_buf, 1, save_state_len, f_out);

	unsigned char buf[0x1000];
	fseek(f_in, 0x90, SEEK_SET);
	unsigned long i;
	for(i=0; i<num_samples; )
	{
		long n=(num_samples-i)>0x1000 ? 0x1000 : (num_samples-i);
		fread(buf, 1, n, f_in);
		long x;
		for(x=0; x<n; ++x)
		{
			unsigned char c=0;
			if(buf[x]&0x01) c|=0x80;
			if(buf[x]&0x02) c|=0x40;
			if(buf[x]&0x04) c|=0x10;
			if(buf[x]&0x08) c|=0x20;
			if(buf[x]&0x10) c|=0x02;
			if(buf[x]&0x20) c|=0x01;
			if(buf[x]&0x40) c|=0x04;
			if(buf[x]&0x80) c|=0x08;
			buf[x]=c;
		}
		fwrite(buf, 1, n, f_out);
		i+=n;
	}

	fwrite(save_state_buf, 1, save_state_len, f_out);

	fclose(f_out);
	fclose(f_in);
	free(save_state_buf);

	return 0;
}
Give the .fmv file as the first argument, the short movie you created above as the second argument, and the output .vmv filename as the last argument. I've only tested this method on two movies so far: Genisto's SMB2 run and Sleepz' Zelda run. Genisto's movie plays back fine, but Sleepz' movie desyncs before Link even gets the wooden sword. :( If you manage to make a .vmv that doesn't desync, you should consider yourself lucky. Good luck!
Post subject: Re: Is this patch cumulative?
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Yggdrasil wrote:
i.e., i can patch v 5.1 with this, or any of the other ones, independently of the others?
Yep, it's independent.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Phil wrote:
It seems all games have the wrong time ex. Double Dragon 3 was 14:05 with the other version and now it's 14:04.
The original Famtasia was doing some weird rounding. I'm pretty confident that my method is correct, though. It's very simple to take the number of frames in a movie and turn that into minutes/seconds.
Post subject: Famtasia fix - movie length calculation
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
As Arc pointed out here, Famtasia has a bug when computing the length of a movie in minues/seconds. Here's a fix, in C code form:
		{ 0x2f228, 0x1e, "\x89\xc8\xb9\x3c\x00\x00\x00\x99\xf7\xf9\x81\xfa\x1e\x00\x00\x00\x7c\x01\x40\x99\xf7\xf9\x52\x99\xf7\xf9\x52\x50\xeb\x40" },
If you're using a hex editor, change the 30 bytes at offset $2f228 from: DC 0D F8 28 44 00 C1 E8 1F 03 D0 8B F2 89 74 24 18 E8 92 29 00 00 99 DB 44 24 18 B9 3C 00 to: 89 C8 B9 3C 00 00 00 99 F7 F9 81 FA 1E 00 00 00 7C 01 40 99 F7 F9 52 99 F7 F9 52 50 EB 40
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
qFox wrote:
but anyways, can i make it compatible with fam?
Bisqwit is totally right about the timing needing to be precise. Check my post here. I found that for some games (like Batman), the difference in emulation causes a desync between movies made in Famtasia and VirtuaNES. Your emulator could have a "Famtasia compatability" mode, where it would copy the emulation used by Famtasia exactly. It would be tough, but you might be able to rip the emulator core directly out of the Famtasia binary and use it as-is.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
This one seems to do nothing but crash if I check the "max speed" checkbox and run the game.
Then I like Phil's idea of having separate Windows and Linux binaries. The Windows version should have the C3 byte at $30010... I'd like to fix it the "right" way, but I don't have a Linux box available to test against. Edit: The most I can understand from the Morimoto BBS is that people are complaining about the CPU lock-up on Windows. The C3 byte should fix that.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
I'll just post the code...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//static const char* input_vmv="C:\\GAMES\\VirtuaNes\\Bat_Lezard.vmv";
//static const char* output_fmv="C:\\GAMES\\fam510\\lezard-batman.fmv";
static const char* famtasia_string="Family Emulator \"Famtasia\" Ver5.1";

int main(int argc, char** argv)
{
	if(argc<3)
	{
		printf("usage: convert <input_vmv_file> <output_fmv_file>\n");
		exit(0);
	}

	FILE* f_in=fopen(argv[1], "rb");
	if(!f_in)
	{
		perror("fopen\n");
		exit(0);
	}

	FILE* f_out=fopen(argv[2], "wb");
	if(!f_out)
	{
		perror("fopen\n");
		exit(0);
	}

	long rerecord_count;
	long ctr_data_offset;
	long num_samples;
	unsigned char ctr_flags;
	fseek(f_in, 0x10, SEEK_SET);
	fread(&ctr_flags, 1, 1, f_in);
	fseek(f_in, 0x1c, SEEK_SET);
	fread(&rerecord_count, 1, 4, f_in);
	fseek(f_in, 0x34, SEEK_SET);
	fread(&ctr_data_offset, 1, 4, f_in);
	fread(&num_samples, 1, 4, f_in);

	fwrite("FMV\x1a\x00", 1, 5, f_out);
	if(ctr_flags&0x02)
	{
		fwrite("\xc0", 1, 1, f_out);
		num_samples<<=1;
	}
	else
	{
		fwrite("\x80", 1, 1, f_out);
	}
	fwrite("\x00\x00\x00\x00", 1, 4, f_out);
	fwrite(&rerecord_count, 1, 4, f_out);
	fwrite("\x00\x00", 1, 2, f_out);

	unsigned char buf[0x1000];
	memset(buf, 0, 0x1000);
	strcpy((char*)buf, famtasia_string);
	fwrite(buf, 1, 0x80, f_out);

	fseek(f_in, ctr_data_offset, SEEK_SET);
	long i;
	for(i=0; i<num_samples; )
	{
		long n=(num_samples-i)>0x1000 ? 0x1000 : (num_samples-i);
		fread(buf, 1, n, f_in);
		long x;
		for(x=0; x<n; ++x)
		{
			unsigned char c=0;
			if(buf[x]&0x80)	c|=0x01;
			if(buf[x]&0x40)	c|=0x02;
			if(buf[x]&0x10)	c|=0x04;
			if(buf[x]&0x20)	c|=0x08;
			if(buf[x]&0x02)	c|=0x10;
			if(buf[x]&0x01)	c|=0x20;
			if(buf[x]&0x04)	c|=0x40;
			if(buf[x]&0x08)	c|=0x80;
			buf[x]=c;
		}
		fwrite(buf, 1, n, f_out);
		i+=n;
	}

	fclose(f_out);
	fclose(f_in);

	return 0;
}
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Well, I am amazed. For the heck of it I converted genisto's smb2 run into a VirtuaNES .vmv file, and it played back perfectly. This means that a .vmv to .fmv converter is also likely possible.
Boco wrote:
If the VirtuaNES movie started from system reset, though?
Let me try converting one of Lezard's videos to .fmv and we'll see how that goes. I'm really worried that if the movie doesn't start on the *exact* right frame, then the random number generators will start with different values. But we'll see. Edit: Lezard's Batman movie desyncs after about a minute of playing in Famtasia. I can't be sure, but it appears that at the desync point VirtuaNES emulates some slowdown in the game and Famtasia does not. So this desync appears to be due to a difference in the emulation. I'll happily post my converter code if people want to play around with it. My guess is that some .vmv files can be successfully converted.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
VirtuaNES movies contain a savestate where the movie was started from. This would be impossible to duplicate in Famtasia unless Famtasia was hacked into loading a savestate before playing. A Nesticle->VirtuaNES transcoder would probably be more feasible, since Nesticle movies also contain a savestate. I had a look at it, and IIRC the Nesticle header was like 3000 bytes larger than the VirtuaNES header. I dont know enough about the NES hardware to know what those 3000 bytes were for. That said, I would be very very surprised if the movies could be converted without problems. There would be differences in the emulation which would cause desync (even minor updates to an emulator, like Nesticle 0.42->0.43, cause desync).
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
It seems to me the problem is something like this: On Windows machines, if the c3 byte is not at $30010, then Famtasia is prone to locking up sometimes (for example, trying to run at 999% ExecSpeed with Occupation=1). On Linux machines, if the c3 byte *is* at $30010, then Famtasia sometimes becomes mute and doesn't recover (for example, if the CPU is too busy). After thinking about it for a bit, I think this is a solution:
// disable the routine that polls for a free sound buffer
		{ 0x30010,    1, "\xc3" },
// check that the sound buffer is free before attempting to play sound
		{ 0x2ff6e, 0x16, "\
\x8b\x0d\x3c\x23\x47\x00\x8b\x04\x8d\x40\x24\x47\x00\xb2\x01\x84\x50\x10\x74\x7f\xeb\x1f" },
Bisqwit, would you mind testing this as seeing if it works for you? Like I said, I couldn't reproduce the problem on my machine.
Post subject: Re: Fix to slowness
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
This patch will fix the problem I described:
Cool, good catch.
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
I mean, I just ran Shatterhand in the emulator, and started a "make clean" in other console, and the emulator went mute. No sound data was generated anymore.
Sound has been behind a *lot* of the observed problems. Famtasia has this nasty habit of locking up until a sound buffer has been freed. Therefore it must be very careful to output the exact number of samples per second required, or else it will either glitch (not enough samples written), or lock up (too many samples written). The C3 byte at $30010 disables the routine that Famtasia uses to wait for a free sound buffer, which will avoid lockups but allow sound glitches. To make matters worse, I think different machines behave different ways when sound glitches happen. For example, I can't reproduce your problem on my machine. This particular problem might be related to this:
        sub     eax, edx
        jg      .positive_interval
        mov     eax, 1
.positive_interval: 
Basically, if the timer misses its target, set sets the next timer 1 millisecond away in an attempt to "catch up". Unfortunately, this can cause problems with the sound (too many samples per second).
Bisqwit wrote:
it also includes my patch which should remove the heaviness-problem of 240 scanlines.
I don't think you've mentioned this before... I'm curious; what is it?
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
For those curious, here's the source code I used to compile the patch. Compiled using NASM for windows:
        bits    32

return_from_patch       equ     0x428866
exit_from_timer         equ     0x428db5
execution_speed         equ     0x46dcd4
frame_skip              equ     0x46dcd8
last_tick               equ     0x46dd04
timer_id                equ     0x467a78
timer_interval          equ     0x46da98
timer_interval_2        equ     0x467c14
timer_type              equ     0x46e584
exit_flag               equ     0x4489d0
timer_proc              equ     0x428820
settimer_ptr            equ     0x4412bc
sound_freq              equ     0x472350
sound_interval          equ     0x470eb8
sound_ptr               equ     0x472340
sound_buffer_size       equ     0x4722c0

ms_fraction             equ     0x473b34
previous_divisor        equ     0x473b38
keep_tick               equ     0x473b3c
sound_fraction          equ     0x473b40
sound_deficit           equ     0x473b44

        org     0x428bbc
        jmp     0x428d8c
patch_entry:
        mov     al, [timer_type]
        test    al, al
        je      .skip_clear_timer_id
        xor     ebx, ebx
        mov     [timer_id], ebx
.skip_clear_timer_id:
        mov     ah, [exit_flag]
        test    ah, ah
        jne     near exit_from_timer
        test    al, al
        je      near return_from_patch

        push    edx

        ; init variables when execution speed changes
        mov     eax, [execution_speed]
        cmp     eax, [previous_divisor]
        je      .skip_set_divisor
        xor     edx, edx
        mov     [ms_fraction], edx
        mov     [sound_fraction], edx
        mov     [sound_deficit], edx
        mov     [previous_divisor], eax
        call    esi
        mov     [keep_tick], eax
.skip_set_divisor:

        ; compute tick interval
compute_tick_interval:
        mov     ebx, [execution_speed]
        mov     eax, 0x683
        imul    dword [frame_skip]
        div     ebx
        test    edx, edx
        jz      .skip_fraction
        add     edx, [ms_fraction]
        cmp     edx, ebx
        jl      .skip_inc
        inc     eax
        sub     edx, ebx
.skip_inc:
        mov     [ms_fraction], edx
.skip_fraction:
        mov     [timer_interval], eax
        mov     [timer_interval_2], eax
        push    eax                     ; save time_interval

        ; compute timer delta
compute_timer_delta:
        add     eax, [keep_tick]
        mov     [keep_tick], eax
        push    eax                     ; save next_tick
        call    esi
        mov     edx, eax
        pop     eax                     ; restore next_tick
        sub     eax, edx
        jg      .positive_interval
        mov     eax, 1
.positive_interval:

        ; set timer
        push    byte 0
        push    byte 0
        push    dword timer_proc
        push    byte 0
        push    eax
        call    [settimer_ptr]
        mov     [timer_id], eax

        ; compute sound interval
compute_sound_interval:
        pop     eax                     ; restore time_interval
        imul    dword [sound_freq]
        mov     ebx, 0x7d0
        div     ebx
        test    edx, edx
        jz      .skip_fraction
        add     edx, [sound_fraction]
        cmp     edx, ebx
        jl      .skip_inc
        inc     eax
        sub     edx, ebx
.skip_inc:
        mov     [sound_fraction], edx
.skip_fraction:
        add     eax, [sound_deficit]    ; take into account frame-skipping
        cdq
        div     dword [frame_skip]
        mov     [sound_deficit], edx
        add     eax,eax                 ; sound intervals have a 2-byte resolution
        mov     edx, [sound_buffer_size]
        cmp     eax, edx
        jle     .sound_interval_ok
        mov     eax, edx
.sound_interval_ok:
        mov     [sound_interval], eax
        mov     word [sound_ptr], 0

        pop     edx
        jmp     return_from_patch
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
What is the difference between setting DrawFrame=2,Occupation=1 and setting DrawFrame=1,Occupation=2 ?
With DrawFrame=2, Occupation=1, the emulation will run 60 times per second, but it'll only display half of the frames. With DrawFrame=1, Occupation=2, it'll run the emulation 30 times per second, but draw all (30) of the frames. Edit: I've noticed that to get this version running at high speeds (>400%), I had to increase the Occupation number; increasing DrawFrame didn't help. It seems obvious, but I just thought I'd point it out. Edit 2: Re-introducing the following hack will allow Famtasia to run at 999% execution speed at Occupation 1: $30010:c3
Experienced Forum User
Joined: 4/11/2004
Posts: 155
Location: Fairfax, VA, USA
Bisqwit wrote:
blip wrote:
"Occupation" is just the term Famtasia uses when it writes the frameskip value to its .ini file. They're interchangeable.
[Speed] DrawFrame=2 ExecSpeed=100 Occupation=1 Benchmark=0 AutoFrame=0 FullSpeed=0 So what is this DrawFrame then?
Oops. You're right. "DrawFrame" is the value that's put in the "Refresh" box when you open up the "Speed Configuration" dialog box. "Occupation" governs how often the timers fire, so it needs to be set to 1 to get 60fps. Which reminds me, did you try finalfighter's fix to the Occupation slider? Did it work for you? You can get 30 fps by either setting DrawFrame to 2, or Occupation to 2.
1 2 3 4 5 6 7