Jump to content
IGNORED

T•Rex aka First Attempt at 6507


Recommended Posts

Hello there!

 

Well, I think the title says it all. So this is just some clone of the game that plays in Google Chrome when there's no internet. It's pretty average and I absolutely need to fix some things like the score display, the obstacles' horizontal movement. But I'll let you be the judges of that.

 

 

t9v6.png

 

Edit :

 

Here's a second version with some adjustments like a 4 digits score, smoother horizontal movement, difficulty choice and sprite animation.

I deleted the title screen though because it doesn't really fit this kind of game.

 

rnyf.png

 

 

 

 

 

Atari VCS T-Rex (NTSC+PAL).zip

Edited by Secamline
  • Like 5
Link to comment
Share on other sites

Thanks, I didn't expect such a positive reply :)

 

By the way, does anyone know how to make a title screen logo without using the playfield's gigantic pixels ? I assume we have to use the sprites' graphics but I just can't figure out how to do it. Thanks in advance.

 

 

Use a 48 pixel routine. Read this topic.

 

A more advanced option is to use a 96 pixel routine, which is basically spreading out the 48 pixels and putting them in different positions on alternating frames. Since you're just getting started go with the 48 pixel routine.

Link to comment
Share on other sites

You have to prep a number of things:

  • Allocate 12 bytes of RAM for G48
  • G48 must be initialized to point to the graphic image to show. G48 and G48+1 are the first 8 pixels, G48+2 and G48+3 are the next 8 and so on.
  • Y must be loaded with the number of scanlines to draw
  • player0 must be positioned at 56
  • player1 must be positioned at 64
  • NUSIZ0 and NUSIZ1 must be initialized to 3 (three copies close)
  • set bit 0 of VDELP0 and VDELP1 to 1*

* can save a load instruction by using the 3 from the NUSIZx registers as only bit 0 matters.

  • Like 1
Link to comment
Share on other sites

That's weird, it works for me, does it have something to do with the emulator I use or..?

 

That's in Stella. Just dropped it on my Harmony and it looks OK on real hardware...

 

Aha - it's related to the Drive Unused TIA Pins randomly on read/peek.

post-3056-0-72368300-1477602180_thumb.png

 

When reading in values from TIA not all pins are connected. That can cause weird problems like this one in Medieval Mayhem (blog entry explains why the problem doesn't show up on all consoles).

 

I leave that setting checked now to help find problems such as this. I do the same for the randomize options at the bottom of the I/O tab:

post-3056-0-38505300-1477602842_thumb.png

Link to comment
Share on other sites

Use Stella's debugger to see what's going on.

 

I turned off the "randomly" option on the TIA tab then reloaded the ROM. I then used the prompt and entered trap RESP0 to see when the reposition occurs as we know the problem's related to the positioning of the players.

 

post-3056-0-36158000-1477604581_thumb.png

 

I then clicked on exit (or hit the ` key) and noticed it was on cycle 40 of the current scanline. The green box in the listing is the current instruction, you'll notice it's the line just after the STA RESP0.

post-3056-0-55181200-1477604715_thumb.png

 

I hit ` a few more times and it was consistently on cycle 40. I then turned the "randomly" option back on and hit ` a few more times and noticed the cycle was different every time: 12, 8, 36, 44, etc.

 

A little bit above that in the code I noticed a loop:

 

       LDX CXPPMM
LF0DA: DEX
       BNE LF0DA

CXPPMM is one of those TIA registers where not all bits are connected. Specifically, only bits 6 & 7 are used:

post-3056-0-37285800-1477605080_thumb.png

 

When the "randomly" is off, that value comes back $87 - the lower nybble is 7 because the 6 bit address CXPPMM is 7! With "randomly" on that value comes back as: $9F, $BF, $87, etc. So that loop will take a different amount of time on some Atari systems.

Link to comment
Share on other sites

A very common mistake is to leave off # when you're typing in an immediate mode instruction. If you wanted to load register X with 7 the instruction is LDX #7. If you left off the # then LDX 7 on the Atari is the same as LDX CXPPMM because that's the name of the register accessed at address 7.

Link to comment
Share on other sites

Yes, that'll cause the display to jitter.

 

Another issue is an odd number of scan lines on PAL 2600s will cause the display to lose color, and thus be drawn in only black & white. While I don't know for sure, being in NTSC land and all, I suspect the frame of color loss would be even more noticeable than the jitter.

Link to comment
Share on other sites

Yes, on real hardware. I just tested it using jitter.bin to confirm it by changing the number to 127 (or 129) then repeatedly hitting fire - the screen jitters up/down.

 

It should have in Stella too, it did so when I first implemented jitter support. I just tested that build and the second one to confirm it; however, as of the third build it only jitters if the difference is 2 scanlines. As such I must have changed something on accident when I added recovery time(that's when it takes multiple frames to recover from a large change in scanline count). I've added looking into that to my To Do list.

  • Like 1
Link to comment
Share on other sites

Keeping the scanlines stable during all the transitions was one of the harder parts of the process for me. I ended up making a subroutine that would wait for my frame timer to finish, draw an entire blank frame, and then properly reset all the timers. Then during transitions, if things were taking too long, I could change the code so that it called this subroutine halfway through.

 

There's probably a better way (I'm still a bit of a newbie around here) but that ended up being an easy solution for my transitions.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...