~jakob/chip

a0e4f49a609a5cb54c46a78089a0d08583feb367 — Jakob L. Kreuze 4 years ago a7a8461 master
Add command-line arguments.
1 files changed, 6 insertions(+), 2 deletions(-)

M main.myr
M main.myr => main.myr +6 -2
@@ 89,7 89,7 @@ const getkeys = {
	]
}

const main = {
const main = {args : byte[:][:]
	var win, r, tex
	sdl.init(sdl.INIT_VIDEO)
	win = sdl.mkwin(("chip\0" : byte#),


@@ 112,8 112,12 @@ const main = {
	var sound : uint8 = 0
	var keys

	if args.len != 2
		std.fatal("usage: {} [ROM]\n", args[0])
	;;

	clrscr(&gfx, scrsz)
	loadprg(&mem, "/tmp/UFO")
	loadprg(&mem, args[1])
	loadfnt(&mem)

	var opcode, arg