Jump to content



1

Session 23: Moving Sprites Vertically


33 replies to this topic

#26 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,993 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sat May 27, 2006 8:20 PM

Your Air CSS Battle is quite impressive!

#27 nmoog OFFLINE  

nmoog

    Space Invader

  • 44 posts

Posted Sun May 28, 2006 12:07 AM

Thanks SpiceWare! I actually thought making a game using DOM scripting would be pretty challenging. Then I started following Andrew's tutorial here. Turns out I didn't know the meaning of challenging :)

#28 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,993 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sun May 28, 2006 8:01 AM

I was lucky in that I already knew 6502 from my C= days. That made it a lot easier to get Medieval Mayhem started.

#29 nmoog OFFLINE  

nmoog

    Space Invader

  • 44 posts

Posted Mon May 29, 2006 2:24 AM

Hey Guys,

Although I'm having a great time messing around with this stuff, I was hoping you could give me a hand as I think if I keep going by Im going to be leading myself into a path of pain.

I've got a lil' guy moving up and down... kind of. He magically gets a hat when going down and a podium when going up. THough this isn't the bit thats really troubling me. I don't know where in each frame (before the frame starts, after the vertical syncs, during the screen drawing etc) I should be doing:
* Joystick checking
* Horizontal Positioning
* vertical positioning

In the horizontal positioning subroutine that Andrew listed it starts with "sta WSYNC" - does that mean I don't do the wsync at the end of the main loop as well?

Thank for your help

Attached Files



#30 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Mon May 29, 2006 2:50 AM

View Postnmoog, on Mon May 29, 2006 10:24 AM, said:

I don't know where in each frame (before the frame starts, after the vertical syncs, during the screen drawing etc) I should be doing:
* Joystick checking
* Horizontal Positioning
* vertical positioning
Joystick: best before positioning, since you want to react to the players input immediately.
Positioning: before the display kernel, after stuff like joystick, collision checking etc.

Actually, there is no strict pattern you have to follow. Just do it in some logical order. Later on, you might discover that reordering your code may make things easier.

Quote

In the horizontal positioning subroutine that Andrew listed it starts with "sta WSYNC" - does that mean I don't do the wsync at the end of the main loop as well?
The RESPx commands have to be timed exactly, so you need a WSYNC before. But that doesn't mean you have to do it inside the kernel. You can do everything whereever you want (except HMOVEs during vertical sync).

#31 nmoog OFFLINE  

nmoog

    Space Invader

  • 44 posts

Posted Mon May 29, 2006 4:43 PM

Yes! Thanks Thomas!

I was trying to run the xpositioning code during the screen draw. Whoops! Now I've got a lil' guy running round the screen - on an atari 2600!!!

I have another query on the WSYNC thing though - if I do the 37 vertical blank WSYNC before drawing, then one WSYNC for the X Positioning code - then 192 WSYNCS for the screen then 30 WSYNCS for the overscan... don't I have 1 WSYNC too many? Doesn't that WSYNC I called for the X positioning push everything down one line?

#32 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,993 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Mon May 29, 2006 9:47 PM

Yep, but most TVs are forgiving if you provide too many or too few lines, provided it's the same number of lines each time. ie sending 263, 263, 263 would be OK, but sending 262, 263, 262 will cause the screen to jiggle up/down.

You'll probably want to next look at replacing the 37 vertical blank WSYNCs and 30 overscan WSYNCs with the timer. Check this sample code from khryssun where he's using the timer for the vertical blank. The key things are setting the timer using TIM64T and checking if the timer is done using INTIM.

Edited by SpiceWare, Mon May 29, 2006 9:48 PM.


#33 nmoog OFFLINE  

nmoog

    Space Invader

  • 44 posts

Posted Tue May 30, 2006 6:08 AM

That's really cool - I was wondering where the game logic went!
I love your Medieval Mayhem game too - great idea.

#34 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,993 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Tue May 30, 2006 8:46 AM

View Postnmoog, on Tue May 30, 2006 7:08 AM, said:

I love your Medieval Mayhem game too - great idea.
Thanks! I decided to do it after getting my nephew's friends hooked on Warlords when I was visiting this past Xmas. Having grown up with PS2s, they'd been been slamming the Atari's graphics. They changed their tune once they realized graphics weren't everything :lol:.

If you'd like to see the source for it, it's available in my blog.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users