Skip to content

Commit

Permalink
Added support for Scooby-Doo: Night of 100 Frights (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkacjios committed Mar 26, 2022
1 parent 3b4bc12 commit 94c74ee
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
12 changes: 11 additions & 1 deletion source/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,23 @@ function love.wheelmoved(x, y)
PORT_DISPLAY_OVERRIDE = nil
end

local DEBUG_SORT_KEYS

function love.drawDeveloperInfo()
local stats = love.graphics.getStats()
stats.memory = collectgarbage("count")
stats.fps = love.timer.getFPS()

if not DEBUG_SORT_KEYS then
DEBUG_SORT_KEYS = table.keys(stats)
table.sort(DEBUG_SORT_KEYS)
end

graphics.setFont(DEBUG_FONT)
local i = 0
for stat, val in pairs(stats) do
for i, stat in ipairs(DEBUG_SORT_KEYS) do
local val = stats[stat]

local str

if stat == "memory" or stat == "texturememory" then
Expand Down
13 changes: 13 additions & 0 deletions source/modules/class/object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ function OBJECT:__index(key)
return nil
end

function OBJECT:instanceof(other)
local base = self

while base do
if base == rawget(other, "__baseclass") then
return true
end
base = rawget(base, "__baseclass")
end

return false
end

function OBJECT:super(method, ...)
local base = self

Expand Down
23 changes: 18 additions & 5 deletions source/modules/extensions/table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ do
cache = {}
return recursiveTableString(tbl)
end

function table.print(tbl)
print(table.tostring(tbl))
end
end

--[[local test = {
Expand Down Expand Up @@ -242,16 +246,25 @@ function table.sum(tbl)
return total
end

function table.keys(tbl)
local keys = {}
for k,v in pairs(tbl) do
table.insert(keys, k)
end
return keys
end

function table.random(tbl)
return tbl[math.random(1, #tbl)]
end

function table.randomkey(tbl)
local keys = table.keys(tbl)
return keys[math.random(1, #keys)]
end

function table.randomkeyvalue(tbl)
local keys = {}
for k,v in pairs(tbl) do
table.insert(keys, k)
end
local key = keys[math.random(1, #keys)]
local key = table.randomkey(tbl)
return key, tbl[key]
end

Expand Down
5 changes: 5 additions & 0 deletions source/modules/games/GIHE78-0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Scooby-Doo! Night of 100 Frights (NTSC-U v1.0)

local core = require("games.core")

return core.newGame(0x801AD440)

0 comments on commit 94c74ee

Please sign in to comment.