lua-add vram_readword and vram_writeword

This commit is contained in:
zeromus 2011-09-16 02:47:53 +00:00
parent 375fa0c94f
commit 92fe950b24
1 changed files with 15 additions and 0 deletions

View File

@ -1750,6 +1750,14 @@ DEFINE_LUA_FUNCTION(memory_readbytesigned, "address")
lua_pushinteger(L, value);
return 1;
}
DEFINE_LUA_FUNCTION(vram_readword, "address")
{
int address = luaL_checkinteger(L,1);
u16 value = T1ReadWord(MMU.ARM9_LCD,address);
lua_settop(L,0);
lua_pushinteger(L, value);
return 1;
}
DEFINE_LUA_FUNCTION(memory_readword, "address")
{
int address = luaL_checkinteger(L,1);
@ -1797,6 +1805,13 @@ DEFINE_LUA_FUNCTION(memory_writeword, "address,value")
_MMU_write16<ARMCPU_ARM9>(address, value);
return 0;
}
DEFINE_LUA_FUNCTION(vram_writeword, "address,value")
{
int address = luaL_checkinteger(L,1);
u16 value = (u16)(luaL_checkinteger(L,2) & 0xFFFF);
T1WriteWord(MMU.ARM9_LCD,address,value);
return 0;
}
DEFINE_LUA_FUNCTION(memory_writedword, "address,value")
{
int address = luaL_checkinteger(L,1);