Alien Storm (Genesis) Credits Select Cheat Tool Version 1.2
A command-line tool that computes some stuff regarding the Genesis Alien Storm game's credits select cheat.
Loading...
Searching...
No Matches
ComputePruneTables.cpp File Reference

Functions for for computing prune tables. More...

#include <fstream>
#include <iomanip>
#include "Constants.h"

Functions

bool _WritePruneTablesHeader ()
bool _WritePruneTablesContent (bool OnlySafeSolutions, unsigned short InternalState, short CurrentRecursiveDepth, short MaximumRecursiveDepth)
bool _FindPruneTables (bool OnlySafeSolutions, unsigned short InternalState, unsigned short MaximumRecursiveDepth, unsigned short CurrentRecursiveDepth=0)
bool _ComputePruneTables (bool OnlySafeSolutions)

Variables

unsigned short * PruneTableSolutionBuffer
fstream PruneTablesFileCSV

Detailed Description

Functions for for computing prune tables.

Author
WaluigiBSOD

Function Documentation

◆ _ComputePruneTables()

bool _ComputePruneTables ( bool OnlySafeSolutions)

Computes all the prune tables used inside ComputeSolutions.cpp to prune their recursive search.

Are only saved inside a CSV file.

Parameters
[in]OnlySafeSolutionsIf true, solutions with left/right button presses are discarded, if false nothing happens. main() invokes this function twice, once with this parameter as false, once as true.
Returns
True if no file write and memory allocation errors occurred, false otherwise.
Author
WaluigiBSOD

◆ _FindPruneTables()

bool _FindPruneTables ( bool OnlySafeSolutions,
unsigned short InternalState,
unsigned short MaximumRecursiveDepth,
unsigned short CurrentRecursiveDepth = 0 )

The main logic behind computing all the all the prune tables used inside ComputeSolutions.cpp.

Search is still pruned using the result of ComputeMinimumSolutionLengths.cpp. Tables are saved inside a CSV file.

Parameters
[in]OnlySafeSolutionsIf true, solutions with left/right button presses are discarded, if false nothing happens.
[in]InternalStateThe starting internal state.
[in]MaximumRecursiveDepthThe maximum recursive depth allowed to be reached. It's equal to the minimum solution length considered by _ComputeSolutions().
[in]CurrentRecursiveDepthThe current recursive depth. It's automatically set to zero in the function's declaration.
Returns
True if no file write error occurred, false otherwise.
Author
WaluigiBSOD

◆ _WritePruneTablesContent()

bool _WritePruneTablesContent ( bool OnlySafeSolutions,
unsigned short InternalState,
short CurrentRecursiveDepth,
short MaximumRecursiveDepth )

Writes all the content of all the prune tables used inside ComputeSolutions.cpp, inside a CSV file.

Parameters
[in]OnlySafeSolutionsIf true, solutions with left/right button presses are discarded, if false nothing happens.
[in]InternalStateThe starting internal state.
[in]CurrentRecursiveDepthThe current recursive depth.
[in]MaximumRecursiveDepthThe maximum recursive depth allowed to be reached. It's equal to the minimum solution length considered by _ComputeSolutions().
Returns
True if no file write error occurred, false otherwise.
Author
WaluigiBSOD

◆ _WritePruneTablesHeader()

bool _WritePruneTablesHeader ( )

Writes the header of all the prune tables used inside ComputeSolutions.cpp, inside a CSV file.

Returns
True if no file write error occurred, false otherwise.
Author
WaluigiBSOD