Try out the full debugger here. Drag and drop an Arduboy game (.hex/.elf/.arduboy) and any FX data (.bin) onto the page. Note that using an ELF file allows greater access to debug info.
Ardens releases include a minimal player with debugging features excluded: you can try it online with one of the game URLs below:
For the past couple of weeks Iāve taken a break from my RPG to develop this tool. Itās not finished but I think itās good enough to share. Its main purpose is for asm debugging and finding performance bottlenecks, but it also makes grayscale development a bit easier.
I sort of wish I understood assembler now., this looks really good and I was wondering how I would test games that use greyscale with my current methods (web-version of project ABE).
The web site is tiny and looks āhard-codedā to a particular resolution. Is there a simple way to fix that?
Darn, sounds like a high DPI issue. I tried for a while but wasnāt able to figure out how to properly make SDL and emscripten work nicely with high DPI. So Iāve just disabled it for the web build. The sizing should be correct now but things will be a bit blurry ā Iāll try to revisit it later.
Assembly really isnāt all that difficult, itās just horribly tedious to read and write compared to structured programming because each instruction is so āatomicā.
I recommend reading the Wikipedia article to get an idea of what the registers and status flags are used for and then keeping the instruction reference open to refer to.
Eventually youāll start memorising the instructions that occur quite often. E.g. LPM is likely to come up a lot - thatās the one that reads a single byte of data from progmem.
Overall AVRās not too bad - it only has about 128 instructions and very few quirks.
Itās a far cry from x86, which has had thirty-odd years to accumulate new instructions and features, and evolved over time from 16-bit to 64-bit.
Oh, I did a lot of assembly on the 6502 in the mid-80s. I have an electronic book on AVR assembly which I was slowly working through ⦠unfortunately, have forgotten everything I knew and I just do not have the time to invest in it.
LDA, lDX, LDY, BMI, BNE, BPL ⦠I still remember a lot of the 6502 instruction set. But then again, it only had about 50 instructions. It was the first, unintentional RISC chip. The Z80 had 600 or so codes - total 8bit CISC.
Iāve never so much as touched a real 6502, but I started writing a NES emulator once, so I have some experience with it.
(Technically the NES used a Ricoh 2A03/Ricoh 2A07, not a MOS 6502, but the only difference was the lack of a BCD mode.)
But a dozen different addressing modes!
(Half the reason I gave up on the emulator. The other half being the NESās PPU.)
Iāve always found the choice of ābranch on minusā and ābranch on plusā to be odd naming choices (compared to e.g. ābranch on negative setā and ābranch on negative clearā, or ābranch on negativeā and ābranch on positiveā), but AVR followed suit with BRPL and BRMI.
Again, I have a bit of experience due to forays in emulator writing, and some general CPU research.
The Game Boyās CPU, the Sharp LR35902, was a sort of hybrid of Z80 and 8080.
This is amazing! From a quick test, Iām reminded that HEX files have no symbols, so you need to drag in an ELF file to get useful labels in the disassembler and stack trace.
The tool is looking great I like the different colored symbols from elf and that you can click on calls/addresses. It would be great to have a symbol list and / or being able to search for a symbol in the disassembly.
I noticed that inthe simulator the buttons are āAā and āBā keys. Could āSā be added as a redundant button for āBā
just played with the profiler part and itās great also like the cycle counting on the disassembly Noticed the ijmp instruction counts 3 cycles instead of 2 cycles.
looks like I may soon no longer need to look at manually disassembled elf files for debugging
The desktop version can also intermix source code and assembly, objdump style. But since ELF only contains source file names, not the source data itself, the web version canāt do that. In the future I hope to load local var info for each stack frame as well as type info so global/local vars can be pretty printedā¦
Wow, nice catch!
New symbols window (click to jump to that symbol in disassembly)
Jump to function dropdown:
EDIT: Also āSā is now an alternate input for the B button.
Thanks for adding the symbols and S key as alternate B button.
Also nice to see the symbols are sorted alfabetical and all labels can be listed. I often use a line asm volatile(ādbg:\nā); in my code to optimize / debug code so it will be easy to find in the sorted list.
Cool! thereās a desktop version too? and with even more features?
Something odd I noticed while I ran the helloworld FX example. When simulating it I noticed the text didnāt scroll. Looking into it, it looks like __do_copy_data doesnāt copy the data section to ram correctly. like the lpm r0,Z+ instruction only reads zeros?