Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: njaddison on November 10, 2011, 12:21:04 am

Title: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: njaddison on November 10, 2011, 12:21:04 am
hey guys i was thinking that we could remake some nes games for the the nspire, using lua, and then make an nes emulator in lua to play the games with. the prob is, somehow, i would have to find a way to give the emulator access to the files on the nspires ram, which i haven't learned how to do.
well, i have all of these nes games on my computer, and i can't play them because my nes emulator isn't compatible with computers without flash player. please help! javascript:void(0);
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: DJ Omnimaga on November 10, 2011, 12:32:48 am
Well there's already a NES emu for the Nspire on ticalc.org. It's called NESpire (there's also a topic here in this forum section if you use the search function). It requires Ndless, though. I don't think a NES emulator in Lua is possible, due to speed reasons.

Also I would recommend not using caps-lock titles. :P
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Yeong on November 10, 2011, 06:55:24 am
hey guys i was thinking that we could remake some nes games for the the nspire, using lua, and then make an nes emulator in lua to play the games with. the prob is, somehow, i would have to find a way to give the emulator access to the files on the nspires ram, which i haven't learned how to do.
well, i have all of these nes games on my computer, and i can't play them because my nes emulator isn't compatible with computers without flash player. please help! javascript:void(0);
Also, it would be really slow if we emulate NES with Lua O.o
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Jim Bauwens on November 10, 2011, 07:09:11 am
Yes, NES would be definitely too slow (not that its not possible).
But there are some older atari machines that *might* be possible to be emulated in Lua, but someone will have to spend allot of time working on it.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: TIfanx1999 on November 10, 2011, 10:25:05 am
Unfortunately, I highly doubt even that is possible in Lua. Apparently even emulating the Atari 2600 is fairly complicated. Lua just isn't up for heavy lifting like Emulation.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Jim Bauwens on November 10, 2011, 10:30:49 am
Well, I think I would be able to create one of the first machines. I've checked some info and looked at specs, and I think its possible :)
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: TIfanx1999 on November 10, 2011, 10:36:34 am
Are there others before the 2600 series? That's the earliest I remember. I'd like to see what Atari was working on before that. It had to have been really simplistic. Do you have links? :D
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Goplat on November 10, 2011, 12:35:00 pm
Let's compare Lua to Javascript: People have written NES emulators in Javascript (http://fir.sh/projects/jsnes/), and they are slow even on a modern PC. The TI-Nspire has a much slower processor than a PC, and Lua is even less suited for emulation than Javascript; it not only has the big problem of not having typed variables (any variable in JS or Lua can point to an object of any type, so the runtime has to do a type check on every operation), but also doesn't even seem to have bitwise operators (which are used extensively in emulators and are inefficient to build out of other operators).
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Yeong on November 10, 2011, 12:54:50 pm
I guess we have to wait until ndless 3 ;)
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Jim Bauwens on November 10, 2011, 01:19:06 pm
@AOC, I'm sorry, the 2600 was the first one they released, didn't look good enough. The 6502 processor is pretty easy to emulate, but I also just realized that I can't have a good clock in Lua, the fastest I would have would be 100Hz :(

@goplat, I know bitwise operators are issue's, but I can try to optimize them in bytecode (yes, the nspire can run bytecode).

Anyway, its hard, but I *think* that you can emulate some old devices with Lua. I know that there is a gameboy emulator written in Lua, but thats for a PC (its a mod for a game).
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Hot_Dog on November 10, 2011, 01:49:48 pm
From what I've heard, Lua isn't even good for smooth-scrolling tilemapping
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Goplat on November 10, 2011, 02:03:49 pm
@AOC, I'm sorry, the 2600 was the first one they released, didn't look good enough. The 6502 processor is pretty easy to emulate, but I also just realized that I can't have a good clock in Lua, the fastest I would have would be 100Hz :(
Most emulators only synchronize emulated time with real time once per frame; 60Hz suffices for that.

The real problem is that Lua just wouldn't be fast enough to run 1/60 second of emulated time in less than 1/60 second of real time.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Jim Bauwens on November 11, 2011, 07:54:35 am
From what I've heard, Lua isn't even good for smooth-scrolling tilemapping
The image drawing function is a bit slow, but it is possible to create smooth-scrolling graphics. And this will also improve in future OS updates.

Most emulators only synchronize emulated time with real time once per frame; 60Hz suffices for that.

The real problem is that Lua just wouldn't be fast enough to run 1/60 second of emulated time in less than 1/60 second of real time.
Ah, didn't think about that. Well, I guess I'll look into older devices to emulate.

Thanks for the info :)
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: TIfanx1999 on November 11, 2011, 08:14:46 am
@AOC, I'm sorry, the 2600 was the first one they released, didn't look good enough. The 6502 processor is pretty easy to emulate, but I also just realized that I can't have a good clock in Lua, the fastest I would have would be 100Hz :(

@goplat, I know bitwise operators are issue's, but I can try to optimize them in bytecode (yes, the nspire can run bytecode).

Anyway, its hard, but I *think* that you can emulate some old devices with Lua. I know that there is a gameboy emulator written in Lua, but thats for a PC (its a mod for a game).

Yea, I thought the 2600 was the first. Like I said, emulation with lua would have to be a really simplistic device.

PC lua also has access to more instructions doesn't it? Not to mention a much faster processor.

That being said, I'd love to see proof of concept emulating a really simplistic device in Nspire lua. :) It's always cool to see boundaries pushed.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: BrownyTCat on November 11, 2011, 01:20:03 pm
I remember when I suggested this last year and then it turned out it was being done. The result was a genius program resulting in hours upon hours of fun.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: DJ Omnimaga on November 11, 2011, 08:45:32 pm
Let's compare Lua to Javascript: People have written NES emulators in Javascript (http://fir.sh/projects/jsnes/), and they are slow even on a modern PC. The TI-Nspire has a much slower processor than a PC, and Lua is even less suited for emulation than Javascript; it not only has the big problem of not having typed variables (any variable in JS or Lua can point to an object of any type, so the runtime has to do a type check on every operation), but also doesn't even seem to have bitwise operators (which are used extensively in emulators and are inefficient to build out of other operators).
Not to mention Lua is in constant danger of seeing functions removed in future OS versions (like what happened to sound in OS 3.1.0)
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Keoni29 on November 13, 2011, 10:22:56 am
Make a pong console emulator!
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Goplat on November 13, 2011, 01:45:13 pm
The 1970s pong consoles weren't programmable; everything was done in hardware. So "emulating" one would just mean writing a pong game. :p
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: annoyingcalc on November 13, 2011, 01:48:30 pm
yep but I want castlevania and smb3 on my nspire CX!!!!!!!!!!!!!!!1
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: mrmprog on November 13, 2011, 02:04:35 pm
yep but I want castlevania and smb3 on my nspire CX!!!!!!!!!!!!!!!1
Solution: Code them :)

Also, it may be a good idea to change the title, because it implies that an emulator was already made.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: DJ Omnimaga on November 13, 2011, 02:43:16 pm
True. Anyway the NES emu will most likely arrive on the CX after Ndless 3.0 did.
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Jim Bauwens on November 29, 2011, 07:10:53 am
Not to mention Lua is in constant danger of seeing functions removed in future OS versions (like what happened to sound in OS 3.1.0)
I don't think they are going to remove any more functions like this though, but rather add new cool stuff ;)
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: Yeong on November 29, 2011, 08:27:09 am
Not to mention Lua is in constant danger of seeing functions removed in future OS versions (like what happened to sound in OS 3.1.0)
I don't think they are going to remove any more functions like this though, but rather add new cool stuff ;)
I hope so. ;D
Title: Re: NES EMMULLLATOR (FOR NSPIRE!)!
Post by: DJ Omnimaga on December 25, 2011, 10:15:44 pm
Yeah me too. I was just worried because of new OSes already removing stuff. But again, that stuff wasn't documented.