Jump to content

Photo

StudioVision - An RCA Studio II emulator for the Intellivision


76 replies to this topic

#26 Keatah OFFLINE  

Keatah

    Missile Commander

  • 21,848 posts

Posted Mon Jan 2, 2017 7:44 PM

https://en.wikipedia.../Virtualization

Virtualization is more like isolation and protection, running the same native instructions as the hardware. With many iterations possible. Not unlike hyper-threading, where you have a virtual core and real one.

 

Emulation, in terms as we understand it, is running alien non-native code on something.

 

There is big potential here to get caught up in semantics so I suggest a new thread.



#27 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Tue Jan 3, 2017 1:28 AM

Ok, then I imagine it would work out. Actually the only two background colours I have encountered on my M1200 are dark blue (a little hard to obtain on the Intellivision, but regular blue would have to do) and dark green (which is one of the first 8 colours, it appears). Black for the B&W Studio II as already implemented. The foreground colours on the M1200 are black, red, medium blue, pink, slightly less dark green, yellow green, light blue and white, which I'm sure could be reasonably well mapped for this purpose.

 

Yes, with the restriction to one background colour I think this could be made to work without switching screen mode.  This possibility opens the artistic question, should it be done?  I think a part of the feel of StudioVision is the monochrome nature of the games.



#28 carlsson OFFLINE  

carlsson

    Metagalactic Mule

  • 8,456 posts
  • Location:Västerås, Sweden

Posted Tue Jan 3, 2017 2:08 AM

As a proof of concept, I think StudioVision is great as it is. As a service to a community of Intellivision users who fancy the idea to play clone versions of a never released, almost contemporary system that anyway would have bombed completely compared to the competition - in particular the Intellivision itself - you may still consider this as a future addition.



#29 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Tue Jan 3, 2017 2:43 AM

Yeah, I guess when I say "contemporary" I also think "vaguely hardware equivalent" - at least in terms of overall power. Obviously there's always been some level of emulation on high-end equipment going on (that's how they generally wrote software in the first place, before dev kits became commonplace). I'm sure someone could easily write an Intellivision emulator on a 1979-era mainframe - but I'm thinking an INTV emulator on a Colecovision, or similar.

 
I think this breaks down into two parts. If we assume that the host is Turing complete, I believe the only absolute constraint to emulating a target is having enough memory and / or backing store on the host to represent the full state of the target.  Even this constraint can be relaxed in some circumstances by using greater memory compression in the host than is present in the target.  Typically this ratio of required memory is close to 1:1 because the size of the target machine state is typically dominated by memory and backing store.  Other bits a pieces like registers are negligible.  You can artificially raise this ratio trading memory efficiency in order to gain performance, which brings us to the second aspect.
 
The second part is the performance of the emulated system relative to the target.  Here I think your suggested ratio of 10:1 is typical of a simple interpreting emulator.  This can vary quite a bit depending on how well matched the target and host are.  This ratio can also be reduced significantly using techniques like Just-In-Time compilation. I think the best example of this is Apple's Rosetta software used in the switch from PowerPC to Intel processors.  Although the numbers are disputed there are suggestions that the ratio was about 2:1 in this case.
 
Bringing this back to StudioVision, things are not quite as they seem, because of the PML interpreter / emulator within the Studio II.  What we have is that the combined performance of the CP1610 native and COSMAC emulated bits of the StudioVision PML interpreter are roughly the same as the Studio II's all COSMAC PML interpreter running half the time.  When stated like this it is not nearly so impressive.  The only reason StudioVision is in the same ballpark is because the Studio II is also running an emulator.  As I think I said earlier, the most important thing when emulating on the Intellivision is to be really picky about what you target.
 
I have not measured the relative performance of COSMAC CPU emulator within StudioVision to the actual COSMAC CPU, but I would expect it is nearer 20:1 than 10:1.  This is primarily because of the poor architectural match between the CPU's.  The COSMAC has 16, 16 bit registers in addition to its 8 bit accumulator (so these have to be stored in memory on the Intellivision not in registers), all of which must be manipulated 1 byte at a time because of the 8 bit accumulator (something the CP1610 cannot do natively) and any of which could be selected to be either the program counter or stack pointer (again has to be modelled in software on the Intellivision).
 
The native bits of the StudioVision PML interpreter make up for this complexity by being run more of the time (the 50% the real Studio II spends drawing the screen) and being optimised to the CP1610's 8 16bit register architecture, rather than being a straight translation.  For example here is the main PML decode loop of the COSMAC PML interpreter, as reverse engineered by Paul Robson:


Spoiler


And here is the alternative CP1610 equivalent also present in StudioVision, you can still see traces of the original in the comments, but much of the hard stuff is now done 16 bits at a time using lookup tables, rather than bashing the high (ghi / phi) and low (glo, plo) bytes of various 16 bit registers:

Spoiler


Something that has occurred to me is StudioVision does show that back in the day Mattel could have produced a relatively simple hardware adapter, similar to the ShockVision adapter, that would have allowed the Intellivision to play any of the RCA Studio II game cartridges directly, potentially without infringing on RCA's copyrights.  And this could have given Studio II owners with games an upgrade path to the Intellivision.  Clearly given that the Studio II was not a commercial success this is unlikely to ever have been considered, but I think the technical possibility is interesting.

Edited by decle, Thu Jan 19, 2017 12:57 AM.


#30 mr_me OFFLINE  

mr_me

    River Patroller

  • 3,815 posts
  • Location:Ontario

Posted Tue Jan 3, 2017 4:36 AM

https://en.wikipedia.../Virtualization
Virtualization is more like isolation and protection, running the same native instructions as the hardware. With many iterations possible. Not unlike hyper-threading, where you have a virtual core and real one.
 
Emulation, in terms as we understand it, is running alien non-native code on something.
 
There is big potential here to get caught up in semantics so I suggest a new thread.

Yes, I think virtualisation was the wrong word to use. I'm guessing Asteroids code was ported to the Atari 8bit. Ported in the strictest sense without conversion or translation since the CPUs are the same. Some parts for controls, sound, and display likely rewritten. The did something similar with pacman on colecovision. The StudioVision does have a software CPU emulator, although only a portion of the game code is being CPU emulated.

#31 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Sat Jan 7, 2017 1:57 AM

Hi everyone,

I've added a couple more games to the top of the thread, Baseball and Star Wars.  

When you look at the progression of Baseball from the Studio II and Fairchild Channel F; through the versions for the 2600 and Intellivision; and on into the Colecovision and NES, I think it illustrates just how quickly developers learned to exploit the various consoles of the late 1970s and early 80s.

Star Wars is also quite interesting, as well as being one of the first Star Wars video games, it was developed late in the console's life for the ill-fated Studio III.  It only saw distribution for licenced clone consoles released in Europe and Australasia.  As Carlsson discussed earlier, these clones could generate colour graphics, and while Star Wars supports colour, it only plays in black and white on the monochrome Studio II.


Cheers

decle
 



#32 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Sat Jan 14, 2017 2:27 AM

Hi everyone,

End of week 2 of the StudioVision project and I've added a couple more games to the top of the thread, Speedway / Tag and Biorhythm.  

Speedway is a two player racing game over 9 laps in the vein of a simplified Gran Trak 10 or Sprint 2.  Cars can only move in 4 directions, with steering following the Auto Racing "intuitive" model.  Although very simple. the cars do accelerate and recovering your lost speed is the main penalty for crashing.  Tag is also a two player game.  The objective is to score the most points in two minutes by tagging your opponent within 10 seconds.

Biorhythm predicts your biorhythms, go figure.  It accepts dates in 4 digit year format and judging by a comparative plot obtained from the Interwebnets the Studio II version does not suffer from Y2K issues and continues to work (slowly) to this day.  So it predicts at least the existence of the 21st century correctly :twisted:.

I think I'll release details of the Easter Egg within StudioVision with the next couple of games.  If anyone is looking for it and would rather I didn't please let me know.


Cheers

decle
 



#33 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Sat Jan 21, 2017 1:16 AM

Hi all,

Week 3 of the StudioVision project, as you have probably guessed by now I've added a couple more games to the top of the thread, Pinball and Bingo this time.

Like Intellivision Pinball the Studio II version suffers from the choice to make the table landscape rather than portrait.  This makes the RCA engineer's decision to make matters worse by putting the score and ball count at the top of the screen, rather than the side, particularly puzzling.  I also find that, like Intellivision Pinball, the ball finds the drain rather too easily.  Or alternatively, I'm not very good at pinball.

Bingo is interesting because it is unclear if it ever saw a release in the US.  One or two cartridges have turned up in the last 40 years, most recently in late 2015, otherwise it has a mythical status, not dissimilar to 8K Lock 'N' Chase.  The copy discovered in 2015 was dumped and the ROM found to be the same as the more common European version released for the later colour Studio II clones.  The game itself is essentially a random number generator and is rather pointless without the bingo cards and chips which came with the it.

That puts us at 12 down, four to go. ;)


Cheers

decle
 



#34 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Sat Jan 21, 2017 1:28 AM

Hi everyone,

As promised, here are details of the Easter Egg within StudioVision.

Interestingly, mr_me was on the money with the very first question about StudioVision:

"Is there any reason you can't double up on the resolution?"

Kudos!

My answer to this question was technically correct, a standard Intellivision cannot do this because it does not have enough GRAM to store the double resolution bitmapped screen.  However, because StudioVision was developed on an emulator, it is not necessarily constrained to the capabilities of a standard Intellivision.  I patched my development version of Jzintv to allow it emulate an Intellivision with more GRAM, like the World Book Tutorvision has.  StudioVision is written to spot whether the additional GRAM is present, and if so, use it to double the screen resolution.  Here are a couple of videos that show Bowling running in small and large screen mode for comparison:

unpluggedSmall.gif   unpluggedLarge.gif

All StudioVision ROMs have this capability, and always have done.  If you want to try the large screen mode you can patch Jzintv 1.0 beta4 (the latest version for which source code is available) with the following file:

Attached File  patchJzintv-1.04.txt   7.92KB   130 downloads

This patch does two things.  Firstly, it fixes a small bug that prevents keyboard hack files working correctly (Joe fixed this some time ago in the dev releases).  Secondly, it adds a new flag (-G) to the command line to select the amount of Intellivision GRAM.  Valid values are:

  • 0 - 512bytes / 64 GRAM characters, the default value and the size of the standard Intellivision
  • 1 - 1024bytes / 128 GRAM characters
  • 2 - 2048bytes / 256 GRAM characters, enough to make the whole screen addressable as a bitmap

In order to activate StudioVision large screen mode it is necessary to use -G2

Even with the additional RAM it was quite difficult to get the larger resolution to work well.  This is because the time available to access GRAM during VBLANK is very limited.  This makes it tough to blit the data needed to update the screen quickly enough to maintain smooth movement.  Unlike the StudioVision small screen mode, which is locked to a 30Hz update rate, large screen mode uses a variable refresh rate and only updates changed or dirty lines of the 32 line Studio II screen.  This means that the refresh rate can be anything from 9Hz to 60Hz depending upon how much of the screen has changed.  For the most part this seems to work well, as the Studio II's limitations mean that not much changes from one frame to the next.  The one exception is Freeway on StudioVision - Unplugged.  The scrolling road regularly dirties the whole screen, dragging the refresh rate down and making the gameplay rather choppy.  That said, it does work.

Anyway, I hope this is of interest, certainly it is the most innovative feature of StudioVision and pushes the boundaries of Intellivision homebrew state-of-the-art a bit.  It was also probably the most challenging aspect to design, implement and tune, which explains why I was keen for it to be found. :)


Cheers

decle
 



#35 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 12,028 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Mon Jan 23, 2017 8:54 AM

Great work. I wonder if Joe Z. would be interested in adding the GRAM size option to the mainline of jzIntv. It seems useful for emulator-only ROM releases.

#36 mr_me OFFLINE  

mr_me

    River Patroller

  • 3,815 posts
  • Location:Ontario

Posted Tue Jan 24, 2017 1:46 PM

Hi everyone,

As promised, here are details of the Easter Egg within StudioVision.

Interestingly, mr_me was on the money with the very first question about StudioVision:

"Is there any reason you can't double up on the resolution?"

Kudos!

My answer to this question was technically correct, a standard Intellivision cannot do this because it does not have enough GRAM to store the double resolution bitmapped screen.  However, because StudioVision was developed on an emulator, it is not necessarily constrained to the capabilities of a standard Intellivision.  I patched my development version of Jzintv to allow it emulate an Intellivision with more GRAM, like the World Book Tutorvision has.  StudioVision is written to spot whether the additional GRAM is present, and if so, use it to double the screen resolution.  Here are a couple of videos that show Bowling running in small and large screen mode for comparison:

attachicon.gifunpluggedSmall.gif  attachicon.gifunpluggedLarge.gif

All StudioVision ROMs have this capability, and always have done.  If you want to try the large screen mode you can patch Jzintv 1.0 beta4 (the latest version for which source code is available) with the following file:

attachicon.gifpatchJzintv-1.04.txt

This patch does two things.  Firstly, it fixes a small bug that prevents keyboard hack files working correctly (Joe fixed this some time ago in the dev releases).  Secondly, it adds a new flag (-G) to the command line to select the amount of Intellivision GRAM.  Valid values are:

  • 0 - 512bytes / 64 GRAM characters, the default value and the size of the standard Intellivision
  • 1 - 1024bytes / 128 GRAM characters
  • 2 - 2048bytes / 256 GRAM characters, enough to make the whole screen addressable as a bitmap

In order to activate StudioVision large screen mode it is necessary to use -G2

Even with the additional RAM it was quite difficult to get the larger resolution to work well.  This is because the time available to access GRAM during VBLANK is very limited.  This makes it tough to blit the data needed to update the screen quickly enough to maintain smooth movement.  Unlike the StudioVision small screen mode, which is locked to a 30Hz update rate, large screen mode uses a variable refresh rate and only updates changed or dirty lines of the 32 line Studio II screen.  This means that the refresh rate can be anything from 9Hz to 60Hz depending upon how much of the screen has changed.  For the most part this seems to work well, as the Studio II's limitations mean that not much changes from one frame to the next.  The one exception is Freeway on StudioVision - Unplugged.  The scrolling road regularly dirties the whole screen, dragging the refresh rate down and making the gameplay rather choppy.  That said, it does work.

Anyway, I hope this is of interest, certainly it is the most innovative feature of StudioVision and pushes the boundaries of Intellivision homebrew state-of-the-art a bit.  It was also probably the most challenging aspect to design, implement and tune, which explains why I was keen for it to be found. :)


Cheers

decle
 

So what happens in your modified emulator when you have expanded GRAM and run an original Intellivision game?  Does it work?



#37 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Tue Jan 24, 2017 3:40 PM

So what happens in your modified emulator when you have expanded GRAM and run an original Intellivision game?  Does it work?

 

Cool question.  I expect many existing games will continue to work as before, despite the additional GRAM.  I've only tried a couple, but they seem to be OK.  The Intellivision sets aside 2K for GRAM in the memory map, so the additional RAM does not trample over other things.  While the standard machine only has 512 bytes these are repeated 4 times to fill the 2K space.  So reading or writing to address $3800, $3a00, $3c00 or $3e00 all access the same memory location.  Setting things up for 2K of GRAM means this is no longer true.

There are two ways in which this change can cause problems.

Firstly, if a game were to update GRAM through the one of the copies instead of using the addresses from $3800 to $39ff adding more GRAM would lead to strangeness.  However, I'm not sure there is a good reason for a developer to do this, of course that does not mean it is not done.

Secondly, repeating the 512 bytes or RAM effectively frees 2 bits of each card definition in the Backtab.  This happens because if a program tries to access GRAM image 64 from memory location $3a00 it will actually get image 0 from $3800, because location $3a00 accesses the same memory location as $3800.  So GRAM image 0 = 64 = 128 = 192, the 2 high order bits of the GRAM image number make no difference to the image shown, and so can be used by the programmer for other things.  There are good reasons to make use of these bits, but I don't know which if any games do.

Perhaps other people do?



#38 mr_me OFFLINE  

mr_me

    River Patroller

  • 3,815 posts
  • Location:Ontario

Posted Tue Jan 24, 2017 3:59 PM

Yes, thats it. I couldnt remember exactly but Joe once said that for the Tutorvision to be truely backward compatible it would have to have a way to turn the extra gram on/off. There must be some games that use those two bits. Or maybe the Tutorvision is not 100% backward compatible. Thanks for explaining it.

#39 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Tue Jan 24, 2017 4:12 PM

Yes, thats it. I couldnt remember exactly but Joe once said that for the Tutorvision to be truely backward compatible it would have to have a way to turn the extra gram on/off. There must be some games that use those two bits. Or maybe the Tutorvision is not 100% backward compatible. Thanks for explaining it.

 

Ahh, yes.  This is the thread:

 

http://atariage.com/...omponent/page-3

 

As Joe suggests, quickly playing Space Patrol does show the problems.  The rocks flicker and the enemy space ships are invisible when extra GRAM is enabled.  It looks as though he found problems with other games too.



#40 Kiwi ONLINE  

Kiwi

    Stargunner

  • 1,657 posts

Posted Wed Jan 25, 2017 12:25 PM

I was going to suggest color square mode for full screen resolution of RCA studio 2 games.  I then realized that mode would give you 40 by 24 pixels, RCA renders at 64x32 resolution.  I'm really impressed by the emulation and how you got it working for the Intellivision.



#41 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Sat Jan 28, 2017 1:08 AM

Hi all,

Week 4 of the StudioVision project and I've added couple of "edutainment" titles, Math Fun and Concentration Match, to the top of thread.

Math Fun is rather like, well Math Fun.  Only without the gorillas, river or bongos.  OK so it might be more math than fun.  On the plus side it doesn't have the annoying music.  For the curious, the Studio II uses forward entry and to make things just a little bit more difficult entries only become visible if the complete, correct answer is entered.

Concentration Match is a foreign clone release of the card game Pairs.  It is not terribly hard as there are only 9 pairs of cards in play.


Cheers

decle
 



#42 killersquirel OFFLINE  

killersquirel

    Dragonstomper

  • 770 posts

Posted Sat Jan 28, 2017 12:19 PM

I just stumbled onto this thread and wanted to say how awesome this is. I won't be able to try it out until a couple of days from now, but I'm eagerly waiting to give this a go. Thanks for making this!



#43 eebuckeye OFFLINE  

eebuckeye

    Stargunner

  • 1,230 posts

Posted Sat Jan 28, 2017 12:30 PM

These are awesome! Thanks for doing it!



#44 GroovyBee OFFLINE  

GroovyBee

    Games Developer

  • 9,821 posts
  • Busy bee!
  • Location:England

Posted Tue Jan 31, 2017 7:05 AM

Secondly, repeating the 512 bytes or RAM effectively frees 2 more bits of each card definition in the Backtab.


Fixed that for ya ;). You can also use bits 14 and 15 in BACKTAB cards for other purposes too.

#45 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Sat Feb 4, 2017 2:10 AM

Hi everyone,

 

Penultimate week of the StudioVision project and we have reached the end of the US and Foreign releases.  I've added the last couple of games, School House 1 and Grand Pack, to the top of thread.

School House 1 is a series of pop quizzes on subjects like Geography, Politics and Maths (again!).  You cannot play with a better than 1 in 10 chance of randomly guessing the correct answer without access to the quiz booklets.  These can be found here.

Grand Pack is a foreign release for the Studio III clones.  It seems to take the place of the games built into the Studio II console.  Like the built in BIOS ROM it contains Doodle, Patterns and Bowling.  However, Freeway and Addition are replaced with Blackjack.  Grand Pack brings us full circle for the last game, to a pack in game compilation like Unplugged.   


Cheers

decle
 



#46 Rick Reynolds OFFLINE  

Rick Reynolds

    Dragonstomper

  • 728 posts

Posted Thu Feb 9, 2017 7:21 AM

Hey Decle,

I came across this website and saw this guy has a basic Space Invaders homebrew for the Studio II.  Any chance of getting that rom put into your very fine emulator-on-inty?  Or are things not really that simple... :)  He has a couple other homebrews also, but I really love the idea of being able to play a space invaders clone.

 

http://www.robsons.o...udio2/index.htm



#47 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Thu Feb 9, 2017 8:16 AM

Hey Decle,

I came across this website and saw this guy has a basic Space Invaders homebrew for the Studio II.  Any chance of getting that rom put into your very fine emulator-on-inty?  Or are things not really that simple... :)  He has a couple other homebrews also, but I really love the idea of being able to play a space invaders clone.

 

http://www.robsons.o...udio2/index.htm

 

Hi Rick,

 

Paul's conversions are without doubt the best Studio II games available, so I understand why you would be interested in seeing them.  Unfortunately, while I have tested them, I'm not intending to release them.  One of the reasons the games are so good is because they are written in RCA1802 assembler, rather than the Pseudo Machine Language (PML) code.  This means that they are far more efficient than the RCA games.  Unfortunately the inefficiency of the PML games is needed to run in real time, so while StudioVision will run Paul's games, they run slowly.  I don't want to discredit Paul's work by releasing something that would not do it justice.  Had StudioVision done a good job I would have approached Paul for permission, but as it does not I did not get that far.

 

Invaders is probably the nearest of Paul's games to running well.  Initially it plays well

 

invaders1.gif

 

However, there is a small pause whenever the invaders move, as StudioVision cannot keep up with Paul's clever programming.  Unfortunately as the game progresses and the invaders speed up this dominates and the game becomes unplayable, you simply cannot move or shoot quickly enough.

 

invaders2.gif

 

I want to be absolutely clear at this point, this is a shortcoming of StudioVision and not Paul's code.

 

I think it would be possible to fix this by recoding Paul's invader move code in CP1610 machine code, but I think this would be cheating and so I have not tried.

 

Sorry to disappoint :(

 

 

decle



#48 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

  • 5,782 posts
  • Coding something good
  • Location:Mexico City

Posted Thu Feb 9, 2017 9:22 AM

What about a recompilation before execution? :) or more commonly named JIT (Just In Time)

#49 decle OFFLINE  

decle

    Chopper Commander

  • Topic Starter
  • 238 posts
  • 0x10 bits or less

Posted Thu Feb 9, 2017 9:26 AM

What about a recompilation before execution? :) or more commonly named JIT (Just In Time)

 

Not cheating, but currently beyond my computer hacking (or nunchuck) skills.



#50 carlsson OFFLINE  

carlsson

    Metagalactic Mule

  • 8,456 posts
  • Location:Västerås, Sweden

Posted Thu Feb 9, 2017 10:00 AM

Lee Romanow's homebrews (Climber etc) however seem to be made in PML so those would run on the StudioVision, I believe. With the exception of the diagnostics program by Flip, it seems Paul Robson is one of the very few to ever have made application software for the Studio 2 in pure 1802 machine code. Almost everyone else went through PML.

 

So for any aspiring developer, you have two choices: machine code for maximum speed on real console, or interpreted language to be emulator friendly. :)


Edited by carlsson, Thu Feb 9, 2017 10:02 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users