Jump to content



0

Coordinate System Messed Up


3 replies to this topic

#1 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Sat Nov 21, 2009 9:50 PM

In my game the y register holds the scan line the Atari in currently drawing. The y register starts at 191(top) and continues to decrement until it reaches the final scan line(1) after which it goes into vertical blank. However for some reason, i have the constant TOPDINOY which is equal to 80 in hexadecimal and the top Dino in being drawn at the very bottom of the screen. In another constant called BOTTOMDINOY equal to 40 in hexadecimal, it is being drawn above the top Dino. According to the scan list count the top Dino should be drawn somewhere close to the center of the screen and the bottom Dino 40 scan lines lower but, not at the very edge. I have attached my assembly code as a reference. Could someone please help me?

Sincerely,

Dino Dash Derby



#2 Wickeycolumbus OFFLINE  

Wickeycolumbus

    River Patroller

  • 4,064 posts
  • Location:Michigan

Posted Sat Nov 21, 2009 10:11 PM

When using constants, you must put the number sign before the name of the constant, otherwise DASM will think it is an address.

For example:


Constant    equ $3F

    lda Constant   ;loads address $003F
    lda #Constant  ;loads the immediate value #$3F


Attached is a fixed binary and source.

Attached Files



#3 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Sat Nov 21, 2009 10:22 PM

View PostWickeycolumbus, on Sat Nov 21, 2009 10:11 PM, said:

When using constants, you must put the number sign before the name of the constant, otherwise DASM will think it is an address.

For example:


Constant    equ $3F

    lda Constant   ;loads address $003F
    lda #Constant  ;loads the immediate value #$3F


Attached is a fixed binary and source.
I figured it was going to be something very silly on my part. :( Thanks for fixing my code, i really appreciated it. :)

Sincerely,

Dino Dash Derby

Edited by Primordial Ooze, Sat Nov 21, 2009 10:22 PM.


#4 Wickeycolumbus OFFLINE  

Wickeycolumbus

    River Patroller

  • 4,064 posts
  • Location:Michigan

Posted Sat Nov 21, 2009 10:26 PM

No problem :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users