Atari 2600 emulator for msx (Software and gaming MSX Forum)MSX Resource Center               
              
English Nederlands Espa�ol Portugu�s Russian French         

MSX Forum


MSX Forum

Software and gaming - Atari 2600 emulator for msx

Author

Atari 2600 emulator for msx

muffie
msx professional
Posts: 518
Posted: November 30 2009, 14:56   
Gentlemen,

There's a huge discussion on MSXBR-L about emulating Atari 2600 on MSX: If its feasible or not.
No one ever tried?

Regards,
Leo
msx professional
Posts: 988
Posted: November 30 2009, 15:31   
seen on : http://www.digitpress.com/systems/atari2600.htm

Year of Release: 1977
Retail Price at Launch: $249
Media Type: cartridges, cassettes via SuperCharger
Processor: 6507 (8-bit)
Processor Speed: 1.19 MHz
Screen RAM: 128 bytes
Screen Resolution: 192 x 160
Color Palette: 16 colors, 4 max on-screen
Max Sprites: N/A; player-missile graphics (5 max)
Sound: 2 sound channels

maybe that processor can be emulated into a turboR ?
if R800 is executing one instruction per cycle ( best case )
it has 6 or 7 cycles , a bit tight but not impossible.

Read in some forum , cycles per opcodes = 2 to 8 ( even NOP takes 2 cycles )
example : ADC , 5 cycles

So turbo R has 30-35 cycles for emulating ADC , it is more doable ...

But if R800 has to also parse the video graphics so to adapt them to vdp , ouch it is gonna be tight !
muffie
msx professional
Posts: 518
Posted: November 30 2009, 15:41   
Turbo-r?
We'll need all of that?
muffie
msx professional
Posts: 518
Posted: November 30 2009, 15:46   
Leo
msx professional
Posts: 988
Posted: November 30 2009, 16:33   
I have see links also for stella porting onto amiga 500 ,so 68k porcessor.
I guess turbo R is needed , and may even not be enough.
I see 128 colors ... and screen mode is pretty weird .

I believe re-compiled roms might have a better chance to be played on msx.
in that case the code translator has not to run in "real time".

Roms are 4k , so it is not a huge cpu time consuming task , could even be done
on PC.
Leo
msx professional
Posts: 988
Posted: November 30 2009, 16:38   
have you seen this post , a link for 6502 emulation is in it:

http://br.msx.org/forumtopic7825.html

Do know the speed perf versus real 6502/7...
boomlinde
msx user
Posts: 40
Posted: November 30 2009, 21:21   
I don't know... As far as I know, the graphics on the 2600 rely pretty heavily on strict timing with the raster beam, so even if you get it fast enough you'll have a hard time synchronizing it if you want it done accurately.
Leo
msx professional
Posts: 988
Posted: November 30 2009, 21:28   
run 6502 code on Z80
http://www.retroarchive.org/cpm/cdrom/CPM/6502/

seen on walnut creek CP/M cdrom !

pitpan
msx master
Posts: 1583
Posted: December 01 2009, 11:31   
CPU might be a problem, but could possibly be emulated despite the final execution speed. I remember a NES emulator (6502) for Gameboy (almost Z80). It was slow but it worked.

But graphic emulation cannot be done, because the CPU almost directly controls de TV raster beam. This implies a micro-second perfect emulation and a fast video-access mode in the host hardware. Bitmapped modes in V9938/9958 are not suitable for such thing, not to mention TMS9918.

So better forget it. It would be easier (I don't say possible) to emulate a NES.
Leo
msx professional
Posts: 988
Posted: December 01 2009, 13:29   
i wonder if atari 2600 has a bios or if the 2k / 4k cartridge had to provide low level routines as well.
If it has bios , it might be possible to do a shortcut there , like the games does take control of raster directly
but calls a bios routine that can be remapped in a different maner .
the 6507 processor is a 6502 one with less address lines , but it can still deal with more than 4k , so why limiting game to 4k ? there might be some room made for the bios ?
by the way same question goes for the NES
iamweasel2
msx lover
Posts: 115
Posted: December 01 2009, 15:05   
Atari 2600 has no BIOS.

Everything has to be done using direct access to the TIA registers. It is (in my opinion) the ultimate challenge to a programmer, since you don't have bios, interrupts, whatever, you have to count cycles and keep your code syncronized to the raster beam, using the hblank/vblank periods to do the game logic, the rest of the time the code called "Kernel" is running. The Kernel is the code that mounts the screen and it is the first thing a programmer do when it is creating a game.

The 6507 is a 6502 with only 13 lines of addressing, but due to the map memory of Atari you have only 4kb to your program. Of course, you can use mappers to allow you to use more ram, and many games did that.

So, I'm confident that you can emulate Atari 2600 on MSX, but making it fast enough so you can play games is a entirely different history. I don't think it is possible to achieve a good speed to play games, but if the purpose is just to emulate without playing games at normal speed, I don't see why it cannot be done.
Leo
msx professional
Posts: 988
Posted: December 01 2009, 15:36   
I see by our explanation that the 6507 spends some time for generating or even waiting for the raster Hsync/Vsync signals.
That sounds to me that gamedesign had few mips left , itis better for cpu emulation.
...
About TIA emulation , maybe there are some tricks like :
- many games must use same video timing scheme so you dont have to emulate every cases.
- you dont need a 1:1 frame rate , it is a bit the same as slowing down the game , but without slowing down the game play.

boomlinde
msx user
Posts: 40
Posted: December 01 2009, 21:10   
You could probably do some sort of instruction time -> raster time conversion and write everything to a frame buffer but I think that would be too slow to be more than a proof of concept. There was an emulator developed for the Game Boy Advance that apparently was optimized to hell but still ran only at 30 frames in the best cases (the GBA having a 16 MHz 32 bit processor). As pitpan mentioned, you'll probably have more luck emulating something half-decently if most software doesn't require cycle exact timing to even keep a single frame stable, like the NES. Commodore 64 is a similar case to the 2600, with most demo effects being tied to multiple raster interrupts and cycle fiddling timing, but I think you can get a good amount of early software running without exact timing.
RetroTechie
msx addict
Posts: 381
Posted: December 01 2009, 23:31   
Quote:

I see by our explanation that the 6507 spends some time for generating or even waiting for the raster Hsync/Vsync signals.
That sounds to me that gamedesign had few mips left , itis better for cpu emulation.


Sounds much like the Sinclair ZX81. Simply said: a lot of exact CPU timing is necessary for things to even appear on screen. Game processing occurs in CPU cycle 'leftovers' here and there.

Quote:

So, I'm confident that you can emulate Atari 2600 on MSX, but making it fast enough so you can play games is a entirely different history. I don't think it is possible to achieve a good speed to play games, but if the purpose is just to emulate without playing games at normal speed, I don't see why it cannot be done.


Exactly my opinion / educated guess. Hehe, keep up this discussion, and somebody is gonna do it just because he/she can.
 
 







(c) 1994 - 2010 MSX Resource Center Foundation. MSX is a trademark of MSX Licensing Corporation.