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: 1055
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: 5017
31981.909 basic bytes free

sorry but..

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

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

Registered: Apr 2002
Posts: 2839
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: 490
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: 490
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
Airwolf/F4CG
Alakran_64
Apollyon/ALD
megasoftargentina
katon/Lepsi De
E$G/hOKUtO fOrcE
CA$H/TRiAD
TheEnemy/TREX/THD
Lord Crucifier/SCS*TRC
Martin Piper
Guests online: 122
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Antitrack  (9.8)
4 Mr Zero Page  (9.8)
5 OTD  (9.8)

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