Jump to content

Photo

T•Rex aka First Attempt at 6507


36 replies to this topic

#1 Secamline OFFLINE  

Secamline

    Space Invader

  • 42 posts
  • Location:France

Posted Tue Oct 25, 2016 11:23 PM

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

 

 

 

 

 

Attached Files


Edited by Secamline, Mon Nov 7, 2016 9:11 AM.


#2 Arenafoot OFFLINE  

Arenafoot

    Dragonstomper

  • 812 posts
  • videogamestores.net/
  • Location:Watson, LA

Posted Tue Oct 25, 2016 11:30 PM

awesome idea - got to 60 on the first try

I love the old school scoring font (from the early Atari games).



#3 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Wed Oct 26, 2016 10:07 AM

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.



#4 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Wed Oct 26, 2016 11:34 AM

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.



#5 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Wed Oct 26, 2016 2:13 PM

Thanks for your answer :)

I tried implementing this routine but I can't get it to work, I guess I'm not experimented enough yet, so I'll stick with the playfield text for the moment.



#6 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Wed Oct 26, 2016 2:24 PM

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.



#7 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Wed Oct 26, 2016 2:42 PM

I've done everything, the four last sprites are displayed correctly, only the two first ones are messed up.


Edited by Secamline, Wed Oct 26, 2016 2:47 PM.


#8 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Wed Oct 26, 2016 3:11 PM

Oops, I left off:

  • set bit 0 of VDELP0 and VDELP1 to 1

The rest of the bits in those registers are not used, so you can save an instruction by storing 3 to them just like you do for NUSIZ0 and NUSIZ1.



#9 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Oct 27, 2016 2:23 PM

Ok it works now, thanks again for your help, I updated the file.



#10 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Oct 27, 2016 2:34 PM

Ok it works now, thanks again for your help, I updated the file.

 

 

Something's not quite right, the title graphic is jumping all over the place.

 

t-rex 2_1.png  t-rex 2_2.png  t-rex 2_3.png  t-rex 2_4.png t-rex 2.png



#11 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Oct 27, 2016 2:49 PM

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



#12 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Oct 27, 2016 3:16 PM

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.

Screen Shot 2016-10-27 at 4.01.52 PM.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:

Screen Shot 2016-10-27 at 4.13.02 PM.png



#13 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Oct 27, 2016 3:34 PM

I see, and how do I fix this?



#14 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Oct 27, 2016 3:58 PM

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.
 
Screen Shot 2016-10-27 at 4.41.29 PM.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.
Screen Shot 2016-10-27 at 4.43.26 PM.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:
Screen Shot 2016-10-27 at 4.50.15 PM.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.

#15 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Oct 27, 2016 4:04 PM

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.



#16 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Oct 27, 2016 4:20 PM

What I don't understand is that I never use the CXPPMM register in a loop in my code.

EDIT: Oh! Ok, now I get it, what a stupid mistake really ^^


Edited by Secamline, Thu Oct 27, 2016 4:21 PM.


#17 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Oct 27, 2016 5:04 PM

It's a common mistake.  Turn on the "randomly" and when (not if) you do it again the weird results will help you find and fix the typo.



#18 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Oct 27, 2016 5:41 PM

Ok, thanks for your advice.



#19 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Wed Nov 2, 2016 11:58 PM

I fixed most of the problems the game had in the last update, but sometimes the number of scanlines jumps to 263 for a split second, is it important to have a 100% stable scanlines number or can I ignore that ?  (considering this instability doesn't cause jittering)



#20 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Nov 3, 2016 7:22 AM

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.

#21 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Nov 3, 2016 10:41 AM

You mean it will jitter when playing on a real hardware? In Stella, with the jitter option enabled, it doesn't seem to affect the display when there are 263 scanlines.



#22 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 11,572 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Nov 3, 2016 12:41 PM

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.



#23 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Thu Nov 3, 2016 11:57 PM

I managed to make a stable scanline number during gameplay, but when the game resets (each time you get hit), it becomes very unstable for 2-3 frames.



#24 gauauu OFFLINE  

gauauu

    Moonsweeper

  • 332 posts
  • Location:Illinois

Posted Fri Nov 4, 2016 8:41 AM

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.



#25 Secamline OFFLINE  

Secamline

    Space Invader

  • Topic Starter
  • 42 posts
  • Location:France

Posted Sat Nov 5, 2016 1:59 AM

Alright I updated the file once again. I made something similar to your solution and this time it looks like the display is entirely stable. 






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users