-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LuaConnector for autotracking N64 games
This commit adds a LuaConnector class which is capable of connecting to emulator Lua scripts for autotracking. Proof of concept was done using BizHawk 2.8 and the WarpWorld ConnectorLib lua script to power the autotracking in my fork of Hamsda's ZOOTR pack. This commit also adds an IAutotrackProvider interface which the autotracker uses to abstract away the implementation of the LuaConnector. Maybe the other trackers (snes, uat, ap) can be migrated over to this interface to help clean up the autotracker code.
- Loading branch information
Showing
17 changed files
with
1,553 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef _CORE_AUTOTRACK_PROVIDER_H | ||
#define _CORE_AUTOTRACK_PROVIDER_H | ||
|
||
#include <stdint.h> | ||
#include <vector> | ||
#include <string> | ||
#include <set> | ||
|
||
class IAutotrackProvider { | ||
public: | ||
virtual ~IAutotrackProvider() = default; | ||
|
||
virtual const std::string& getName() = 0; | ||
|
||
virtual bool start() = 0; | ||
virtual bool stop() = 0; | ||
|
||
// Returns true if cache was changed | ||
virtual bool update() = 0; | ||
|
||
virtual bool isReady() = 0; | ||
virtual bool isConnected() = 0; | ||
|
||
virtual void clearCache() = 0; | ||
|
||
virtual void addWatch(uint32_t address, unsigned int length) = 0; | ||
virtual void removeWatch(uint32_t address, unsigned int length) = 0; | ||
virtual void setWatchUpdateInterval(size_t interval) = 0; | ||
|
||
virtual void setMapping(const std::set<std::string>& flags) = 0; | ||
virtual uint32_t mapAddress(uint32_t address) = 0; | ||
|
||
virtual bool readFromCache(uint32_t address, unsigned int length, void* out) = 0; | ||
virtual uint8_t readUInt8FromCache(uint32_t address, uint32_t offset = 0) { return 0; } | ||
virtual uint16_t readUInt16FromCache(uint32_t address, uint32_t offset = 0) { return 0; } | ||
virtual uint32_t readUInt32FromCache(uint32_t address, uint32_t offset = 0) { return 0; } | ||
|
||
virtual uint8_t readU8Live(uint32_t address, uint32_t offset = 0) { return 0; } | ||
virtual uint16_t readU16Live(uint32_t address, uint32_t offset = 0) { return 0; } | ||
virtual uint32_t readU32Live(uint32_t address, uint32_t offset = 0) { return 0; } | ||
}; | ||
|
||
#endif /* _CORE_AUTOTRACK_PROVIDER_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.