| |
McKrackeN
Registered: Feb 2011 Posts: 20 |
Writing a C64 emulator - Error in "bytes free"
Hey guys,
I'm writing a C64 emulator and I'm stuck with an issue: when showing the welcome screen, it shows "31981.909 basic bytes free" instead of the correct value. I've read the memory in addresses $37 and $38 and it shows $A000. I've reprogrammed ADC and SBC routines a couple of times but the result was worse (it shows 0 bytes). :(
Where do I have to focus my bug searching? I'm really lost here.
Thanks! :D
Cheers! |
|
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Run Klaus Dormann's test suite to verify all opcodes: https://github.com/Klaus2m5/6502_65C02_functional_tests |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
31981.909 basic bytes free
sorry but..
haha ! :D |
| |
iAN CooG
Registered: May 2002 Posts: 3193 |
|
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quoting McKrackeN31981.909 basic bytes free! That is indeed funni :D |
| |
McKrackeN
Registered: Feb 2011 Posts: 20 |
Yeah, I know! hehe
But it's really frustrating... If it showed 0 or other integer number, it would be easier to track down the bug, but with a decimal number?! WTF! :P |
| |
Skate
Registered: Jul 2003 Posts: 494 |
My guess is some remaining bug at flag handling, probably carry flag. Some opcode might be affecting/not affecting a flag correctly which causes incorrect float point results.
I would log processor states after each opcode execution and compare them with Vice or any working emulator. Diff is your friend. :) |
| |
McKrackeN
Registered: Feb 2011 Posts: 20 |
Thanks Skate! You were right! I was clearing Carry flag in TAX, TAY, TYA, etc. when I shouldn't. :)
Woohooo! :D |
| |
Skate
Registered: Jul 2003 Posts: 494 |
i'm glad i could help. |