So this is the third program I've created on my new calculator, but my first time releasing one! I wanted to make a CHIP-8 emulator/interpreter so I can play really small games and also brag about how I made an emulator on a calculator.

All of the opcodes are implemented and should function correctly, and I even made a Windows program to convert .c8 ROMs into .8xv files. Now you can play a flickery game of Pong or Tetris right on your calculator!

The controls are the bottom-most 16 white keys (0, ., -, ENTER, ..., TIMES).

A .zip file of the emulator and converter is below.




Download here
This looks pretty awesome! Looking through the assembly source though it seems that there is a rather large zero-initialized buffer in the data section which appears to be inflating the file size, you might be able to reduce that by storing it in the bss. Great work though; would you mind putting the C source also on Github? Keep it up Smile

Also, welcome to Cemetech!
MateoConLechuga wrote:
This looks pretty awesome! Looking through the assembly source though it seems that there is a rather large zero-initialized buffer in the data section which appears to be inflating the file size, you might be able to reduce that by storing it in the bss. Great work though; would you mind putting the C source also on Github? Keep it up Smile

Also, welcome to Cemetech!

Thank you! Alright the source is here now and I think that was from a blank 64x32 sprite initialized with 2048 0's which really did take up a lot of space, so I fixed that also. Very Happy
Wow this is very cool!
Questions:
  • The emulator seems kind of slow for some games would that be because of the game just being really complex or the emulator throttling to keep speeds realistic to the Chip 8? If it's the latter, could you include an in-game option to turn throttling on and off?


Suggestions:
  • When you quit a game, could you have it return to the Chip 84 main screen rather than quitting the program completely? I'm running the emulator through Cesium which allows me to backup my files before running a program in case of a RAM clear. It's sort of inconvenient to keep waiting for Cesium to back up my calculator before running the program every time I want to switch a game. Smile Another solution could be to add a restart button which will (obviously) restart the game from the beginning.
  • With some games the controls are completely messed up and really hard to use. Such as pac-man, I needed to use 1 and 2 to go left and right (not too bad) but then I needed to use 3 and 9 (or something like that) to go up and down. Also tanks, the controls are ok for it, but the up and down keys are reversed which makes game play kind of difficult. Can there be and option to remap the keys for some games?
  • While on the main menu, could you add constant scroll support so if I want to reach program 20 I can just hold down the arrow key rather than pressing it 20 times? #I'mTotalyNotLazy
  • This one isn't very crucial but could you allow us to change the background color when emulating? I like the color you chose but customization is always welcome Very Happy


Great work on this program, it's really fun!
For a bit of a speed boost, rather than doing this:


Code:
gfx_ScaleSprite(canvas, scaled_sprite);
gfx_Sprite(scaled_sprite, 30, 55);


Simply do:


Code:
gfx_ScaledSprite_NoClip(canvas, 30, 55, 4, 4);


This should help quite a bit, plus you can remove scaled_sprite.
TheLastMillennial wrote:
Wow this is very cool!
Questions:
  • The emulator seems kind of slow ...


Suggestions:
  • When you quit a game, could you have it return to the Chip 84 main screen rather than quitting the program completely? ...
  • With some games the controls are completely messed up and really hard to use. ...
  • While on the main menu, could you add constant scroll support so if I want to reach program 20 I can just hold down the arrow key rather than pressing it 20 times? ...


Great work on this program, it's really fun!

Alright, for v1.1 I implemented a keymapper, a better scrolling system, a pause menu, an option to change the amount of cycles per frame, fixed some controls, and made the overall thing faster thanks to @MateoConLechuga's amazingly effective suggestion! All you need to do to do is re-convert your .c8 files for the keymapper. (Same Google Drive download link)
This emulator is coming along nicely! Very Happy So, I'm curious. What are the other two programs you've created on your calculator?

Edited (cuz I dont want to double post):
Was the formatting changed in the new version? Confused I had to re-convert all my roms again.
Wow I'm impressed you added key remapping, thank you! It seems flipped though, when I click '8' it sets the key to '2' and so on. The 4,5,6,- keys work properly. This could be related to the flipped keys, but not all of them seem to work, they just don't do anything when I press them but the original keys work.
A small bug, when you press [2nd] then you quit a program, then you select it or a differnt one, the game starts with the pause menu. (suggestion: Could you please make it start unpaused?) when I unpause it, the 'pping' part of 'Keymapping' isn't erased.

Two more suggestions: with your .exe converter, could you have it set the converted app var to be stored into the Archive memory instead of the RAM? I don't want to lose everything if my calculator crashes. Smile
Also, could you include a search function? Could I just type in a number and it would jump to that programs location?

Thanks for including all those recommendations so quickly, I really appreciate it!
Is the source for the converter available? I'd like to build it in linux if possible Smile Nice work implementing the things!
NoaxPrime wrote:
This emulator is coming along nicely! Very Happy So, I'm curious. What are the other two programs you've created on your calculator?

Edited (cuz I dont want to double post):
Was the formatting changed in the new version? Confused I had to re-convert all my roms again.

The first one I made was a like 4-level platformer to try out the C libraries. I even made a tilemap editor for it in Java. The second one was a 3D wireframe cube to see how that would run on the calculator.

And yeah, I had to add an extra 16 bytes to the ROM to allow for keymapping.

TheLastMillennial wrote:
Wow I'm impressed you added key remapping, thank you! It seems flipped though, when I click '8' it sets the key to '2' and so on. The 4,5,6,- keys work properly. This could be related to the flipped keys, but not all of them seem to work, they just don't do anything when I press them but the original keys work.
A small bug, when you press [2nd] then you quit a program, then you select it or a differnt one, the game starts with the pause menu. (suggestion: Could you please make it start unpaused?) when I unpause it, the 'pping' part of 'Keymapping' isn't erased.

Two more suggestions: with your .exe converter, could you have it set the converted app var to be stored into the Archive memory instead of the RAM? I don't want to lose everything if my calculator crashes. Smile
Also, could you include a search function? Could I just type in a number and it would jump to that programs location?

Thanks for including all those recommendations so quickly, I really appreciate it!

Yeah, the keymapping is not very user-friendly at all because I'm going off of the original Chip-8 keyboard layout, but I'll add strings to match the correct keys later haha. I also fixed the pause thing and the pping thing in version 1.1.1 which is on Github but not on this website. I'll see what I can do with archiving ROMs too.

MateoConLechuga wrote:
Is the source for the converter available? I'd like to build it in linux if possible Smile Nice work implementing the things!

Here's the source, I wrote it in C# because I know that better than C or C++ to be honest∠ Razz And thanks!
ckosmic wrote:
The first one I made was a like 4-level platformer to try out the C libraries. I even made a tilemap editor for it in Java.


I think that would be a cool one to see released! Maybe you could work more on it? (I'd really like to see it!)


ckosmic wrote:
And yeah, I had to add an extra 16 bytes to the ROM to allow for keymapping.


Oh. Razz
Version 2.0.0 is here bringing Super Chip-8 support!
This means you can now run programs that use the extended 128x64 display and additional instructions. Most of the SCHIP8 ROMs also seem to run faster and better than original CHIP8 ROMs. I also made some small UI changes. Anyway, here are some screenshots of it in action:




Download here
Versions 2.0.1-2.1.0 fixes and adds a whole lot of things, yay! Such as incorrect Super Chip-8 instructions (SCD, SCL, SCR), UI issues, sprite drawing issues, inaccurate timers and more. This means Chip-84 is getting really close to being an accurate interpreter (by accurate I mean Octo level accurate)! The cycles per frame was raised to 50 and now a nice new live preview screen is shown on the side of each game on the main menu.
Download 2.1.0 here!

That is totally awesome. Keep up the good work! Very Happy

Do you have any other ideas on things to add?
MateoConLechuga wrote:
That is totally awesome. Keep up the good work! Very Happy

Do you have any other ideas on things to add?


Thank you very much! Smile At some point I could add save states (if it's even worth putting in since they're such small games), custom LCD colors, and other CHIP-8 Extensions.
Great job Smile
2.2.1 arrives bringing an all new UI on the ROM selection screen and pause menu. It's kind of a mix between TI-Boy CE's menu and the new iOS app layout and is way easier to use and nicer to look at. This also fixes collision behavior and improves accuracy.

New UI:


The second screenshot is of a game I made for CHIP-8, check it out! Very Happy
Looks like someone forgot to add a limit to the CPF, when you go over 99 they're some visual glitches. Other than that, I love the new update so far! The game seems pretty cool too!
Very nice! Now all we need are custom lcd colors haha. Keep up the good work! Smile
TheLastMillennial wrote:
Looks like someone forgot to add a limit to the CPF, when you go over 99 they're some visual glitches.!

Lol whoops, it's fixed now hahaha.

MateoConLechuga wrote:
Very nice! Now all we need are custom lcd colors haha. Keep up the good work! Smile

Thank you! Well I just added that and also a settings AppVar to save those settings.

  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement