Hitchhiker's guide to the NICE library
First, all of the normal Lua STDLIB exists. That includes file IO.
Second, the following functions are available from the "doukutsu" table:
"callBaseNPC", -- npcAddr (NOTE: NICE, since the Audio release, no longer hooks NPC 216, though an overridden NPC 216 still exists as an example)
"createNPC", -- type, x, y, xmove, ymove, direction, parent, initSlot
--raw functions for direct memory access
--All "peek" functions are int : int
--All "poke" functions are int,int
"peek32u","poke32u",
"peek16u","poke16u",
"peek8u","poke8u",
"peek32s","poke32s",
"peek16s","poke16s",
"peek8s","poke8s",
--Bitfield manipulation
"bitAnd","bitOr","bitXor" -- All of these are int : int,int
-- The following are defined in init.lua after it moves all of the above into the doukutsu table.
-- These are convenience functions, really, but useful ones!
-- Gets an NPC's address from it's ID.
function doukutsu.getNPCPtr(npcId)
-- Magic! Turns an NPC's data into a structure.
function doukutsu.getNPCData(npcPtr)
-- Also magic! Writes that structure back into an NPC.
function doukutsu.setNPCData(npcPtr,npc)
Next, the "dsound" table.
This can load anything libsndfile loads,
but if DirectSound doesn't like the sample rate or something...
"loadSound",-- buffer : fileName
"playSound",-- buffer,(looping,(position))
"stopSound",-- buffer
"freeSound", -- buffer
"playingSound",-- boolean : buffer
-- Again, init.lua moves these into the dsound table - they start out in the global namespace, but that's a bit messy, isn't it?