MCPcopy Create free account
hub / github.com/TASEmulators/fceux / AutoFire

Function AutoFire

src/fceu.cpp:704–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702}
703
704void AutoFire(void)
705{
706 static int counter = 0;
707 if (justLagged == false)
708 {
709 //counter = (counter + 1) % (8 * 7 * 5 * 3);
710 counter = (counter + 1) % AutoFirePatternLength;
711 }
712 //If recording a movie, use the frame # for the autofire so the offset
713 //doesn't get screwed up when loading.
714 if (FCEUMOV_Mode(MOVIEMODE_RECORD | MOVIEMODE_PLAY))
715 {
716 //rapidAlternator = AutoFirePattern[(AutoFireOffset + FCEUMOV_GetFrame()) % AutoFirePatternLength]; //adelikat: TODO: Think through this, MOVIEMODE_FINISHED should not use movie data for auto-fire?
717 //adelikat: TODO: Think through this, MOVIEMODE_FINISHED should not use movie data for auto-fire?
718 rapidAlternator = ( (AutoFireOffset + FCEUMOV_GetFrame()) % AutoFirePatternLength ) < AFon;
719 }
720 else
721 {
722 //rapidAlternator = AutoFirePattern[(AutoFireOffset + counter) % AutoFirePatternLength];
723 rapidAlternator = ( (AutoFireOffset + counter) % AutoFirePatternLength ) < AFon;
724 }
725}
726
727void UpdateAutosave(void);
728

Callers 2

FCEUI_EmulateFunction · 0.85
UpdateGamepadFunction · 0.85

Calls 2

FCEUMOV_ModeFunction · 0.85
FCEUMOV_GetFrameFunction · 0.85

Tested by

no test coverage detected