News: 11 March 2016 - Forum Rules

Author Topic: Snes9x Lua read ROM data?  (Read 1982 times)

Garland

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Snes9x Lua read ROM data?
« on: March 18, 2020, 09:07:09 pm »
Is it possible to read ROM data using Lua in Snes9x, or only RAM? Simple things like rom filename, or game name from within the ROM itself.

tvtoon

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
Re: Snes9x Lua read ROM data?
« Reply #1 on: March 22, 2020, 09:58:17 pm »
Do you want LUA bindings to read these values from Snes9x? I think they have been submitting them to the main repository, it is not hard to get them.

Garland

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Re: Snes9x Lua read ROM data?
« Reply #2 on: March 23, 2020, 06:52:41 pm »
Game name was found with:

Code: [Select]
local game = ""
for i=0, 22, 1
do
    m = memory.readbyte(0xFFC0 + i)
    game = game .. string.char(m)
end