Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Writing a C64 emulator - Error in "bytes free"
2016-05-01 18:13
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!
2016-05-01 18:32
MagerValp

Registered: Dec 2001
Posts: 1078
Run Klaus Dormann's test suite to verify all opcodes: https://github.com/Klaus2m5/6502_65C02_functional_tests
2016-05-01 19:37
Oswald

Registered: Apr 2002
Posts: 5094
31981.909 basic bytes free

sorry but..

haha ! :D
2016-05-01 20:37
iAN CooG

Registered: May 2002
Posts: 3193
2016-05-01 21:03
Krill

Registered: Apr 2002
Posts: 2980
Quoting McKrackeN
31981.909 basic bytes free!
That is indeed funni :D
2016-05-01 21:29
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
2016-05-01 23:15
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. :)
2016-05-02 00:57
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
2016-05-03 03:28
Skate

Registered: Jul 2003
Posts: 494
i'm glad i could help.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
The Human Co../Maste..
E$G/HF ⭐ 7
Hoild/Ultimate Newco..
Chesser/Blazon
El Gato
Steffan/BOOM!
aNdy/AL/Cosine
v3nt0r/ibex-crew
t0m3000/hf^boom!^ibx
MCM/ONSLAUGHT
Fred/Channel 4
Hobbit/Laser Inc.
REBEL 1/HF
acrouzet/G★P
Krill/Plush
Guests online: 133
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.072 sec.