Skip to content

Commit

Permalink
Check romname on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
10yard committed May 25, 2022
1 parent f57e35f commit ab10402
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions vectorkong/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,26 @@ function vectorkong.startplugin()
local BR = 0xffff -- instuction to break in a vector chain

function initialize()
mame_version = tonumber(emu.app_version())
if mame_version >= 0.196 then
if type(manager.machine) == "userdata" then
mac = manager.machine
bnk = mac.memory
if emu.romname() == "dkong" then
mame_version = tonumber(emu.app_version())
if mame_version >= 0.196 then
if type(manager.machine) == "userdata" then
mac = manager.machine
bnk = mac.memory
else
mac = manager:machine()
bnk = mac:memory()
end
else
mac = manager:machine()
bnk = mac:memory()
print("ERROR: The vectorkong plugin requires MAME version 0.196 or greater.")
end
else
print("ERROR: The vectorkong plugin requires MAME version 0.196 or greater.")
end
if mac ~= nil then
scr = mac.screens[":screen"]
cpu = mac.devices[":maincpu"]
mem = cpu.spaces["program"]
clear_graphic_banks()
end
clear_graphic_banks()
vector_lib = load_vector_library()
end

Expand Down

0 comments on commit ab10402

Please sign in to comment.