MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / iCSFileOpen

Function iCSFileOpen

src/SB/Core/gc/iCutscene.cpp:150–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150U32 iCSFileOpen(xCutscene* csn)
151{
152 U32 headerskip;
153 st_PKR_ASSET_TOCINFO ainfo;
154 const char* filename;
155
156 headerskip = ALIGN(csn->Info->HeaderSize, 2048);
157
158 if (!xSTGetAssetInfo(csn->Info->AssetID, &ainfo))
159 {
160 return 0;
161 }
162
163 filename = xST_xAssetID_HIPFullPath(csn->Info->AssetID);
164
165 if (iFileOpen(filename, 0x1, &csn->File) == 0)
166 {
167 iFileSeek(&csn->File, headerskip + (ainfo.sector - csn->File.ps.fileInfo.startAddr << 5),
168 IFILE_SEEK_SET);
169
170 csn->File.ps.asynckey = -1;
171 }
172 else
173 {
174 return 0;
175 }
176
177 return 1;
178}
179
180void iCSFileAsyncRead(xCutscene* csn, void* dest, U32 size)
181{

Callers 1

xCutscene_LoadStartFunction · 0.50

Calls 4

iFileOpenFunction · 0.70
iFileSeekFunction · 0.70
xSTGetAssetInfoFunction · 0.50
xST_xAssetID_HIPFullPathFunction · 0.50

Tested by

no test coverage detected