It is currently Mon Oct 15, 2018 12:03 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Sat Jul 14, 2018 1:47 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.

That's what I was saying. What is it then?


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 1:57 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10892
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 1:59 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.


CHIP-8 was designed for old computers with 4k of RAM, so...


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 2:06 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
That page wrote:
a function we can tick at 500Hz

So it is 500Hz?


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 2:31 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10892
Location: Rio de Janeiro - Brazil
I don't know, 500Hz sounds like too little, 500KHz sounds like too much... I have no idea.


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 2:35 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10892
Location: Rio de Janeiro - Brazil
I think there are more CHIP-8 emulators out there than CHIP-8 games!


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 12:27 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10892
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 1:07 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.

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).


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 1:44 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10892
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 2:17 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.

It could end up variable. If we can put the most-used variables in non-PPU RAM it could give a speed boost.
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?


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 2:57 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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?


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 6:06 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1782
Location: Gothenburg, Sweden
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)

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 6:10 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20656
Location: NE Indiana, USA (NTSC)
Unless it's like PocketNES for Game Boy Advance, where you choose a bunch of NES ROMs when you build a GBA ROM.


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 6:45 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.


Top
 Profile  
 
PostPosted: Sun Jul 15, 2018 7:01 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.
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.


Attachments:
asm.png
asm.png [ 91.7 KiB | Viewed 314 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group