[keel] Make PreloadPtr 64 bit
This commit is contained in:
		@@ -119,7 +119,7 @@ ox::Result<std::size_t> getPreloadAddr(keel::Context *ctx, ox::CRStringView path
 | 
			
		||||
	oxRequire(buff, static_cast<ox::MemFS*>(ctx->rom.get())->directAccess(path));
 | 
			
		||||
	PreloadPtr p;
 | 
			
		||||
	oxReturnError(ox::readMC(buff, stat.size, &p));
 | 
			
		||||
	return p.preloadAddr + ctx->preloadSectionOffset;
 | 
			
		||||
	return static_cast<std::size_t>(p.preloadAddr) + ctx->preloadSectionOffset;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ox::Result<std::size_t> getPreloadAddr(keel::Context *ctx, const ox::FileAddress &file) noexcept {
 | 
			
		||||
@@ -127,7 +127,7 @@ ox::Result<std::size_t> getPreloadAddr(keel::Context *ctx, const ox::FileAddress
 | 
			
		||||
	oxRequire(buff, static_cast<ox::MemFS*>(ctx->rom.get())->directAccess(file));
 | 
			
		||||
	PreloadPtr p;
 | 
			
		||||
	oxReturnError(ox::readMC(buff, stat.size, &p));
 | 
			
		||||
	return p.preloadAddr + ctx->preloadSectionOffset;
 | 
			
		||||
	return static_cast<std::size_t>(p.preloadAddr) + ctx->preloadSectionOffset;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -21,8 +21,8 @@ namespace keel {
 | 
			
		||||
// data.
 | 
			
		||||
struct PreloadPtr {
 | 
			
		||||
	static constexpr auto TypeName = "net.drinkingtea.keel.PreloadPtr";
 | 
			
		||||
	static constexpr auto TypeVersion = 1;
 | 
			
		||||
	uint32_t preloadAddr = 0;
 | 
			
		||||
	static constexpr auto TypeVersion = 2;
 | 
			
		||||
	uint64_t preloadAddr = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
oxModelBegin(PreloadPtr)
 | 
			
		||||
@@ -97,8 +97,8 @@ ox::Error buildUuidMap(Context *ctx) noexcept;
 | 
			
		||||
 | 
			
		||||
template<typename T>
 | 
			
		||||
ox::Result<keel::AssetRef<T>> readObj(
 | 
			
		||||
		[[maybe_unused]] keel::Context *ctx,
 | 
			
		||||
		[[maybe_unused]] ox::CRStringView assetId,
 | 
			
		||||
		keel::Context *ctx,
 | 
			
		||||
		ox::CRStringView assetId,
 | 
			
		||||
		[[maybe_unused]] bool forceLoad = false) noexcept {
 | 
			
		||||
#ifndef OX_BARE_METAL
 | 
			
		||||
	return readObjFile<T>(ctx, assetId, forceLoad);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user