Whats Gone Wrong - Pixels Everywhere!

edited September 2007 in Development
Changed one small piece of code, that doesnt do anything to the screen and the following has happened:

pixel.jpg

None of the pixels line up with any parts of the previous text and if follows a definate pattern. I have spent most of the evening trying to track this down.

Before I go any further I wondered whether anybody else had seen a similar pattern?

Change the code back and its fine again, but not what I want!

Carl
Post edited by carlinski on

Comments

  • edited September 2007
    I'm willing to bet the line of dots above "You are carrying a wallet of matches..." is a copy of the centreline of that text. The right hand side of the first line of junk also looks like it belongs to "Various parts", and the tail end of the LHS matches "Exits lead to".

    Suggests you have inadvertently messed with the rendering or scrolling code. ;-)
  • edited September 2007
    The first question that comes to mind is how much memory do you have available and are you overwriting some part of the scroll code / scroll buffer :)

    Or perhaps the stack is being polluted.
  • edited September 2007
    My first thought was the stack, but within the debugger in Speculator it gives your the stack pointer, which never moves after the function is called.

    I have a function called displayObjects, which when called normally is fine. When called with the A register set to FF, it is designed to display the objects carried, which it does, but causes the pixel problem.

    I think your right though, the pixels do follow a pattern of previous lines (nearly but not quite). I will relook at the scroll routine, which doesnt use any buffers, just the LDIR command. Is there anything to beware of there?

    Carl
  • edited September 2007
    If your problem happens only with A register set to FF maybe the problem is unexpected carry or zero flag set on when increasing A (and it won't happen with any other value of A). Check also if number of PUSH commands equals number of POP commands and you are pushing and popping the same registers. It is a silly mistake but it happens to everyone sometimes.
  • edited September 2007
    Oh Bugger. 5 hours wasted, just because a jump command was 1 byte out. Whoops. At least I found it, and this gives me more inclination to make my development tool pick out errors like this.

    Thanks for your assistance along the way. Just nice to know your not on your own!
Sign In or Register to comment.