Jump to content

flavoredthunder

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by flavoredthunder

  1. How much do these typically go for? Are the at all rare?
  2. yeah it is the first time that I have ever had an auction cancelled too. Regardless, let me know when you get the cart. I have a tracking number for you, I just have not mailed it yet. Thanks again, Mark
  3. Hi this was my cart. I sold it to Chris. However, he didn't get it yet cause I forgot one number of his address and it got mailed back to me. I do want to say that if you guys every get a chance to buy from him do it cause even though 1. the auction got cancelled 2. i shipped it to the wrong address the first time he has been really understanding about the whole thing! A great EBAYER all the way around.
  4. Machine Languages for beginners is written for people who know basic. They use examples in basic to outline concepts and then show the equivalents in Assembly. Here is an on-line version of the book: http://www.atariarchives.org/mlb/
  5. Hey thanks for writing this tutorial. I have been struggling with programming the 2600 for a couple of weeks now and I realized that it was because I had only a "loose" grasp over assembly. The 6502 book that I picked up was really too general for me and I really appreciate how you continually tie in references to the 2600. Keep up the good work.
  6. Light on. The computer has power Light off The computer has been unplugged
  7. Hey Andrew, Wow, that is very cool. I am doing research on the power glove for a book that I am writing. I'd be very interested in interviewing you about it. Later, Mark
  8. Sure, I'll keep it up to date. I have no problem taking on that task. Mark
  9. I was the one that just got bid for that gameline! nice job, I had to go to the gym and it was gone when I got back. next time i'll get it for sure!!! haha
  10. Session 9: 6502 and DASM -Assembling the Basics The Assembler takes your source code and assembles it into a binary image The Binary Image is run on the 6502 CPU "DASM converts source-code consisting of instructions (mnemonics) and symbols into a binary form which can be run by the 6502. The assembler converts mnemonics into opcodes (numbers), and symbols into numbers which it calculates the value of during the assembly process." If DASM encounters a word it does not know it stores it in the symbol table. It will continue to compile the code but if it reaches the end and the word has still not been defined a value DASM will produce errors. vcs.h contains symbols for commonly used memory locations. Example: sta WSYNC sta = instrunction or opcode WSYNC = symbol which is defined in vcs.h as $2. (remember that $0-$7F is reserved for the TIA)
  11. Session Eight: Our First Kernel. First source code for a basic kernel that displays a rainbow effect. sta WSYNC is where the 6502 tells the TIA to halt the 6502 until the next horizontal blank.
  12. Session Seven, The TV and our Kernel Recap: Horizontal: 228 TIA color clocks on each scanline 160 color clocks are visible on each scanline of the TV 068 color clocks are used by horizontal retrace Vertical: 3 scanlines of VSYNCH 37 scanlines of vertical blank 192 scanlines of actual picture (NTSC) 242 (PAL) 30 scanlines of overscan 262 total scanlines (NTSC) or 312 scanlines (PAL) If you send an odd number of scanlines to a PAL TV then the image will appear in black and white.
  13. Just a reprint of the TV timing diagram that you find in the Stella Programming manual.
  14. Session 5 memory architecture 6502 communicates with the TIA by getting and setting values to the TIA registers, these registers are mapped to fixed addresses in the 6502 addressing range. The 6507 (the stripped down 6502) is able to address 2^13 bytes (8192 bytes) of memory each with a unique address. Each 16-bit address ultimately directly controls the "wires" on the 16-bit bus to memory. The 6507 ignores any attempt to access an address above the 13-bits. The 13-bits form the footprint of the 6507 memory ($0 to $1FFF). All communication between the CPU and hardware (be it ROM, RAM, I/O the TIA or other) is through reads and or writes to the memory location. Memory Map: $0000 - $007F TIA registers $0080 - $00FF RAM $0200 - $02FF RIOT registers $1000 - $1FFF ROM Note: 1K = 1024 bytes = $400 bytes = %10000000000 bytes.
  15. Recap: Covered the TIA (Television Interface Adaptor) and its relationship to the 6502 processor. The TIA has three "color" cycles to the 6502's one programmatic cycle. The TIA has 228 cycles consisting of 160 drawn to the screen and 68 invisible cycles used by the horizontal blank. Unless, the programmer changes the TIA every scanline will look identical. Since the TIA is independent from the 6502 it is possible to just send 160 scanlines to the TIA and wait 76 scanlines and the TIA will take care of the rest. No. Since the TIA has an internal state and draws data to the TV based on this state, it is possible to draw a single line simply by waiting 76 cycles of 6502 time (228 TIA colour clocks). It is possible to draw an entire frame by waiting for 262 lines (NTSC) or 312 lines (PAL). -- AD The TIA is so closely tied to the 6502 that it has the ability to stop and start the 6502 at will. In fact the 6502 can tell the TIA to halt the 6502. If you are unsure of the position of the TIA just ask the TIA to halt the 6502 and since the TIA restarts at the beginning of each scanline the 6502 and the TIA will be back in synch. The best thing is that the 6502 will be unaware that anything happened at all. [No. It is not the TIA which restarts at the beginning of each scanline. It is the TIA which restarts the 6502 at the beginning of each scanline, if it has been halted (through WSYNC writes). -- AD[/b] The CPU-Halt is called by writing any value to the TIA's Register called WSYNC. Notes on Assembly Binary numbers are represented by a "%" prefix Hexadecimal numbers are represented by a "$" prefix A base 10 number is represented by a "#" prefix ";" precedes any comments in the code Not quite. Base 10 numbers have NO prefix. the "#" symbol tells the assembler to treat the follwing value as a number, not a number representing a memory location. Example: lda #$80 ; load the number 128 into the accumulator sta $80 ; store the contents of the accumulator into memory location %10000000 lda 128 ; load the contents of memory location 128 (=$80) back into the accumulator sta #128 ; totally illegal instruction format - won't assemble. You can't store to a number, you can only store to a location! --AD nop = no operation (two 6502 cycles to execute) if you executed 38 nops starting at the beginning of the scanline the TIA would finish drawing the last pixel the same time the 6502 finished executing the last nop command. Introduction to the 6502 The 6502 is an 8-bit processor which means it works with 8 binary-bits at a time. Eight binary numbers can represent 0 to 255 8 binary bits can represent a number from 0 to 255 (decimal) or from -128 to 127, or whatever range or representation you want to conceptually give to it. The important point is that there are 256 unique values. -- AD You read binary numbers from right to left. They are no different to any other number we're used to -- it's just the base which is different. -- AD Here is an example of a binary number %01100101 This number equals = 101 and this is how: | 128| 64 | 32 | 16 | 8 | 4 | 2 | 1 | ----------------------------------------- | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | ----------------------------------------- 64 + 32 + 4 + 1 = 101 Ok, I have no math skills and to be honest until last week I had no idea how to count hex or binary or convert between them. This tutorial was crucial for me http://mathforum.org/library/drmath/view/54311.html The 6502 is able to shift 8-bit numbers to and from various locations in memory (referred to as addresses). A memory address is a unique location in RAM or ROM like a home address or an post office box number. The 6502 processor is able to get numbers from and in some cases store numbers to these addresses. The 6502 has just six registers but only the first three are covered here. Registers are internal memory/storage locations. The three registers are (X,Y,A)
  16. The TIA and the 6502 Recap: - TV frame is composed of 262 scanlines (NTSC) - TV frame is composed of 312 scanlines (PAL) TIA = Television Interface Adaptor The Atari builds the signal for each scanline. The scanline signal has a color and intensity property. The TIA draws the pixels on the screen 'on-the-fly'. Each pixel is one 'clock' of the TIA's processing time. TIA Properties: - 228 Color clocks / per scanline (including horizontal blank) - 160 visible color clocks (160 pixels per scanline) - 68 used by the horizontal blank The 6502 clock is derived from the TIA clock through a divide-by-three. For every single clock of 6502 time three color clocks of the TIA have elapsed There are 76 cycles of 6502 processing time per scanline. Seventy six 6502 cycles * 262 lines per frame * 60 frames per second = 1.19mhz (roughly) As the 6502 is executing instructions the TIA is sending data to the TV for each scanline. Since 6502 and the TIA are synched because of their shared timing origin it is possible for the programmer to determine what pixel the TIA is currently drawing. Each assembly command takes a certain amount of time to perform a task. This means that you need to accomplish those tasks as quickly as possible so that you can draw them to the screen with the TIA. Example: A load/store combination takes a minimum of 5 cycles of 6502 time. How many on screen pixels is that? Remember, 3 color clocks per 6502 cycle, so that's 3 x 5 = 15 pixels. Essentially, if one were using the quickest possible load/store combinations to change the color of, say, the background, then the absolute quickest this could be done would be every 15 pixels (ie: just on 11 times per scanline).
  17. Session 2: Television Display Basics Televisions have been around since the 20's Televisions don't display a continuos moving image. Instead the show static images in rapid succession. The fact that we see the image as a moving sequence is called "persistence of vision". The static images of the television are actually not made out of a single image. They are constructed out of several lines (scanlines). The number of scanlines varies depending on your television. The two main types of televisions are NTSC and PAL. NTSC - 60 images per second (fps) - 525 scanlines deep - 262.5 interlaced scanlines deep (Atari 2600 is non-interlaced) - 192 visible lines on the television PAL - 50 images per second (fps) - 625 scanlines deep - 312.5 interlaced scanlines deep (Atari 2600 is non-interlaced) - 228 visible lines on the television More correctly, televisions display 50 *fields* (NTSC) or 60 *fields* (PAL) per second, and a single frame is made from two fields interlaced together (with half a scanline vertical shift between them). The eye perceives these consecutive interlaced fields as a single higher-resolution picture. Two fields together are called a frame. Since the Atari 2600 typically doesn't do interlacing, each of the fields are identical. BUT, it is possible for a '2600 programmer to generate a true interlaced display, thus setting the effective vertical resolution of the machine to a whopping 525 lines (NTSC) or 625 lines (PAL). So, it's not that the Atari 2600 is non-interlaced. It's just that traditonally, programmers do not generate interlaced frames. The visible lines will effect game elements like sprite sizes, size of the playing field, vertical motion rate etc... It is important for the programmer to be aware of the difference because it is the programmer who has control of the data going to the TV. The 2600 only generates a signal for a single line. However, televisions also employ a technique called interlacing which allows for the image to be built up over two separate frames. Each frame (either even or odd) is displayed 1/30th of a second (30hz) on NTSC. On a PAL television the interlaced scanline is showed 1/25th (25hz). The use of interlacing improves screen resolution. The extra .5 of a scanline is used to tell the TV if it is an even or odd scanline. How a television works: It forms the images we see by shining an electron beam (or 3, for color TVs) onto a phosphor coating on the front of the picture tube. When the beam strikes the phosphor, the phosphor starts to glow - and that glow slowly decreases in brightness until the phosphor is next hit by the electron beam. The TV 'sweeps' the electron beam across the screen to form 'scanlines' - at the same time as it sweeps, adjusting the intensity of the beam, so the phosphor it strikes glow brightly or dimly. When the beam gets to the end of a scanline, it is turned off, and the deflection circuitry (which controls the beam) is adjusted so that the beam will next start a little bit down, and at the start (far left-hand-side) of the next scanline. And it will then turn on, and sweep left-to-right to draw the next scanline. When the last scanline is drawn, the electron beam is turned off, and the deflection circuity is reset so that the beam's position will next be at the top left of the TV screen - ready to draw the first scanline of the next frame. The "turning-off" and repositioning process is not instantaneous. This repositioning time is called the "horizontal blank" .. and the retrace period where the beam turns off and returns to the top of the TV is called the vertical blank. Horizontal blank is 68 TIA colour-clocks in duration. Vertical blank is thousands of 6502 cycles in duration. The Atari 2600 sends the TV the "color and intensity information for the electron beam as it sweeps across that line", and a signal for the start of each new line. The '2600 programmer needs to feed the TV the signal to start the image frame.
  18. The Atari 2600 is a cartridge based system. The cartridge consists of a circuit board containing a ROM (EPROM). All interactivity and graphics are just data (binary numbers) stored on the cartridge. The Atari 2600's processor is the 6507 chip which is a stripped down version of the 6502 processor. The 6502 is the same CPU that other systems like the NES, APPLE II used. The Atari 2600 Consists of these components: Memory: Memory is both RAM (Random Access Memory) and ROM (Read Only Memory). The Atari contains 128 Bytes of ram and depending on the type of cartridge used in the game only about 4k of ROM. Input/Output: The Atari allows for basic input using the ports on the front of the unit. Into these sockets you can plug a variety of paddles and joysticks to control that Atari's games. Typically the only output of the Atari is the signal it sends to the TV that displays the picture and sound of the game. Development Process The development of an Atari game is an iterative process which involves developing source code in a text editor and then using a program called a compiler to interpret your source-code and build a new file in machine code called a "Binary Image". This image is then burned onto an EPROM and inserted into a cartridge for use on the Atari. You can also use an emulator to play the binary image on a computer. Links: Atari 2600 Emulators - Z26 - available at http://www.whimsey.com/z26/ (recommended) - Stella - available at http://sourceforge.net/projects/stella/ Mailing lists and Web Sites: - the Stella list - at http://www.biglist.com/lists/stella/ - AtariAge - at http://www.atariage.com/ Stella Programmers Guide - text version at http://stella.sourceforge.net/download/stella.txt - PDF version at http://www.atarihq.com/danb/files/stella.pdf Text Editors - Crimson Editor http://crimsoneditor.com/
  19. Hi I am posting the notes that I take on the Andrew Davies tutorials. If you see errors or want to add to it feel free. These notes originally appeared in the sticky posting about chapter links, Andrew felt (and I agreed) because of some of the errors in my notes that it would confuse new readers. So, new readers beware! However in the spirit of distributed learning I felt like these notes might be of some help to someone out there. I am going to work to get rid of the errata when I find it! :wink:
  20. Yes, I know you are busy I was not asking you to do more work. I'll remove the notes from the chapter list and instead will re-post them in a general section with the caveat that they may be incorrect at best. Thanks again, Mark
  21. Hi Andrew, I can remove these notes if you want. I was thinking that some people might get confused that these are some how "official notes". Alternatively, I am using these notes as a learning tool as well and would be more then happy to add, edit , massage or delete these notes until they are 100% correct. Great work on the tutorials, I am learning a ton. Mark
  22. Hey Kirk, Didn't even know you had a TOC already, next time I'll do more research before I post, but as was pointed out it is really easy to get good threads burried in a BB like this. I also very much enjoyed your tutorial as well! Thanks, Mark
  23. Here is a quick post to allow you to access the wonderful Andrew Davie tutorials without digging through the forums. Might be good to make this sticky Session One: Intro http://www.atariage.com/forums/viewtopic.php?t=27186 Session 2: Television Display Basics http://www.atariage.com/forums/viewtopic.php?t=27187 Session 3: The TIA and the 6502 http://www.atariage.com/forums/viewtopic.php?t=27188 Session 4: The TIA http://www.atariage.com/forums/viewtopic.php?t=27189 Session 5: Memory Architecture http://www.atariage.com/forums/viewtopic.php?t=27190 Session 6: TV Timing Diagram http://www.atariage.com/forums/viewtopic.php?t=27192 Session 7: The TV and our Kernel http://www.atariage.com/forums/viewtopic.php?t=27193 Session 8: Our First Kernel http://www.atariage.com/forums/viewtopic.php?t=27194 Session 9: 6502 and DASM - Assembling the Basics http://www.atariage.com/forums/viewtopic.php?t=27221 Session 10: Orgasm http://www.atariage.com/forums/viewtopic.php?t=27294 Session 11: Colourful Colors http://www.atariage.com/forums/viewtopic.php?t=27338 Session 12: Initialisation http://www.atariage.com/forums/viewtopic.php?t=27405 Session 13: Playfield Basics http://www.atariage.com/forums/viewtopic.php?t=27595 Session 14: Playfield Wierdness http://www.atariage.com/forums/viewtopic.php?t=27706 Session 15 - Playfield Continued http://www.atariage.com/forums/viewtopic.php?t=28219 Session 16: Letting the Assembler do the Work http://www.atariage.com/forums/viewtopic.php?t=28699 Session 17: Asymmetrical Playfields - Part 1 http://www.atariage.com/forums/viewtopic.php?t=29205 Session 18: Asymmetrical Playfields - Part 2 http://www.atariage.com/forums/viewtopic.php?t=29326 Session 19: Addressing modes http://www.atariage.com/forums/viewtopic.php?t=29572 Session 20: Asymmetrical Playfields - Part 3 http://www.atariage.com/forums/viewtopic.php?t=30105 Session 21: Sprites http://www.atariage.com/forums/viewtopic.php?t=32481 Session 22: Sprites, Horizontal Positioning Part 1 http://www.atariage.com/forums/viewtopic.php?t=32896 Session 23: Moving Sprites Vertically http://www.atariage.com/forums/viewtopic.php?t=38020 Session 24: Some nice code http://www.atariage.com/forums/viewtopic.php?t=47639 ------------------------------------- Assembly Tutorials By Robert M Lesson One - Intro Lesson Two - Enumeration Lesson Three - Codes Lesson Four Binary Counting Lesson Five - Binary Math Lesson Six - Binary Logic
  24. I just wanted to say I too am a late comer to this thread but I am learning a lot. I'd be willing to generate some visual diagrams of memory maps and what not if someone would check it for accuracy. I am a visual person and sometimes it is the only way to get visual people to understand concepts. Thank for all your hard work Andrew. Also, if you'd like to post this course to a permanent location I'd donate some web space on my site. Mark
×
×
  • Create New...