It is currently Wed Oct 17, 2018 7:29 am

All times are UTC - 7 hours





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

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Second topic

"I want to see Chip-8 on NES so that I can extend an emulator stack one higher. Imagine Chip-8 emulator in PocketNES in VisualBoyAdvance GX in Dolphin in Wine in Virtual PC or VMware." - tepples

2 of the main problems I can think of are:
1) Screen resolution- Easy to solve, just have 16 tiles with all possible values of 4 bits to simulate 4x4 tiles

2) Memory- Without expansion RAM, the NES only has 2KB of RAM and CHIP-8 has 4KB. However, we can get an extra kilobyte from the unused nametable, and almost 512 bytes from the fact that some of the main nametable is unused. We can solve the garbage data with forced blanking (timed with sprite 0 hits and timed code) and get more time to read and write to the to the PPU midframe and use OAM memory (disabling sprites) or attribute tables (duplicating palettes) for the rest. Hopefully this will give us 3.5 KB, and 512 bytes are reserved for the interpreter on CHIP-8 so that should be enough. I haven't worked out the numbers so I may be wrong. We can get more memory for the interpreter by duplicating tiles 16 times, so we can used the unused 4 bits to get more RAM for the interpreter. We only need to emulate 9 cycles per frame (540Hz), so there should be enough time.

Thoughts?


Last edited by orlaisadog on Sun Jul 15, 2018 4:51 am, edited 10 times in total.

Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 9:25 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Another problem:
3) Input- The CHIP-8 (or is Chip-8?) has a 16-key hex keyboard whereas the NES controller only has 8 buttons. An obvious solution would be to have a screen for mapping NES controller buttons to CHIP-8 keys, or use 2 controllers. Another way would be to use button combinations or modifier button (if NES A is pressed, NES B means CHIP-8 5, but otherwise it means CHIP-8 F).


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 9:34 am 
Offline
User avatar

Joined: Fri Feb 27, 2009 2:35 pm
Posts: 294
Location: Fort Wayne, Indiana
I can't seem to find information about it (maybe the original pages are gone?), but a long time ago I remember reading about a CHIP-8 emulator for the Vectrex, which has even less RAM, and it ran into the lack of memory problem too.

The author of that emulator made the realization that most games treat most of the address space as read-only, aside from some games like the Pac-Man clone (Blinky), and you could put the addresses actually treated as RAM in RAM while the rest went in ROM. That requires looking at how each game works, but CHIP-8 games are so simple that it's probably not very hard.

Edit: found some information on that via Internet Archive, though it's mostly just confirming what I remembered


Last edited by NovaSquirrel on Sat Jul 14, 2018 9:42 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 9:37 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10894
Location: Rio de Janeiro - Brazil
This convoluted RAM layout is not something I'd feel comfortable working around... I'd much rather just add extra RAM to the cartridge and have a nice contiguous block of memory that can be used without special tricks.


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 9:40 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
NovaSquirrel wrote:
treat most of the address space as read-only

But that wouldn't be completely accurate and is less fun.

Tokumaru, again for fun. I suppose it would help with a competition, too?


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 10:41 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Is anyone interested in making this? I don't have enough experience yet- I know a lot about how the NES works in theory from browsing the forums but can't do much assembly. I could do it myself one day, probably.


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 11:20 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10894
Location: Rio de Janeiro - Brazil
I have considered making a CHIP-8 emulator for the NES many times, but the lack of interesting CHIP-8 games to play ends up discouraging me. Most of the games look too glitchy to be fun, IMO. If there was a cool platformer with smooth physics for the CHIP-8, I'd feel much more compelled to write an emulator. The original CHIP-8 looks fairly easy to implement, but I definitely wouldn't use this absurd memory layout, I'd just use extra RAM.


Last edited by tokumaru on Sat Jul 14, 2018 11:22 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 11:21 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20661
Location: NE Indiana, USA (NTSC)
That's sort of what I was interested in. Is there a well-known repository of CHIP-8 games distributed as free software with which to test an emulator?


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 11:27 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Quote:
Doing things like this in a machine you KNOW can handle it is not fun, it's just convenient. The fun is all about trying the unusual. Emulating a GB on the NES is not about the goal (playing Game Boy games), but the means (NES simulating another machine).
- tokumaru


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 11:28 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Also, I found this: https://github.com/dmatlack/chip8/tree/master/roms


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 11:30 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Sorry for all of the short posts but will most CHIP-8 games work well with overscan? Also why not make a Mario game? Would it work? I could try to learn to make it. Would it be possible to make music with the single-pitched beep? How does it work with 9 cycles per frame?


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 12:08 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10894
Location: Rio de Janeiro - Brazil
orlaisadog wrote:
Quote:
Doing things like this in a machine you KNOW can handle it is not fun, it's just convenient. The fun is all about trying the unusual. Emulating a GB on the NES is not about the goal (playing Game Boy games), but the means (NES simulating another machine).
- tokumaru

Haha OK, an emulator running on the NES is already novel enough, I don't see why avoid using something that was common back in the day (extra RAM) and make the development significantly harder or even impossible, since even all the sacrifices won't get you all the RAM you need. Remember that you don't need just the RAM for the CHIP-8 program, the emulator itself will need a decent amount of RAM to function.

orlaisadog wrote:
How does it work with 9 cycles per frame?

I don't get what you mean by 9 cycles per frame... 540Hz aren't enough to do anything that vaguely resembles a game... Where did you get that number from?

EDIT: OK, I've seen this 540Hz figure thrown around, but I really don't get how that relates to clock speed.


Top
 Profile  
 
PostPosted: Sat Jul 14, 2018 12:26 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
tokumaru wrote:
orlaisadog wrote:
Quote:
Doing things like this in a machine you KNOW can handle it is not fun, it's just convenient. The fun is all about trying the unusual. Emulating a GB on the NES is not about the goal (playing Game Boy games), but the means (NES simulating another machine).
- tokumaru

Haha OK, an emulator running on the NES is already novel enough, I don't see why avoid using something that was common back in the day (extra RAM) and make the development significantly harder or even impossible, since even all the sacrifices won't get you all the RAM you need. Remember that you don't need just the RAM for the CHIP-8 program, the emulator itself will need a decent amount of RAM to function.

orlaisadog wrote:
How does it work with 9 cycles per frame?

I don't get what you mean by 9 cycles per frame... 540Hz aren't enough to do anything that vaguely resembles a game... Where did you get that number from?

EDIT: OK, I've seen this 540Hz figure thrown around, but I really don't get how that relates to clock speed.


Here. How much should it be? As fast as we can?



P.S. I'm saying "we" because someone else may do it


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

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


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

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
tokumaru wrote:
Haha OK, an emulator running on the NES is already novel enough, I don't see why avoid using something that was common back in the day (extra RAM) and make the development significantly harder or even impossible, since even all the sacrifices won't get you all the RAM you need. Remember that you don't need just the RAM for the CHIP-8 program, the emulator itself will need a decent amount of RAM to function.

As I explained you can get 3.5KB, and at least an extra 256 from 4 bits of the tile data and maybe more from OAM. I just realised that attribute data is not extra data as it is included in the name table RAM. Anyway it's fun, cheaper to make a cartridge out of and more impressive that way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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