 |
|
 |
| Parallax Forums > Public Forums > HYDRA System & Propeller Game Development > Atari 2600 emu ramblings :) | Forum Quick Jump
|
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/2/2008 10:11 AM (GMT -8) |   | Good call on the thread. I was feeling guilty about the other one!
Yeah, I looked at the TIA last night. I think speed wise, we are ok with a coupla COGs, but it's not as simple as I thought! Lots of timing precise logic is necessary, even for very basic by the book displays. Those would be the early titles, COMBAT, ADVENTURE, AIR SEA BATTLE, etc... All of those are 2K and 4K of ROM.
There is the TIA emulated to very high precision in Stella. A lot of the work required is done there. Those guys worked from the schematics forward.
The 2600 is 1.1Mhz or so. That yields a few more decode instructions, and that's favorable.
Perhaps we should change the thread title too. If we've got a 6502, there are multiple targets. The VCS is appealing because everything fits into the Prop RAM easily enough. I've a few thoughts on that
-the Stella team renders to a frame buffer. Good news there is the 2600 is 160x180-200 resolution. More good news is most of the graphics are more like 40 or 80 pixels horizontally, with only a few unique colors per scan line. We are behind in the intensity department as the VCS has 8 levels, not a show stopper, but it will take some mapping. Seems like there are some options there, without having to do a full on 160 pixel frame buffer.
The other path, given a running 6502, is something like the Apple ][. It's only got a frame buffer, no interrupts either. All we would need is some address translation, to get smaller productions up and running! Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net | | Back to Top | | |
  |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/2/2008 10:23 AM (GMT -8) |   | | | |
 |  Baggers Registered Member

       Date Joined Mar 2007 Total Posts : 1773 | Posted 12/2/2008 10:57 AM (GMT -8) |   | As for thread name can keep it as is for now til we have 6502 up n running correctly and at full speed.
As for TIA, could we have a cog generting scan lines, and reading 6502's port or ram addy, to build a small 160x8 scan line buffer, which the TV driver then decodes on the fly a scan line or a few behind, adding the sprites etc. and displaying? :)
But yeah, for starters, lets get a display up and runnng first, and have the spin code 6502 core running exactly the same, as your 400, so we can test it's correctness first, then once we're happy with it's ability, then pasm it :) and run the same tests again :) http://www.propgfx.co.uk/forum/ home of the PropGFX Lite
| | Back to Top | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/2/2008 11:08 AM (GMT -8) |   | I'm liking that actually.
Did some digging, and the mess project has a core also, TIA, and 6522 RIOT chip, which could be used to do some sound for KABOOM!
A coupla scanlines behind makes a lot of sense. Basically, the TIA builds it's display a scan at a time. Display entities are sent to it, during the line, or HBLANK time. For the playfield, it can do some very basic stuff, like mirror. That stuff seems to be straightforward.
The trouble lies in the sprites. They are strips like the Atari computers are. That's cool. They don't work out of a RAM buffer, and instead get their data at the time it's needed from the CPU. Finally, to position them, cycle exact writes are often needed to accomplish that.
At least there is a body of existing code.
I'm also intrigued by that little c to spin proggy. Want to have a play with that to see just what it does. Could be very handy. -- No longer hosted there. Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.netPost Edited (potatohead) : 12/2/2008 7:41:27 PM GMT | | Back to Top | | |
  |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/2/2008 1:10 PM (GMT -8) |   | I'm gonna go collect some 6502 stuff. We need data sheets, and another core or two to look at. That one seems kind of goofy on a first pass. Also, the C to spin goodie doesn't seem to exist there anymore. Maybe it didn't work? LOL!!
You went right where I was thinking too. Not enough time in the scan to get stuff done. Gonna have to be rendered a few lines behind for sure, meaning at least two COG's for TIA. I think we are forced to render at 8 bits per color too. On the VCS, it can literally be any color, any time. Was thinking 4 colors per scan line, but then remembered lots of tricks... There is one for the background, one for the playfield, one for both sprites. That's 4, but other stuff can happen. That means the shorter, more intense wativid loop...
The 6502 will be doing stuff, right in the middle of the scan line, and when it does stuff, impacts where and what appears on that scan, and sometimes the next one. So no packing it in to the blanking time for the TIA.
I think it's easy enough to just make some target code that assumes a 40 byte text screen, number font starting right at 0, so the value $00 = "0". That's a coupla loops, jump, add, etc... Only a small part of the CPU, nothing complex. I'll start on that too. Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.netPost Edited (potatohead) : 12/2/2008 9:18:03 PM GMT | | Back to Top | | |
  |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/2/2008 9:14 PM (GMT -8) |   | | | |
 |  Baggers Registered Member

       Date Joined Mar 2007 Total Posts : 1773 | Posted 12/3/2008 12:21 AM (GMT -8) |   | | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/3/2008 7:54 AM (GMT -8) |   | Cool. On a non-multi processor system, this then would be essentially one big loop. Suppose it could be a coupla processes or threads also. Either it's fast enough, or it isn't. For us on the Prop, our constraint then is # instructions per clock, or the thing falls outta sync, as each thing runs on it's own.
On the 2600, we've got the 6507 variant, with a 12 bit address bus, the RIOT chip, and the TIA. The RIOT is where the RAM lives, and it's only got 128 bytes. That's it for system RAM. 4K addressable ROM. The RIOT chip does I/O for the controllers, and I think sound comes from the TIA.
Here are some document links:
http://www.qotile.net/minidig/docs/2600_riot_map.txt (there are no interrupts hooked up, and the interrupt bit on the 6507 is hardwired to be 0 no matter what)
http://www.zimmers.net/anonftp/pub/cbm/documents/chipdata/r650x/index.html
http://www.atarihq.com/danb/tia.shtml (TIA Info)
http://www.atarihq.com/danb/files/TIA_HW_Notes.txt (has great description of polynomial counters! Never knew why these were used. Now I do. They take the same number of cycles, every iteration.)
Found this also:
MOS 6507 1.19MHz
Television Interface Adapter (TIA or "Stella") 3.58MHz. This chip produces the video display and sounds for the 2600. It also has 6 registers which are used as A/D converters and for the trigger buttons on the joysticks. For those familiar with the Atari 800, this chip is about 1/2 of a TIA/Pokey in all respects. But, there is no ANTIC chip to drive it; the CPU must do all the work that the ANTIC does in the 800.
The TIA runs at colorburst speed. This makes perfect sense to me, given how Ataris generally display things. The CPU then is 1/3 of that. My gut says this is to give the TIA time to deal with what it sees on the BUS in real time.
I've collected the relevant goodies into the attached ZIP file, along with a few handy items from 6502.org. Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.netPost Edited (potatohead) : 12/3/2008 4:09:41 PM GMT
File Attachment : 6502.zip 1.93Mb (application/x-zip-compressed)This file has been downloaded 114 time(s). | | Back to Top | | |
 |  trodoss Scrub

       Date Joined Aug 2008 Total Posts : 268 | Posted 12/3/2008 7:57 AM (GMT -8) |   | | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/3/2008 8:09 AM (GMT -8) |   | | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/3/2008 8:21 AM (GMT -8) |   | | | |
 |  Baggers Registered Member

       Date Joined Mar 2007 Total Posts : 1773 | Posted 12/3/2008 10:13 AM (GMT -8) |   | | | |
  |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/3/2008 11:31 AM (GMT -8) |   | Jt_Cook, I do know many 2600 games use the undocumented ones as well. Lots of homebrew titles do anyway. Gotta work all the tricks on that machine.
Baggars, no worries man. I'm teeing things up for the work to come. Figured we could get a test environment up, driver, framework, etc... That's all stuff I know I can handle and I've got little bits of time to split between this and KABOOM! This is work I know I can do, so I'm gonna because there is work coming I can't do without some help!
From my understanding of the thread so far, having a worthy 6502 at speed is project #1. That's where the framework comes into play. A text display gives us a nice debug, speed test and such, with few hassles. Perhaps it's foolish, but I think working through a core to find if a COG can do it fast enough probably comes before tuning it to handle all the bizarre hacks that people code to that chip. Am I wrong on that?
Got a link to the MAME 6502 core files? Or... is it just go grab the whole thing and pick it out of the source tree? I built it once for SGI. It's HUGE!
Frankly, I'm kind of excited to plug away on something like this. I think it's gonna be fun. Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net | | Back to Top | | |
  |  Dennis Ferron Registered Member
        Date Joined Jul 2006 Total Posts : 479 | Posted 12/3/2008 2:08 PM (GMT -8) |   | Hey guys; I recently finished a project which connects a Propeller with a real 6502. It was my Propeller design contest entry, the PROP6502 Laptop. I'll be posting the code to the object exchange when I feel better (I'm home sick at the moment). It includes a Spin/asm object that spoon-feeds a 6502 at the bus cycle level. I'm thinking if I can make that object code-compatible with your emulator object, then we could test 2600 games on both the emulated 6507, and my real 6502 chip. It might help debugging.
I've separately been working on a rolling buffer TV driver. What that is, is it's an NTSC driver that takes its pixel color bytes from a line buffer which can be one line, or ten, or the whole screen. What you can do with that is declare a buffer size, say 10 lines, and fill up to line N+9 while the TV is on line N. That way there is some latency between the display line you are rendering, and the display line that is on the TV, so if you fall behind, the TV driver just consumes lines already rendered and you have some opportunity to catch up by doing the next lines more quickly. You could also double up certain lines, that is if you fall behind you could insert a record that indicates "don't move on yet; just display the previous line again" and then you could skip a line and render the next one.
That could be useful for your 2600 emulation because you could use the buffer to give you some breathing room; if some of the time your emulation takes a little longer to render the whole NTSC line than you actually have time for, you could still make up the difference in the next line. Or, say you can only achieve 4/5ths the speed you need, you could render 4 lines and double up the 5th. | | Back to Top | | |
 |  AndreL Registered Member

       Date Joined Apr 2005 Total Posts : 801 | Posted 12/3/2008 2:45 PM (GMT -8) |   | That's cool -- I made one too last year or so, basically a propeller GPU that you could talk to over a SPI/parallel bus, so one of my developers could experiment with the 6502, and different processors and have a nice GPU to talk to. Anyway, sounds good!
Andre' | | Back to Top | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/6/2008 10:56 PM (GMT -8) |   | | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/6/2008 11:59 PM (GMT -8) |   | | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/7/2008 12:35 AM (GMT -8) |   | DAT
test_program
{ Program Origin $6000
zero = $30 nine = $39
screen = $7bff
numbers = $7cc7
lda #zero 'get zero digit loaded ldx #8 'we are gonna do nine digits digits sta numbers, x 'put them on screen, right to left dex 'next digit? cpx #0 'done ? bne digits 'no, continue writing digits to screen!
'yes, move on to counting on them....
'hand assembly until I get the 400 sorted, or DASM or something... 'this code is relocatable and simple, so it can be put right into the test proggy with no worries 'which is where it is right now!
}
byte byte $a9, $30 ' lda #zero byte byte $a2, $08 ' ldx #8 byte byte $9d, $c7, $7c 'digits sta numbers, x (check endian on this one) byte byte $ca ' dex byte byte $e0, $00 ' cpx #0 byte byte $d0, $f8 ' bne digits (check branch offset)
Anyone care to double check me on the branch and endian order for the absolute, x instruction?
And if this is good, just copy paste into the main program DAT section, and we've got some baby test code to execute with an emulated 6502. Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net | | Back to Top | | |
 |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 12/7/2008 11:40 AM (GMT -8) |   | | | |
 | 111 posts in this thread. Viewing Page : 1 2 3 4 5 | | Forum Information | Currently it is Saturday, November 21, 2009 11:35 AM (GMT -8) There are a total of 393,858 posts in 55,536 threads. In the last 3 days there were 84 new threads and 709 reply posts. View Active Threads
| | Who's Online | This forum has 17692 registered members. Please welcome our newest member, old guy. 56 Guest(s), 13 Registered Member(s) are currently online. Details Siri, keith_kw, Jay Kickliter, Mike Green, Bob Lawrence (VE1RLL), Dogg, dMajo, hover1, ErNa, Harley, Tubular, Leon, MicroDirk |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|