Skeleton Atari 2600

0 views
Skip to first unread message

Brayan Jacobsen

unread,
Aug 5, 2024, 8:57:09 AM8/5/24
to motinsmilti
Thisis the basic storyline to a new game Skeleton, by Eric Ball. You wander endlessly in eight mazes using your UD to blast your way past the skeletons. Sound like fun? It is. How you ended up in the mazes is a mystery, but getting out is a challenge. The game is scaled nicely such that as you clear each maze of 10 skeletons the game gets progressively harder. It starts off kind of slow at first, but soon you will find yourself frustrated as the words GOT YOU fill your screen and you find yourself hitting the reset button to do it again. Oh, lest I forget, you sometimes miss with your UD and must reload and shoot again. If you are too close to the skeleton before your UD reloads… GOT YOU!!!

Skeleton is a unique title in that sound plays an important role in the game. The skeleton’s footsteps get louder as it gets closer. Sounds familiar, right? (Remember Escape form the Mind Master?) If you have the ability to modify your Atari 2600 such that it outputs two sound channels (some call it stereo, but it really isn’t), you can hear the skeleton on the right or left of you. Yep, you heard me right, so bust out those soldering irons and get to work and mod your Atari. In addition, there is also a motion sensor which shows what direction the skeleton is relative to your current position.


My impressions of the graphics are mixed. The 3D maze effect isn’t as nice as those found in Escape from the Mind Master, but the 3D effect is certainly better than Crypts of Chaos and are on par with another 2600 game called Tunnel Runner. The skeleton is very well done with nice 3D scaling effects as it moves towards/away from you in the hallways. The manual is very well done as well with some nifty artwork. In the end, it is the sound that makes this game unique. AND, if there ever was a scary Atari 2600 game, this would be it. So turn up the sound, turn down the lights and enjoy this game. Perhaps put on Disney’s “Sounds of Halloween” playing in the background to set the mood and you are set for an evening of Atari 2600 gaming pleasure.


Can you generate a brief outline of the program code structure showing how the game functions might be organized in a concise and logical way? Omit the actual code blocks, simply commenting them out with an ellipsis (...). Include functions that we have not fully written yet.


This outline shows a logical organization of the game functions, including some functions that we haven't fully written yet. The main game loop calls each of the necessary subroutines to handle user input, update game logic, check for line clears, update the game level, and draw game elements.


In chat, ve create Tetris for Atari 2600. Ve discuss game representation, draw playfield, handle joystick input, use asymmetrical playfield, collision, gravity, and drop routine. Ve also create functions for line clear, score, tetromino spawn, and color. All with glorious 6507 assembly.


Lets start writing the program. Start by creating the most basic skeleton program that we can have which handles clearing the Atari 2600 RAM in a concise, fast, amd idiomatic way, handles VSYNC, then all NTSC scanlines (you can use a simple loop), and finally handles VBLANK. If I made a mistake in requesting this basic "shell" or "skeleton" of a program, and/or forgot any basic details, then please correct me and tell me the reasoning. Display the code.


This code initializes the 6507 processor, clears the Atari 2600 RAM, and handles VSYNC, NTSC scanlines, and VBLANK in the main game loop. The code is written using the 6502 assembly language, and you'll need to use an assembler, like DASM, to compile it into a binary file that can be run on an Atari 2600 emulator or actual hardware.


To adapt the code for a PAL Atari 2600 system, you will need to change the number of visible scanlines and the number of VBLANK scanlines. PAL systems have 312 total scanlines, with 50 fields per second. The visible area has 240 scanlines, and the VBLANK area has 72 scanlines. Here is the modified code:


ChatGPT:

The primary change in this code is the number of visible scanlines (240 for PAL) and the number of VBLANK scanlines (72 for PAL). This should provide a basic skeleton for a PAL Atari 2600 system. Keep in mind that the actual game logic and rendering code will still need to be added to this template.


It's fun and impressive but that kind of mistake just demonstrates to me the GPT-4 isn't useful for serious work. It's labelled the code "ClearRAMLoop" but it's not doing that, even if "STX $80,x" was a valid instruction. It's horribly misleading.


Hmm. "STX $80, X" doesn't appear to be a valid instruction. Lets clear the RAM in a different way, otherwise I will inform you, and we will use that. Try to write 3 other potential ways to clear the RAM on startup.


I think there's an even better way. Clever bunnies have discovered this little trick over the years. Analyze this method and explain in detail what it is doing, and how it does it. (Also, say "hi" to Andrew Davie on the AtariAge forum!) ?


3. PHA: Push the contents of the Accumulator (A register) onto the stack. This has the side effect of decrementing the Stack Pointer. The value of A register is not important at this point, as the goal is just to modify the Stack Pointer.


8. BNE Clear: Branch to the "Clear" label if the Zero flag is not set. The Zero flag is set when the result of the previous instruction (DEX) is zero. This creates a loop that runs 256 times, clearing all 128 bytes of RAM. The loop runs twice for every RAM location because of the 256-byte address space of the stack.


This method leverages the stack and the behavior of the PHA instruction to efficiently clear the RAM. By manipulating the Stack Pointer and using the PHA instruction in a loop, it can clear the RAM with fewer instructions than other methods.


Let's revisit some of our previously written code for the purpose of discussion on the AtariAge forum, and to flesh out our program from the top down...or the bottom up. (There's probably a 6507 assembly language joke hidden in that statement, see if you can find it!) Write the constants and variables section for our program in a clear and concise fashion. Please include the basic colors for the Tetris pieces that we've already had a go at defining earlier in this session, and explain the correlation between the hexadecimal or numeric values and the actual color represented in respect to the Atari 2600's color palette and the TIA. Recall that we wanted (more or less) "standard" colors for the pieces as influenced by other popular versions of the game.


The colors are defined as hexadecimal values based on the Atari 2600's color palette, which has 128 colors. These values are used to set the color registers (COLUPF, COLUP0, COLUP1) in the TIA (Television Interface Adapter) chip. The TIA is responsible for generating the video and audio signals in the Atari 2600. The chosen colors attempt to match the "standard" colors for Tetris pieces as closely as possible, given the limitations of the Atari 2600's palette.


I'm not sure if I would call the Atari 2600's color palette, " limited." It can display more onscreen colors than many (if not all?) 16-bit consoles that were released decades later. Give me a list of 16-bit consoles and their maximum color palette and simultaneous onscreen colors. Please include the TurboGrafx-16 / PC-Engine in this list even though it was technically an 8-bit console...with 16-bit graphics.


You are right; the Atari 2600's color palette is quite impressive, especially for its time. Here's a list of some 16-bit consoles and their maximum color palettes along with simultaneous onscreen colors:


While the Atari 2600's color palette is smaller in comparison to the 16-bit consoles listed above, it is indeed impressive for its time, and its ability to display a variety of colors onscreen allows for rich and colorful games.


Now that we have a general code outline, a basic program shell and a few little basic bits, what would be a good approach (in order) for the program? Essentially, what should we start working on next? And for fun, additionally rewrite your response in the style of "Macho Man" Randy Savage. ?


Oh yeah, I can dig it, brother! Together, we'll create an amazing Atari 2600 Tetris game that'll have everyone snapping into the action! Let's keep the momentum going and make this project a true champion. If you have any questions or need more help along the way, don't hesitate to ask. The power of the Macho Man is with you! OHHH YEAH! ?


That sounds great! But first I'd like to take a small detour and flesh out a random number generator...I'll assume that a basic Linear Feedback Shift Register would suffice, correct? Let's write that since it is a general method that can be useful for other game programs. Also, if you can come up with some other useful alternatives to an LFSR, please tell me, but only write the LFSR code for now and comment it, detailing exactly how it works for maximum clarity.


BCC SkipXor ; If carry flag is clear, skip the XOR operation

LDA seedHi

EOR #$B8 ; XOR with the polynomial 0x1B (equivalent to x^16 + x^14 + x^13 + x^11 + 1)

STA seedHi ; Store the result in seedHi


This code initializes a 16-bit LFSR with a non-zero seed value and provides a routine to generate the next random number in the sequence. The NextRandom routine shifts the 16-bit seed right by one bit, and if the shifted-out bit is 1, it XORs the high byte of the seed with the polynomial 0xB8 (equivalent to x^16 + x^14 + x^13 + x^11 + 1). This polynomial is chosen because it provides a maximal length LFSR sequence (2^16 - 1 numbers before repeating).


The problem with ChatGPT and programming is that it gets a lot right - but it is absolutely confident about things that it gets wrong, and you really need to know what your'e doing to spot this stuff - in which case you might as well have written it yourself. The colours above, for example. Completely wrong - not even close to matching actual TIA colours in either NTSC, PAL or SECAM

3a8082e126
Reply all
Reply to author
Forward
0 new messages