vm::stackvar (experimental)

Should be convenient for small allocations which would be done on stack
on real console
This commit is contained in:
Nekotekina 2015-01-07 05:14:00 +03:00
parent 5ffc6ffca5
commit 3f44e07b7c
9 changed files with 272 additions and 44 deletions

View file

@ -36,11 +36,11 @@ int cellFontGetRevisionFlags(vm::ptr<be_t<u64>> revisionFlags)
return CELL_FONT_OK;
}
int cellFontInit(vm::ptr<CellFontConfig> config)
int cellFontInit(PPUThread& CPU, vm::ptr<CellFontConfig> config)
{
cellFont->Log("cellFontInit(config=0x%x)", config.addr());
vm::var<be_t<u64>> revisionFlags;
vm::stackvar<be_t<u64>> revisionFlags(CPU);
revisionFlags.value() = 0;
cellFontGetRevisionFlags(revisionFlags);
return cellFontInitializeWithRevision(revisionFlags.value(), config);
@ -101,7 +101,7 @@ int cellFontOpenFontFile(vm::ptr<CellFontLibrary> library, vm::ptr<const char> f
return ret;
}
int cellFontOpenFontset(vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
int cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
{
cellFont->Log("cellFontOpenFontset(library_addr=0x%x, fontType_addr=0x%x, font_addr=0x%x)",
library.addr(), fontType.addr(), font.addr());
@ -177,7 +177,7 @@ int cellFontOpenFontset(vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType>
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
}
vm::var<char> f((u32)file.length() + 1, 1);
vm::stackvar<char> f(CPU, (u32)file.length() + 1, 1);
memcpy(f.get_ptr(), file.c_str(), file.size() + 1);
int ret = cellFontOpenFontFile(library, f, 0, 0, font); //TODO: Find the correct values of subNum, uniqueId
font->origin = CELL_FONT_OPEN_FONTSET;