Jump to content
IGNORED

Chip8 emulator version 1.0


pirx

Recommended Posts

Hard to say - different emulators run at different speeds... But games seem to be perfectly playable. I think there is still a bit of a delay loop in the code, because Blinky_s was running too fast (?)

And the whole thing is absolutely sub-optimal and can be sped up significantly, maybe not 2x, but 50% is doable I guess.

Edited by pirx
  • Like 2
Link to comment
Share on other sites

On 5/3/2023 at 1:30 AM, pirx said:

Hard to say - different emulators run at different speeds... But games seem to be perfectly playable. I think there is still a bit of a delay loop in the code, because Blinky_s was running too fast (?)

And the whole thing is absolutely sub-optimal and can be sped up significantly, maybe not 2x, but 50% is doable I guess.

 

There is a delay loop in the code that can be disabled by pressing the START console key. When pressing START, the interpreter runs at full speed (usually way to fast).

 

There is also a "speed" configuration option for each CHIP-8 program in the CHIP8.CFG textfile.

Link to comment
Share on other sites

@pirx Do you still have older versions of Chip-8 emulator, e.g. beta-version (no number, dated January-9-2006) and/or version 1.0 (dated January-14-2006) ?!?

 

While Chip-8 programs use extender *.CH8, Super-Chip-8 programs use extender *.SC8. But it looks like your emulator only accepts extender *.CH8 and therefore all *.SC8 programs have to be renamed atm. Maybe you can change this and support both extenders ? Besides, on the webpage above, there are also programs with extenders HC8, XO8 and others, maybe for an enhanced Chip-8 ? Would be great if you could also emulate these...

 

  • Like 2
Link to comment
Share on other sites

15 minutes ago, CharlieChaplin said:

@pirx Do you still have older versions of Chip-8 emulator, e.g. beta-version (no number, dated January-9-2006) and/or version 1.0 (dated January-14-2006) ?!?

 

While Chip-8 programs use extender *.CH8, Super-Chip-8 programs use extender *.SC8. But it looks like your emulator only accepts extender *.CH8 and therefore all *.SC8 programs have to be renamed atm. Maybe you can change this and support both extenders ? Besides, on the webpage above, there are also programs with extenders HC8, XO8 and others, maybe for an enhanced Chip-8 ? Would be great if you could also emulate these...

 

 

Hi Andreas,

 

you're going ahead quick. Maybe wait for part 2 of my article series, that will explain the other extenders and if and how they can be done on the A8.

 

  • Like 1
Link to comment
Share on other sites

@CharlieChaplin @cas I am very happy my old old piece of code was finally discovered :)

I think I could rather easily change the extension from "CH8" to "??8", it would work with both SC8 and CH8 files. I think there is some kind of identification in the file or config file to discern types of emulation. 

HC8, XO8 -- I'd have to dive in.

 

After a previous ping I had this idea of refreshing the project by redoing it in mads. it compiles now, but fails, so debugging :(

i also have a very nice fileselector from Drac030, so the new version should work with more than 64 files (under sparta/bewe).

not much time right now - the real world(tm) attacks hard, but i'll get to this.

 

Link to comment
Share on other sites

7 hours ago, pirx said:

@CharlieChaplin @cas I am very happy my old old piece of code was finally discovered :)

I think I could rather easily change the extension from "CH8" to "??8", it would work with both SC8 and CH8 files. I think there is some kind of identification in the file or config file to discern types of emulation. 

HC8, XO8 -- I'd have to dive in.

 

After a previous ping I had this idea of refreshing the project by redoing it in mads. it compiles now, but fails, so debugging :(

i also have a very nice fileselector from Drac030, so the new version should work with more than 64 files (under sparta/bewe).

not much time right now - the real world(tm) attacks hard, but i'll get to this.

 

 

I"m happy to help hacking on the CHIP-8 code, but I also have work and family, and an Atari club to run :) - so time is in short supply

 

This page:

 

CHIP-8 extensions and compatibility https://chip-8.github.io/extensions/

 

has a good overview of all CHIP-8 variants and extensions.

 

XO8 would require a fair redesign, as it supports 64KB of RAM (some kind of extended memory paging required), high resolution, multi color and multiple display planes.

 

HC8 is probably "HI-RES CHIP-8 (four-page display)Permalink", which is a variation of SCHIP, that should be possible without too much work.

 

Most CHIP-8 extensions are backwards compatible (like CHIP-8 and SCHIP), so there is no technical need to have an identification.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I heard about this through the Antic podcast (Antic - Atari Dreams). Interesting. How come I hadn't heard of Chip-8 before this? I got interested, because I've worked on what I call a "Parr VM" for the Atari 8-bit, in Turbo Basic (after Terence Parr's demo of a simple VM: How to Build a Virtual Machine). I got that working, and I've been working on an assembler for it (again in TB). I've really just been using this as a learning exercise, since I'm new to these concepts.

 

I like Weisbecker's philosophy (from his Byte article: An Easy Programming System):

 

Quote

This programming approach isn't new, but surprisingly few people seem to be using it. The technique consists of using a high-level pseudomachine language that is more powerful for specific applications than conventional machine language.

Looking at one of the comments from Parr's presentation, it seems that Don Knuth had a similar idea, with "The Art of Computer Programming"? I've looked this up. The descriptions have said that Knuth discussed algorithms in his own machine language, but haven't said anything about source code for a VM. Maybe that's assumed? Anyway, the commenter said that this method is a lost art in software engineering. Sounds right, since I haven't seen it used much. The most famous example of it being used that I've seen is the ZIL VM/language for Infocom games.

  • Like 1
Link to comment
Share on other sites

4 hours ago, markmiller said:

Looking at one of the comments from Parr's presentation, it seems that Don Knuth had a similar idea, with "The Art of Computer Programming"? I've looked this up. The descriptions have said that Knuth discussed algorithms in his own machine language, but haven't said anything about source code for a VM. Maybe that's assumed?

 

This might be referring to the MIX/MMIX CPU architecture from Knuth:

 

https://mmix.cs.hm.edu/

 

https://en.wikipedia.org/wiki/MMIX

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
5 hours ago, pirx said:

@cas I've heard there is a nice article about chip-8 in the latest ABBUC magazine - could you share the highlights or a scan with me - I'll have an excuse to use a bit of my long-neglected Deutsch!  

cas is offline this week but you have a PM.

  • Thanks 1
Link to comment
Share on other sites

16 hours ago, pirx said:

@cas I've heard there is a nice article about chip-8 in the latest ABBUC magazine - could you share the highlights or a scan with me - I'll have an excuse to use a bit of my long-neglected Deutsch!  

 

Well, if you visit the Silly Venture you will receive a nice special edition of the Abbuc paper supplement with this article (and many others) in english...

Link to comment
Share on other sites

  • 3 weeks later...
On 7/28/2023 at 4:31 AM, pirx said:

@cas I've heard there is a nice article about chip-8 in the latest ABBUC magazine - could you share the highlights or a scan with me - I'll have an excuse to use a bit of my long-neglected Deutsch!  

Sorry for the delay, I was on vacation.

 

Please find attached the English version of the article that is in the special edition of ABBUC Magazine for the SillyVenture Party starting in GDansk today.

 

I'm writing on an follow-up article on how to do CHIP-8 Programming. For that, I plan to write a simple CHIP-8 Assembler for the A8, but it will also explain assembler on the PC as well as OCTO.

 

I will also post the original German article here soon.

ABBUC_Magazin_Special-Edition-en-SV2023-CHIP-8.pdf

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

I've written a (quick and dirty) CHIP-8 Assembler for the A8

 

https://github.com/cstrotm/ch8asm

 

It's the first version, and it has limitations

  • it's currently underdocumented
  • it uses it's own memnonics (postfix notation)
  • not well tested (but it assembles the three test source files contained in the repo)
  • only CHIP-8 commands for now (no SCHIP-8 or other extensions - planned for a later version)
  • should be restarted (reloaded) after one assembly run (it does not reset)

It's written on top of VolksForth. I considered C and some of the new languages around, but nothing beats Forth when implementing a simple assembler. It just took 3 hours (one evening) to code. It took more time to debug the CHIP-8 example programs ;)

 

If you have questions or want more features, let me know.

  • Like 6
Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...