mirror of
https://github.com/g012/l65.git
synced 2024-09-27 19:55:29 +00:00
Converted line endings in VIM files to unix
This commit is contained in:
parent
29f5666b20
commit
5f71b92bcd
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
/tmp
|
/tmp
|
||||||
/zig-*
|
/zig-*
|
||||||
*.bin
|
*.bin
|
||||||
|
*.cdl
|
||||||
*.nes
|
*.nes
|
||||||
*.nes.deb
|
*.nes.deb
|
||||||
*.sym
|
*.sym
|
||||||
|
@ -63,7 +63,7 @@ else ()
|
|||||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||||
|
|
||||||
add_compile_options(-fno-strict-aliasing -fomit-frame-pointer -ffast-math -fvisibility=hidden)
|
add_compile_options(-fno-strict-aliasing -fomit-frame-pointer -ffast-math -fvisibility=hidden)
|
||||||
add_compile_options(-Wsign-compare -Wno-missing-braces -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-switch -Wno-parentheses)
|
add_compile_options(-Wsign-compare -Wno-missing-braces -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-switch -Wno-parentheses -Wno-string-plus-int)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
35
nes.l65
35
nes.l65
@ -58,6 +58,13 @@ do
|
|||||||
for k,v in pairs(nes) do symbols[k] = v end
|
for k,v in pairs(nes) do symbols[k] = v end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
NTSC = {
|
||||||
|
CLOCK = 1789773
|
||||||
|
}
|
||||||
|
PAL = {
|
||||||
|
CLOCK = 1662607
|
||||||
|
}
|
||||||
|
|
||||||
-- add some symbol file formats for NES debuggers
|
-- add some symbol file formats for NES debuggers
|
||||||
cpu.getsym_as.mesen = function() -- .mlb
|
cpu.getsym_as.mesen = function() -- .mlb
|
||||||
local ins,fmt = table.insert,string.format
|
local ins,fmt = table.insert,string.format
|
||||||
@ -249,7 +256,7 @@ header = function(t)
|
|||||||
-- tv: 'N' for NTSC, 'P' for PAL, 'NP' for both preferring NTSC, 'PN' for both preferring PAL
|
-- tv: 'N' for NTSC, 'P' for PAL, 'NP' for both preferring NTSC, 'PN' for both preferring PAL
|
||||||
local tv, tvm = 0, (t.tv or 'n'):lower()
|
local tv, tvm = 0, (t.tv or 'n'):lower()
|
||||||
assert(tvm=='n' or tvm=='p' or tvm=='np' or tvm=='pn', "invalid tv mode: " .. tostring(t.tv) .. ", expected 'N', 'P', 'NP' or 'PN'")
|
assert(tvm=='n' or tvm=='p' or tvm=='np' or tvm=='pn', "invalid tv mode: " .. tostring(t.tv) .. ", expected 'N', 'P', 'NP' or 'PN'")
|
||||||
if tvm[1] == 'p' then tv = 1 end
|
if tvm:sub(1,1) == 'p' then tv = 1 end
|
||||||
if #tvm > 1 then tv = tv + 2 end
|
if #tvm > 1 then tv = tv + 2 end
|
||||||
|
|
||||||
@@header -- size: 16 bytes
|
@@header -- size: 16 bytes
|
||||||
@ -277,6 +284,32 @@ end
|
|||||||
local n0ne = function(x) return not x or x == 0 end
|
local n0ne = function(x) return not x or x == 0 end
|
||||||
local val0 = function(x) return x and x or 0 end
|
local val0 = function(x) return x and x or 0 end
|
||||||
|
|
||||||
|
-- 2a03 APU emulator
|
||||||
|
apuemu = {
|
||||||
|
--a=0,x=0,y=0,s=0,p=0,pc=0,xjam=false,
|
||||||
|
--reset = function(self)
|
||||||
|
-- self.a,self.x,self.y,self.s,self.p,self.pc,self.xjam = 0,0,0,0xff,
|
||||||
|
--end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- plays a NSF tune and record its register writes for replay
|
||||||
|
-- stops at C00
|
||||||
|
-- FamiTracker must be in the path
|
||||||
|
-- Ported from Shiru's nsf2vgm
|
||||||
|
nsf = function(filename, song)
|
||||||
|
local f, nsf = assert(io.open(filename,'rb')) nsf=f:read('*all') f:close()
|
||||||
|
assert(nsf[0x7a] == 0, 'expansion chips are not supported')
|
||||||
|
nsf.songs = nsf[7]
|
||||||
|
nsf.loadadr=nsf[9]+(nsf[10]<<8) nsf.initadr=nsf[11]+(nsf[12]<<8) nsf.playadr=nsf[13]+(nsf[14]<<8)
|
||||||
|
local bs = false for i=1,8 do local p=nsf[0x70+i] nsf.page[i]=p if p~=0 then bs=true end end
|
||||||
|
if not bs then for i=1,8 do nsf.page[i]=i-1 end end
|
||||||
|
local ram,rom,page = {},{},{}
|
||||||
|
for i=1,#nsf-0x80 do rom[nsf.loadadr-0x7FFF] = nsf[0x81] end
|
||||||
|
local reg = { 0x13f, 0x108, 0x100, 0x100, 0x13f, 0x108, 0x100, 0x100, 0x180, 0x100, 0x100, 0x100, 0x13f, 0x100, 0x100, 0x100,
|
||||||
|
0x100, 0x100, 0x100, 0x100, 0x100, 0x11f, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100 }
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--[[ For all mappers, where relevant:
|
--[[ For all mappers, where relevant:
|
||||||
|
|
||||||
prg rom banks:
|
prg rom banks:
|
||||||
|
Loading…
Reference in New Issue
Block a user