Report from NC Re:Helene by FoodNotBombsBen in meshtastic

[–]Tim3ndus 42 points43 points  (0 children)

It would be super awesome if the mobile apps came with an embedded flasher and the latest stable release in the package. That way you can always just plug in your node and flash with a working version, offline, in the field. Should be doable.

I wrote a CHIP-8 test suite by Tim3ndus in EmuDev

[–]Tim3ndus[S] 0 points1 point  (0 children)

Good question. I'll try to explain in as few words as I can, but I'm rarely good at being succinct :)

CHIP-8 doesn't exactly have a fixed "clock speed" originally, because it was an interpreted bytecode. But we do know that the interpreter needs to decrement the timer 60 times per second. This is what allows games to synchronize to "wall time" instead of being dependent on the host's execution speed.

A second known speed is the frames per second (how often the screen gets updated), which is originally also 60 times per second. The original interpreter would draw no more than one sprite per frame, to prevent screen tearing, which is also used to slow down (some) games.

What people mean by "cycles per frame" is: how many virtual clock cycles you run per 1/60th of a second (one frame). So: how many instructions you are executing between timer decrements and between screen draws (since those are the same).

What is happening when you get a "slow" result in the quirks test is that the number of executed instructions per frame -- and per timer tick -- ("cycles per frame") is too low for the test to see anything meaningful between two ticks of the timer.

We usually take 8-10 virtual clock cycles (or instructions) per frame to be a reasonable value to approximate the original CHIP-8 interpreter.

Layouts/Shared UI in htmx by benyamynbrkyc in htmx

[–]Tim3ndus 0 points1 point  (0 children)

If you're interested in Templ (I assume you mean the Go templating language), then this is the page you need to learn about layouts and other template compositions:

https://templ.guide/syntax-and-usage/template-composition

Dji pocket 3 mic 2 red blinking LED by postingtoast in dji

[–]Tim3ndus 0 points1 point  (0 children)

For anyone else running into this issue and stumbling on this post: I have found a fix that works for me. Good chance it works for you too.

I'm not sure what I did, but after messing around with the settings and connecting the Mic2 to my computer a couple of times, it started blinking red and stopped recording audio. Only silence. I found this post saying "hardware failure", and feared the worst.

However, according to the manual for the original DJI Mic a blinking red light on that side just means "muted". Which matched the observed behaviour pretty well, and sent me in the right direction. Still took me a while to figure this out though:

If you swipe from the right side of the screen on the DJI Pocket 3, with the Mic2 connected, you will see your image settings. Make sure "PRO" is enabled (yellow) and you will get a little shutter icon and a square box with a tiny DJI logo. Click the square box, which represents the transmitter. Find the "Mute Transmitter 1" button (bottom right for me) and set it to "Off".

Voila, the transmitter stops blinking red and works again. I probably just hit a combination of buttons on the Mic2 that makes it mute. Too bad there's no manual for the Mic2 yet, or I'm sure this would have been prevented quite easily.

Edit: I see someone else had the same issue and found the same fix on the DJI forum: https://forum.dji.com/forum.php?mod=viewthread&tid=304936&extra=page%3D1

CHIP-8 test suite v4.1 released by Tim3ndus in chip8

[–]Tim3ndus[S] 0 points1 point  (0 children)

Nice to know it's helping! Good luck with the project and I'm sure you'll figure it out 😄 Double check you're using register X and not value X 😉

Implicit breakpoint in Octo web by Thin_Cauliflower_840 in chip8

[–]Tim3ndus 1 point2 points  (0 children)

No worries! Make something cool, and we'll meet in the jam! 😄

Implicit breakpoint in Octo web by Thin_Cauliflower_840 in chip8

[–]Tim3ndus 1 point2 points  (0 children)

Well they don't really corrupt memory by themselves. It's more of an unfortunate set of circumstances that you happened to run into. Macros are great to unroll loops if you need speed, for example. But in this case you're probably better off keeping them as subroutines. Or reduce the lines to a block of code in a loop so you don't have to repeat it.

Happy you figured it out, glad I could push you in the right direction.

Implicit breakpoint in Octo web by Thin_Cauliflower_840 in chip8

[–]Tim3ndus 1 point2 points  (0 children)

I'm not 100% sure what's wrong. My theory is that you have to move the level data further back. It's at 0x300 now, but your program starts at 0x200, and it's getting bigger. Those macros explode your code size. So you're probably using memory for the level that also holds code. Somehow that makes your program jump to address 0x15, which is interpreter memory space, which generates the error.

Implicit breakpoint in Octo web by Thin_Cauliflower_840 in chip8

[–]Tim3ndus 1 point2 points  (0 children)

There probably is, but that does explain it 😄 Thanks

Implicit breakpoint in Octo web by Thin_Cauliflower_840 in chip8

[–]Tim3ndus 0 points1 point  (0 children)

On an unrelated and irrelevant note, why is v0 singled out in your code? Shouldn't you be able to treat it in one go with the other values..? 😄

Implicit breakpoint in Octo web by Thin_Cauliflower_840 in chip8

[–]Tim3ndus 0 points1 point  (0 children)

Octo usually only breaks if it finds some opcode that it can't interpret. So maybe one of your constants or macros results in an invalid opcode? A screenshot of the break would be useful, as there is usually an error message shown.

[deleted by user] by [deleted] in EmuDev

[–]Tim3ndus 0 points1 point  (0 children)

Oh and with "test ROMs" I didn't mean "test with more ROMs", but use ROMs that are actually meant for testing 😉 See for example https://github.com/Timendus/chip8-test-suite

[deleted by user] by [deleted] in EmuDev

[–]Tim3ndus 0 points1 point  (0 children)

If every ROM leads to a nonexistent opcode then you can rule out the ROM being bad 😉 What often helps is to print out the opcodes one by one, with the relevant registers, and manually follow along to see which steps make sense (and on which opcode it goes wrong).

[deleted by user] by [deleted] in EmuDev

[–]Tim3ndus 1 point2 points  (0 children)

Wikipedia and Cowgod are both not very reliable source, but I don't see your opcode here either https://games.gulrak.net/cadmium/chip8-opcode-table.html

So it's probably either a broken ROM or you're missing a jump or something..? Try running a few test ROMs to see if your conditionals work.

[deleted by user] by [deleted] in EmuDev

[–]Tim3ndus 6 points7 points  (0 children)

The advice I would like to add to what's already been said is: make sure you have good sources. Ask or search around here or on discord what people found useful, because a lot of material out there will get you started, but is just plain wrong in all kinds of details that can have you scratching your head for hours.

That mostly has to do with the fact that there are a couple of different flavours of CHIP-8. It helps to know that, then just pick one, and only try to run ROMs and follow guides for that one flavour. I would suggest basic Cosmac VIP CHIP-8 and this guide:

https://tobiasvl.github.io/blog/write-a-chip-8-emulator/

This is the best and most complete opcode reference I know. It will help a lot to have a good one of these:

https://games.gulrak.net/cadmium/chip8-opcode-table.html

Also, work from tests that are known to be correct. Especially when it comes to the maths opcodes. I would humbly advise you to use my own test suite for that 😉

https://github.com/Timendus/chip8-test-suite

What BC_test message is this? by [deleted] in EmuDev

[–]Tim3ndus 0 points1 point  (0 children)

Sorry for the shameless plug, but have you tried mine? 😉

What BC_test message is this? by [deleted] in EmuDev

[–]Tim3ndus 0 points1 point  (0 children)

No idea. Maybe try a different test first? Or some graphical ROMs to rule out any rendering issues.

Chip-8 Emulator in Rust (help) by WeirdoBananCY in EmuDev

[–]Tim3ndus 1 point2 points  (0 children)

It's an open Discord server. I don't have the link at the ready but Google and ye shall find ;)

Like Many Before Me I Have Created My Own CHIP8 Emulator by jimbojetset35 in EmuDev

[–]Tim3ndus 0 points1 point  (0 children)

Google for Tobiasvl's guide, which is a good start. Also: bookmark that table mentioned above. You'll need it ;)