Yaron Nir Posted May 5, 2019 Share Posted May 5, 2019 hello all, i was wondering what is the best way to set up a break code in my cc65 code and then break it in altirra while code is running. i am writing the code using sublime text editor. i can produce debug info through the linker. any help would be appreciated. cheers Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted May 5, 2019 Share Posted May 5, 2019 I would say nothing has changed since your first request from January this year: http://atariage.com/forums/topic/287714-how-to-truest-debug-a-cc65-code/ ... Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted May 5, 2019 Author Share Posted May 5, 2019 bummer I used the things in that post for many months now, but is still very un convenient..... ok, will have to wait till something good will come up someday i can dream Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted May 5, 2019 Share Posted May 5, 2019 I used the things in that post for many months now, but is still very un convenient..... ok, will have to wait till something good will come up someday i can dream A cold comfort, but compared to the tools you've had while the A8 was commercially successful, this is complaining on a very high level. I guess your dream needs a long sleep. Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted May 5, 2019 Author Share Posted May 5, 2019 ? Quote Link to comment Share on other sites More sharing options...
sanny Posted May 5, 2019 Share Posted May 5, 2019 Just insert a "brk" instruction and tell your emulator to break when a brk instruction is executed. Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted May 6, 2019 Author Share Posted May 6, 2019 Sanny, inserting break using asm directive ? Asm(Brk); Or similar? Quote Link to comment Share on other sites More sharing options...
sanny Posted May 6, 2019 Share Posted May 6, 2019 yes, use asm("brk"); Quote Link to comment Share on other sites More sharing options...
danwinslow Posted May 6, 2019 Share Posted May 6, 2019 That certainly works, but I'm not sure you can see the C source lines using CC65 compiler. Maybe that's been solved since last I tried. Yaron, my advice is to just go ahead and put in the effort to learn to code in assembler. C is easier, of course, but my experience has been that if you're doing any serious game programming you'll find you need to drop into assembler a lot anyway. I have done low-level stuff in CC65 like mouse drivers and communications, but the extra cost in size and speed is really not worth it in the end. When going for speed, you'll get to the point where you're pretty much using C as just a macro assembler anyway and at that point you might as well just write it in assembler. For a long time I switched to using C as just a wrapper around a bunch of assembler, because I wasn't sure how get the executable format directly from assembler, but there's tons of reading material and I eventually figured it out. Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted May 7, 2019 Author Share Posted May 7, 2019 you can choose options in compile time to add debug info. Then once you break you can review the source code and step into and step out the CC65 functions. it is ok, but not like visual studio debugger for example..... i know assembly. just don't like it much. if there is a high level language that performs well, why not use it. tough parts can be wrapped with asm..... Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted May 7, 2019 Share Posted May 7, 2019 Often when generating debug versions of code it is better to also limit the optimizations but I don't really know if that applies to CC65 & Altirra Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted May 7, 2019 Author Share Posted May 7, 2019 Often when generating debug versions of code it is better to also limit the optimizations but I don't really know if that applies to CC65 & Altirra well, in my tests i kept the optimization command line options and it was working partially, meaning, not all the cc65 code was debugable..... Quote Link to comment Share on other sites More sharing options...
danwinslow Posted May 7, 2019 Share Posted May 7, 2019 well, in my tests i kept the optimization command line options and it was working partially, meaning, not all the cc65 code was debugable..... Right, it will unroll and or remove some stuff during optimization. I always kept if off when debugging. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.