Implement LUA function memory.registerread.
This commit is contained in:
parent
f8b8e93eaf
commit
17e04a9b74
|
@ -2470,7 +2470,6 @@ static int memory_registerwrite(lua_State *L)
|
||||||
{
|
{
|
||||||
return memory_registerHook(L, MatchHookTypeToCPU(L,LUAMEMHOOK_WRITE), 1);
|
return memory_registerHook(L, MatchHookTypeToCPU(L,LUAMEMHOOK_WRITE), 1);
|
||||||
}
|
}
|
||||||
FCEU_MAYBE_UNUSED
|
|
||||||
static int memory_registerread(lua_State *L)
|
static int memory_registerread(lua_State *L)
|
||||||
{
|
{
|
||||||
return memory_registerHook(L, MatchHookTypeToCPU(L,LUAMEMHOOK_READ), 1);
|
return memory_registerHook(L, MatchHookTypeToCPU(L,LUAMEMHOOK_READ), 1);
|
||||||
|
@ -6137,7 +6136,7 @@ static const struct luaL_reg memorylib [] = {
|
||||||
|
|
||||||
// memory hooks
|
// memory hooks
|
||||||
{"registerwrite", memory_registerwrite},
|
{"registerwrite", memory_registerwrite},
|
||||||
//{"registerread", memory_registerread}, TODO
|
{"registerread", memory_registerread},
|
||||||
{"registerexec", memory_registerexec},
|
{"registerexec", memory_registerexec},
|
||||||
// alternate names
|
// alternate names
|
||||||
{"register", memory_registerwrite},
|
{"register", memory_registerwrite},
|
||||||
|
|
|
@ -47,7 +47,11 @@ void (*MapIRQHook)(int a);
|
||||||
//normal memory read
|
//normal memory read
|
||||||
static INLINE uint8 RdMem(unsigned int A)
|
static INLINE uint8 RdMem(unsigned int A)
|
||||||
{
|
{
|
||||||
return(_DB=ARead[A](A));
|
_DB=ARead[A](A);
|
||||||
|
#ifdef _S9XLUA_H
|
||||||
|
CallRegisteredLuaMemHook(A, 1, _DB, LUAMEMHOOK_READ);
|
||||||
|
#endif
|
||||||
|
return(_DB);
|
||||||
}
|
}
|
||||||
|
|
||||||
//normal memory write
|
//normal memory write
|
||||||
|
@ -61,9 +65,13 @@ static INLINE void WrMem(unsigned int A, uint8 V)
|
||||||
|
|
||||||
static INLINE uint8 RdRAM(unsigned int A)
|
static INLINE uint8 RdRAM(unsigned int A)
|
||||||
{
|
{
|
||||||
|
_DB=ARead[A](A);
|
||||||
|
#ifdef _S9XLUA_H
|
||||||
|
CallRegisteredLuaMemHook(A, 1, _DB, LUAMEMHOOK_READ);
|
||||||
|
#endif
|
||||||
//bbit edited: this was changed so cheat substituion would work
|
//bbit edited: this was changed so cheat substituion would work
|
||||||
return(_DB=ARead[A](A));
|
|
||||||
// return(_DB=RAM[A]);
|
// return(_DB=RAM[A]);
|
||||||
|
return(_DB);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void WrRAM(unsigned int A, uint8 V)
|
static INLINE void WrRAM(unsigned int A, uint8 V)
|
||||||
|
@ -77,7 +85,11 @@ static INLINE void WrRAM(unsigned int A, uint8 V)
|
||||||
uint8 X6502_DMR(uint32 A)
|
uint8 X6502_DMR(uint32 A)
|
||||||
{
|
{
|
||||||
ADDCYC(1);
|
ADDCYC(1);
|
||||||
return(X.DB=ARead[A](A));
|
_DB=ARead[A](A);
|
||||||
|
#ifdef _S9XLUA_H
|
||||||
|
CallRegisteredLuaMemHook(A, 1, _DB, LUAMEMHOOK_READ);
|
||||||
|
#endif
|
||||||
|
return(_DB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void X6502_DMW(uint32 A, uint8 V)
|
void X6502_DMW(uint32 A, uint8 V)
|
||||||
|
|
Loading…
Reference in New Issue