Jump to content
Sign in to follow this  
nanochess

CP1600 instructions tester

Recommended Posts

Posted (edited)

Hi all.

 

I was deep into doing a STIC rewrite for FreeIntv (a libretro Intellivision emulator for using with Retroarch), and after correcting it, I keep wondering if all the instructions of the processor were emulated correctly.

 

So I wrote an instruction tester using the state-of-art jzintv emulator from @intvnut as reference.

 

And indeed I found one bug exactly in the Mar, 22 2021 release (I thought there were two bugs, because the comparison done for Overflow flag on SUB). The rare case of using SDBD with register R1-R3 should load the second byte from the same address, instead FreeIntv loaded the upper byte from the next address. I wonder if some classic game uses it.

 

I've already made the pull request for the patch for FreeIntv (with the corrected STIC scrolling).

 

I hope this is useful for someone out there that could be writing another Intellivision emulator.

 

And BTW I would like to know if it can run over a real Intellivision. I'm being lazy to take out my Intellivision :grin:

 

Enjoy it!

 

 

1tester-210505-152821.png

tester.asm tester.rom

Edited by nanochess
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

*Hmm... should I risk blowing up my Intellivision I console?*

  • Haha 1

Share this post


Link to post
Share on other sites

The buggy freeintv core served me well when I was earning all the retroachievements in Astrosmash.  It seems the collision bits don't clear right away, so there were periods where objects were destroying themselves as fast as they appered.  I was thankful for small favors that day.

 

Is there still screen flickering when scrolling, or has that been fixed as well?

Share this post


Link to post
Share on other sites

Just tested.  There's no earth shattering KABOOM.  Instead it has Good 117 Bad 000

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)
5 hours ago, Zendocon said:

The buggy freeintv core served me well when I was earning all the retroachievements in Astrosmash.  It seems the collision bits don't clear right away, so there were periods where objects were destroying themselves as fast as they appered.  I was thankful for small favors that day.

 

Is there still screen flickering when scrolling, or has that been fixed as well?

I've corrected the scrolling flicker.

 

I need to test Astrosmash out of curiosity.

Edit: just saw the collision is still buggy.

Edit2: Just corrected the STIC collision for Astrosmash.

 

 

Edited by nanochess
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Today I corrected the B17 Bomber crash in FreeIntv, I was pretty surprised by the bug, it simply quit from the emulator.

 

It took me 6 hours to figure that I should put a simple debugging function writing to a file inside the main function to see if the crash was inside FreeIntv or Retroarch. To my complete surprise it was inside FreeIntv and it was a HLT instruction, but alas it was an instruction number higher than 0x0400, so I discovered somehow B17 Bomber manages to overwrite the EXEC after half a second of running. The bug was solved by protecting the EXEC ROM space.

 

Also I made a small optimization for speed in the STIC routines and noticed the 8x16 sprites had card number incorrectly adjusted, so it would have allowed to use an odd card number. Now it sets correctly the card number to be an even number.

 

If you are curious enough to see what I've done, you can see my current progress here: https://github.com/nanochess/FreeIntv

 

I've submitted a pull request to the main project here: https://github.com/libretro/FreeIntv

Edited by nanochess
  • Like 2

Share this post


Link to post
Share on other sites

Today corrected a pair of sound bugs. The AY-3-8910 counter were reset with each sound frequency change so it triggered bugs in Princess Quest music, while the noise generator LFSR was wrong.

 

And BTW my pull request has been approved! 8) This means that soon everyone using libretro cores will have a better Intellivision emulation :)

 

Share this post


Link to post
Share on other sites

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...