jonmower Posted June 16, 2013 Share Posted June 16, 2013 Hello: I have been learning Atari 2600 programming on my Mac. I have read the beginner information online, and am able to program simple things such as colors and objects. I have also been hacking code and changing things. I am having difficulty understanding or finding resources on some commands at the beginning of the programs which I have hacked. For example, I know that STARTSCREEN changes the bottom position of the screen because I have changed its value and have observed it. However, I haven't found a resource which lists this command and what the variable represent. I know that one game starts at $54. Here are other commands which I do not have a solid definition for: NTSC = 0 PAL = 1 COMPILE_VERSION = NTSC ; Position equates SCREENSTART = $54 UP = SCREENSTART DOWN = $04 LEFT = $02 RIGHT = $A0 SCOREOFFSET = $31 MAXSCORE = $42 There is also code at the beginning of PITFALL such as SCREEN_SAVER, TRAINER FILLOPT, etc. Is there a reference guide for these commands? Thanks! Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted June 17, 2013 Share Posted June 17, 2013 These are constants defined by the user. Some of them are used as switches used for tests in IF statements. For example, you have NTSC = 0 defined. So the code in the following IF statement will not be included at compile time since NTSC = 0. If NTSC equaled 1 (or any non-zero value, I think) then it would be compiled in. IF NTSC lda someCode sta myCode ENDIF Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted June 17, 2013 Share Posted June 17, 2013 (edited) DASM homepage http://dasm-dillon.sourceforge.net Manual dasm.txt Symbols: Symbols define values used by the compiler at compile time. The DASM manual's a little confusing because if the #if OlafAsgn that's in there: symbol EQU exp #if OlafAsgn symbol = exp #endif The exp<b></b>ression is evaluated and the result assigned to the symbol. It's basically showing that you normally use EQU to define a symbol, but the dasm compiler can be built so it also supports = when defining symbols. Directives: Symbols can be used in your code to control how it compiles. If you look at the TIA color chart you'll see that the colors output for each numeric value are different for each TV standard (NTSC, PAL, and SECAM). The use of symbols and directives(also known as pseudo-ops,) allow you to control how the compiler interprets your code so you can easily build an NTSC version and PAL version from the same source file just by making a single change. NTSC = 0 PAL = 1 COMPILE_VERSION=NTSC IF COMPILE_VERSION = NTSC ; NTSC color values GREY = $00 YELLOW = $10 ORANGE = $20 RED = $40 PURPLE = $60 BLUE = $80 CYAN = $B0 GREEN = $C0 WHITE = $0F ELSE ; PAL color values GREY = $00 YELLOW = $20 ORANGE = $40 RED = $60 PURPLE = $C0 BLUE = $D0 CYAN = $70 GREEN = $50 WHITE = $0F ENDIF ... lda #RED+8 sta COLUBK [code] As written, that bit of code would color the background a medium shade of red on an NTSC system by using value $48. To make a PAL version, just change 1 line before compiling: [code]COMPILE_VERSION=PAL and the program would use $68 for red instead. Those color assignments are the ones I used in Space Rocks. Edited June 17, 2013 by SpiceWare Quote Link to comment Share on other sites More sharing options...
jonmower Posted June 18, 2013 Author Share Posted June 18, 2013 Thanks! You guys are really helpful. Also Andrew emailed me back. 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.