Open Gavin-Williams opened 1 year ago
So for my code, and this took me so long to work out. I had to put clc (clear carry flag) before calling adc #128. I don't know why the carry flag is set. But it interferes with the add in this case I guess.
Yes for each add or sub instruction you will respectively beed to clear or set the carry flag.This is peculiarity of the 6502. This his tripped me up many times too. Especially because you get inconsistent behavior there are times it works but also times it fails. Very hard to debug indeed. But again you got there and this is the true learning experience. Taking the subject matter and wrangling with it. I’m curious to see what you are making. Send it over once it’s done. Always fun to see what people create.Cheer,RaySent from my iPhoneOn 14 May 2023, at 05:56, Gavin Williams @.***> wrote: So for my code, and this took me so long to work out. I had to put clc (clear carry flag) before calling adc #128. I don't know why the carry flag is set. But it interferes with the add in this case I guess.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
@ line 109 lesson 7, you have...
adc #127
That is wrong, you must add 128 to access the lower half of the character, given the character map you provided. For example...
Top A : index = 1 Btm A: index = 129
So it should be
adc #128
So the question is then, why does it work with 127 in your program. Well, I don't yet know, but when I tried implementing the scrolling text, I have this test code that draws the letter A 5 times...
I get... AAAA BAAA
I found that the first character drawn is incorrect with 128, but the following characters are correct. I just can't see what's wrong, but I'm certain that you have to add 128 and not 127.
Here's a simplified program that tries to write 5 letter A's but has the incorrect bottom A in the first position.
https://1drv.ms/u/s!AhbcRtciy6_0jeAmUN9SrI6uQa3rfQ?e=O2rkGT