That's what I was saying. What is it then?tokumaru wrote:Yeah, I've seen the number being mentioned, but I'm not sure what it means. It definitely isn't CPU cycles as we're used to measuring on the NES, because 540 instructions per second (assuming each instruction is one cycle) isn't nearly enough to make a game with any sort of real time interaction.
[IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RAM)
Moderator: Moderators
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
In this page someone mentions using a clock speed between 500Hz and 1MHz, which doesn't sound right, so maybe they actually mean KHz rather than Hz? If that's really the case, then we might be in trouble... 9000 instructions per frame really wouldn't be possible.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
CHIP-8 was designed for old computers with 4k of RAM, so...tokumaru wrote:In this page someone mentions using a clock speed between 500Hz and 1MHz, which doesn't sound right, so maybe they actually mean KHz rather than Hz? If that's really the case, then we might be in trouble... 9000 instructions per frame really wouldn't be possible.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
So it is 500Hz?That page wrote:a function we can tick at 500Hz
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
I don't know, 500Hz sounds like too little, 500KHz sounds like too much... I have no idea.
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
I think there are more CHIP-8 emulators out there than CHIP-8 games!
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
I've been reading about the CHIP-8 and it does seem like games can run at fairly slow speeds... This is an emulator that lets you select the number of cycles per frame, starting at 7 and going all the way up to 1000. That seems very doable on the NES, which could probably even handle an SCHIP implementation.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
1000? OK, I found out that there are 29780.5 CPU cycles per frame. That's about 30 cycles for 1 cycle, or about 15 the way I'm thinking because there can't be PPU memory access in rendering time. Is that enough? I don't know much assembly, either CHIP-8 (none at all) or NES (a tiny bit).tokumaru wrote:I've been reading about the CHIP-8 and it does seem like games can run at fairly slow speeds... This is an emulator that lets you select the number of cycles per frame, starting at 7 and going all the way up to 1000. That seems very doable on the NES, which could probably even handle an SCHIP implementation.
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
1000 would be too much for the NES to handle, because even though many of the operations are simple, you still have to fetch the instruction, decode it, update the VM state, and so on, for every instruction. Also, drawing sprites is a fairly slow process, since it involves bit shifting, bitwise operations, and even more operations to check if any pixels were erased, all of this between several bytes, but the whole thing still consumes 1 cycle, apparently.
Most examples on that page work fine at 100 cycles per frame though, or even less, and that's fairly realistic for a possible NES version. That should be made configurable on the NES as well, IMO.
Most examples on that page work fine at 100 cycles per frame though, or even less, and that's fairly realistic for a possible NES version. That should be made configurable on the NES as well, IMO.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
It could end up variable. If we can put the most-used variables in non-PPU RAM it could give a speed boost.tokumaru wrote:1000 would be too much for the NES to handle, because even though many of the operations are simple, you still have to fetch the instruction, decode it, update the VM state, and so on, for every instruction. Also, drawing sprites is a fairly slow process, since it involves bit shifting, bitwise operations, and even more operations to check if any pixels were erased, all of this between several bytes, but the whole thing still consumes 1 cycle, apparently.
Most examples on that page work fine at 100 cycles per frame though, or even less, and that's fairly realistic for a possible NES version. That should be made configurable on the NES as well, IMO.
Edit: As NovaSquirrel said, it would be possible to analyse the ROM to see what is never changed, but my RAM layout could act as a fallback?
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
I've just realised that OAM memory will decay if forced blanking is used. Could sprites be turned on occasionally during emulation to keep it refreshed or would there not be enough time?
Edit: Offtopic but I just read that the decay is affected by temperature. Could there be a NES thermometer?
Edit: Offtopic but I just read that the decay is affected by temperature. Could there be a NES thermometer?
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2064
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
For it to make any sense (to me) i think you need a method to enter s/chip-8 programs into the interpreter. That makes WRAM (battery backed?) all the more important.
you could either transfer the programs to RAM via an usb to nes port cable and an app on your pc, or it could work like family basic, complete with a suitable interface. Most likely something T9-inspired since keyboards aren't an option. 35 opcodes would be no match for a d-pad hexnumpad + action button.
https://en.wikipedia.org/wiki/T9_(predictive_text)
you could either transfer the programs to RAM via an usb to nes port cable and an app on your pc, or it could work like family basic, complete with a suitable interface. Most likely something T9-inspired since keyboards aren't an option. 35 opcodes would be no match for a d-pad hexnumpad + action button.
https://en.wikipedia.org/wiki/T9_(predictive_text)
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
Unless it's like PocketNES for Game Boy Advance, where you choose a bunch of NES ROMs when you build a GBA ROM.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
I thought it would be like PocketNES, maybe with a GUI with options on graphics (affects CHR ROM data so cannot be changed at runtime). However, an IDE would be interesting. It would probably need the Family BASIC keyboard though. Oh, I didn't read your post properly.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: [IDEA] CHIP-8 interpreter on NES? (NROM, no expansion RA
What about an assembler with the attached layout (I haven't made anything properly yet)? The categories come from https://en.wikipedia.org/wiki/CHIP-8 and the names from http://devernay.free.fr/hacks/chip8/C8TECH10.HTM. Start and select change the active category. These are listed on the left, and the active one is brighter. A graphics editor would also be possible. There would also be a PocketNES-like version with no save RAM. The labels would be named automatically but the names could be changed.FrankenGraphics wrote:Most likely something T9-inspired since keyboards aren't an option. 35 opcodes would be no match for a d-pad hexnumpad + action button.