| |
Trap
Registered: Jul 2010 Posts: 223 |
8-bit appreciation lesson
I spent the last 48 hours in the worst possible situation - debugging my own machine code. Got to the point of almost giving up - I even considered asking somebody for help, which in my book is total defeat. Thank god, I finally caught the bug. As always, the machine works as told and yet again my own mindless typing was the cause of the bug. Just cannot blame binary logic for sluggish code :)
Funny how these sessions of hellish debugging just make you love that old breadbox even more when you finally get your code running. I guess it's a complicated love/hate relationship few people would ever understand, but if anybody in the world could appreciate the situation, it is you guys in here :)
/Trap Crap Wrap |
|
| |
Acidchild
Registered: Jan 2002 Posts: 474 |
Nice...but where's the new bonzai-demo??? |
| |
Oswald
Registered: Apr 2002 Posts: 5086 |
once I wrote lda $40 instead of lda #$40 or smth like that. it all worked fine in turbo ass (was devving on real machine!), but didnt work when linked.
luckily it was in the init part, so soon after I lost all hope and started going trough line by line in monitor somehow found it.
so, yes, we know :) |
| |
lft
Registered: Jul 2007 Posts: 369 |
Related: http://linusakesson.net/programming/kernighans-lever/index.php |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
that unreleased Bonzai demo i have seen at Jeff place, is good enough to be released! :) |
| |
Bago Zonde
Registered: Dec 2010 Posts: 29 |
Yeah, few days ago I had some displaying issue. Rows with graphic were drawn on the screen properly but the last single 8x8 block from the first line wasn't. Why this one?! After 1 hour of debugging it from the very end (I was going backward as I thought the problem is somewhere else) - finally I found I'm so lame. IRQ has started to drawing these lines while start up init was in progress and it was clearing the screen area :D. It would be easier to find it if bigger part of a screen would be cleared for example. Sync everything, that's the key! Such a great reward finding this small bug as I was really confused! Simple code, no rocket science there but punch into your face ;). That was a good lesson for me also! |
| |
ThunderBlade
Registered: Jan 2002 Posts: 77 |
Trap, you are probably an at least 10 times better coder than me, but rest assured that I understand. :) |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
I still do that.
I start work on some code and while working on that code, another idea hits, so I work on that and while working on that, another idea hits, repeat until you have 30 or so parts, all 30-50% done.
I went to work on my rasma code, which is about 7 or 8 years old, and I have several versions of it. I couldn't figure anything out and it had me wondering if I even coded it.
I hate when that happens ;) |
| |
Mixer
Registered: Apr 2008 Posts: 447 |
Turning kernel on/off also changes which IRQ/NMI/BRK vectors the machine uses. When unmanaged this causes program execution to continue from some some odd place in memory depening on stack and what happens to be in the vector addresses. (also seems to crash VICE in some cases btw.)
One time it happened that the NMI vectors 0318/0319 values and fffa/fffb under the kernel both pointed to different but valid code. So, by changing the $01 value, the program started running an effect from the next demopart while still running rest of the first part with raster IRQ. Very C-64 thing to happen. |
| |
algorithm
Registered: May 2002 Posts: 705 |
At one time there was this digitized audio part that kept on crashing. The routine would be transferred to zero page and the nmi would run from there. However the code as it was assembled used self modifying code that would originally change the values where the code was originally located. Sometimes the demo would crash, sometimes it would work fine.
Another occurance, i had forgot to ack dd0d at some stage which would cause some random crashes in the next nmi part |
| |
Krill
Registered: Apr 2002 Posts: 2969 |
Your all lame. |
| |
Trap
Registered: Jul 2010 Posts: 223 |
Je suis lamer :) |