Post subject: GBA Lua question
hellagels
He/Him
Experienced player (771)
Joined: 2/1/2011
Posts: 83
Location: Guangdong, China
My script includes such a sentense: currentSubWeapon=memory.read_u8(0x01877E) When I run the scripit, the output of Lua Console says: Warning: attempted read of 100222 outside the memory size of 32768 The address of RAM I hope to read is 0x0201877E in VBA-rr. Can someone tells me what's wrong with the sentense?
Current projects: Castlevania - Order of Ecclesia (NDS)
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11469
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Open hexeditor and spot your address and the region it is in. Use that region in your script. If it's not a system bus region (not all cores have that), you won't be able to use the same address fashion as the CPU itself uses, only region-wise access.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Spikestuff
They/Them
Editor, Publisher, Expert player (2630)
Joined: 10/12/2011
Posts: 6435
Location: The land down under.
Your issue is that you didn't point out the game... And the other is that you didn't give an example value when it's at default on vba. (I got the value working on vba) On a guess I'm assuming you're using Castlevania : Harmony of Dissonance due to your posts. You require to put something like:
Language: lua

memory.usememorydomain("ROM") currentSubWeapon=memory.read_u8(0x1877E)
or
Language: lua

memory.usememorydomain("Combined WRAM") currentSubWeapon=memory.read_u8(0x1877E)
Since these are the only two that work when you search the value you provided. On a guess, it might be the one with "Combined WRAM" mentioned. Which would be the one you require, as the value it gives is more appropriate.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11469
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Spikestuff wrote:
memory.usememorydomain("ROM")
Seriously?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Spikestuff
They/Them
Editor, Publisher, Expert player (2630)
Joined: 10/12/2011
Posts: 6435
Location: The land down under.
feos wrote:
Spikestuff wrote:
memory.usememorydomain("ROM")
Seriously?
He didn't provide an example number on default, so I'm forced to use whatever is necessary that works with the value, so be it, it's "ROM" or "Combined WRAM" or "Man on the Moon". Which is the exact reason why I pointed out that it's most likely "Combined WRAM" (on a whim). So yes. "Seriously."
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
hellagels
He/Him
Experienced player (771)
Joined: 2/1/2011
Posts: 83
Location: Guangdong, China
Thanks a lot. Now the script is working properly.
Current projects: Castlevania - Order of Ecclesia (NDS)