retrocon Posted December 4, 2003 Share Posted December 4, 2003 It's likely I'll have some questions regarding the tia chip from time to time as I work on my project. I'll post all these questions on this one thread to keep things organized. Some of them may be dumb, simple, naive, whatever, but please bear with me. I'm going through all the docs I have, but still not all is clear yet. First question: Are any of the values of registers, memory, etc initialized on power-on or reset on an original 2600? Are they set to 0? Are they usually 0? Do programmers always initialize first or are they any known cases where game programmers make assumations about unknown values? Next question: Regarding the 6507 that the 2600 uses. Does it include the BCD functions? If so, is it known if any games much use of this functionality? I know the NES doesn't have the BCD stuff, so I haven't coded it yet. If it's not in the 6507 then I probably won't bother. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted December 4, 2003 Share Posted December 4, 2003 Are any of the values of registers, memory, etc initialized on power-on or reset on an original 2600? Are they set to 0? Are they usually 0? Do programmers always initialize first or are they any known cases where game programmers make assumations about unknown values? Yup, all those values (incl. TIA, RAM, flags, stack-pointer etc.) are (usually!) initialized by the programmers themselves. If you look at a game code you always find some initialization code executed first. AFAIK all the power-on values are undetermined. And a few games (e.g. Berzerk) rely on those undetermined values to initialize their random number generator. Regarding the 6507 that the 2600 uses. Does it include the BCD functions? If so, is it known if any games much use of this functionality? Yup, it has BCD and AFAIK it is used by almost all games (for scoring). Quote Link to comment Share on other sites More sharing options...
retrocon Posted December 10, 2003 Author Share Posted December 10, 2003 Does anyone know of or have any demos that make use of just the playfield and background? Something simple but interesting (to look at) would be best. Source preferred Quote Link to comment Share on other sites More sharing options...
retrocon Posted December 10, 2003 Author Share Posted December 10, 2003 Ok, I have been working on the hardware sim and I was using Andrew Davie's simple kernel from here: http://www.atariage.com/forums/viewtopic.php?t=27194 But my sim which I thought was correct seemed to be giving some weird results. Then I noticed that on Z26 emulator, it also seemed to display the color bars with some sort of offset. So I rewrote the kernel in a way I thought was correct. When I tested it in Z26, there was no longer any offset. Even better, my sim is now giving me expected results. Could someone please explain what is up with this? Is one more correct than the other or am I just going crazy? Why would the original code clear VBLANK before the 37 scanlines of VBLANK have passed? Here is my newly modified kernel: processor 6502 include "vcs.h" include "macro.h" SEG ORG $F000 Reset StartOfFrame ; Start of vertical blank processing lda #%01000010 sta VBLANK lda #2 sta VSYNC ; 3 scanlines of VSYNCH signal... sta WSYNC sta WSYNC sta WSYNC lda #0 sta VSYNC ; 37 scanlines of vertical blank... sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC lda #0 sta VBLANK ; 192 scanlines of picture... ldx #0 REPEAT 192; scanlines inx stx COLUBK sta WSYNC REPEND lda #%01000010 sta VBLANK ; end of screen - enter blanking ; 30 scanlines of overscan... sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC jmp StartOfFrame ORG $FFFA .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted December 10, 2003 Share Posted December 10, 2003 Please use .. tags when posting code. That helps a lot when trying to read it. Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted December 10, 2003 Share Posted December 10, 2003 Hi there! Please use .. tags when posting code. That helps a lot when trying to read it. Also, I assume these TIA questions will soon reach a level where subscribing [stella] might be a good idea here as well Greetings, Manuel Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.