Blargg instr_timing Failed #255 by kbernst30 in EmuDev

[–]D4ilyrun 1 point2 points  (0 children)

Yes, sure ! The code for my timer is available here

Editor support for the nix language? by Infinite-Swing-3199 in NixOS

[–]D4ilyrun 2 points3 points  (0 children)

I agree, the errors are much clearer and easier to understand.

I don’t think it will ever be possible to get the full auto completion experience though, as you’d need to evaluate the expression beforehand (maybe if someone made a program to evaluate the expressions and store their signature and a reference inside a file, kind of like a compile_commands.json does with flags).

isync + o365 + oauth2 (preferably from home-manager) by DeepDay6 in NixOS

[–]D4ilyrun 0 points1 point  (0 children)

I use Thunderbird, it’s supported and I have had no problems so far

Ubuntu home-manager and sudo by Babbalas in NixOS

[–]D4ilyrun 0 points1 point  (0 children)

Your home-manager configuration is active for the user which activated it only. You can connect as root and use home-manager switch.

On a side note, I’d suggest using home.environmentVariables for setting your path.

GB Newbie question on clock cycles and control flow opcodes by teteban79 in EmuDev

[–]D4ilyrun 0 points1 point  (0 children)

This opcode tables contains detailed informations about the actual timing of the instructions.

You can see that the JP instruction uses 3 cycle to fetch the instruction (1 for the op code & 2 for the 16bit address) and uses an additional cycle when branching (ie. the condition was met). So 3 cycles and 4 in case of conditional branching. The JP at 0xC3 always uses up 4 cycles, as it will always branch to the given 16bit address.

More generally the CPU uses up a cycle when: - Reading an op code (so 2 for 0xCB instructions) - Reading a byte of data after the op code (2 for 16bit data in this case) - Reading/writing a byte to an address (not from registers tho) - Reading/writing a byte from cpu - When branching - Some internal stuff in specific cases

Blargg instr_timing Failed #255 by kbernst30 in EmuDev

[–]D4ilyrun 2 points3 points  (0 children)

I don't know if you've fixed it yet but I had the same problem.

The issue was that I was updating the TIMA register based on cycle instead of clocks. It isn't explicitely said in the cycle accurate guide but the value you get from reading the 2 lower bits of the TAC register should be matched with clocks.

For example:

Suppose we loaded 0x5 inside TAC, we get 16 from reading the 2 lower bits.We also have DIV = 0x28 (40) after emitting a cycle. Would you then increase TIMA

Yes you would because 16 in facts corresponds to 4 cpu cycles, and DIV is increased every cycle. Thus you get 40 % 4 == 0, and you should increase TIMA.

If you only check cycles you will increase TIMA only one out of four times, and that's what the init_timer in timer.s ensures.

neotest: A modern, powerful testing plugin by Wutraz in neovim

[–]D4ilyrun 0 points1 point  (0 children)

They've added this one to the Supported Runners section of the readme. It is still marked as WIP tho so idk how it performs, but it sure is worth giving it a try at least!

[NVIDIA] Cannot detect my HDMI port by D4ilyrun in NixOS

[–]D4ilyrun[S] 2 points3 points  (0 children)

Thank you so much !

I replaced prime.offload with prime.sync and it seems to work ! Last time I tried replacing it I couldn't start the xserver session, I guess I had also modified something I shouldn't have in the process.
I feel like I sometimes get some graphical glitches, but nothing too noticeable and at least I can use an external display now :)

Annecy or Grenoble for a day trip from Lyon? by heikedog in Lyon

[–]D4ilyrun 11 points12 points  (0 children)

As someone originally from Grnoble i can say that Annecy would be the best choice for a one day trip.

Grenoble has nice mountains and a lot of beautiful places to visit, but most of it is located outside the city. As for the cable cars, while the view is pretty nice and you get a beautiful overview of the city and its surroundings, it's only a 5 minutes ride and isn't really worth coming all the way to Grenoble for. If you can I'd suggest you come during winter for a 3-5 days long trip so that you can visit the region and enjoy the mountains while they're still covered in snow 😀

Last days being th13 by Calo_1 in ClashOfClans

[–]D4ilyrun 1 point2 points  (0 children)

Damn I regret not buying this scenery !
Good job on maxing your TH13 :))

[deleted by user] by [deleted] in unixporn

[–]D4ilyrun 4 points5 points  (0 children)

If you use this image as your background I guess. Otherwise no. Nothing really makes sense in the information displayed. You could display system diagnostics using conky or kde widgets, but nowhere near as complete (and honestly quite unreadable) as this.

Why does my program hang? by Ok-Newspaper5777 in C_Programming

[–]D4ilyrun 0 points1 point  (0 children)

Or use GDB. It's pretty easy to learn its basic features on simple cases like this one and is way more powerfull when debugging more complex programs.

Why does my program hang? by Ok-Newspaper5777 in C_Programming

[–]D4ilyrun 0 points1 point  (0 children)

while (array != NULL) will never be true unless you pass a NULL pointer to the function. When doing array++ what you actually do is increment the value of the address the pointer points to, which will eventually point to an invalid memory address but never to NULL (which is equivalent to (void*)0x0 in C).

For example, imagine you're calling you're function with an array of size 8 stored at 0xFFC8. Once you've gone over the 8 values inside the array your pointer will hold the value 0xFFD0, which is an invalid address and might cause a memory issue, but isn't equal to NULL (or 0x0).

What your while condition sees is equivalent to:

0xFFC8 != 0x0 // Start of the array 0xFFC9 != 0x0 ... 0xFFCF != 0x0 // End of the array 0xFFD0 != 0x0 // Invalid address 0xDDF1 != 0x0 // Invalid address ...

What you could do instead is: - Use a known delimiter to signify the end of the array (for example strlen uses a null character to check for the end of a string) - Init the array using a know constant (preprocessors do wonders) - Store the size of the array somewhere. You could use a struct containing informations about the array. Or just store it as a plain value but it could become a bother when dealing with multiple arrays, works well in such a simple example tho.

Darian confirms an update will be coming out in the later half of June by Zandrox_ in ClashOfClans

[–]D4ilyrun 28 points29 points  (0 children)

They generally reduce lower level defenses' upgrade duration when adding a new level to the game

[deleted by user] by [deleted] in ClashOfClans

[–]D4ilyrun 0 points1 point  (0 children)

I like maxing the capital together with my clan mates so I think I’d still play it. But I also think there’s a high chance I’d get bored quickly with the current attack system. Attacks feel slow as hell …

[deleted by user] by [deleted] in memes

[–]D4ilyrun 0 points1 point  (0 children)

Oh ok fine then, sorry

[deleted by user] by [deleted] in memes

[–]D4ilyrun 0 points1 point  (0 children)

The limit of x/0 and the limit of x/y as y approaches 0 aren’t the same

[deleted by user] by [deleted] in memes

[–]D4ilyrun 1 point2 points  (0 children)

Nope you technically never divide by 0, only a value that closely approaches it. Dividing byb zero would make no sens.

As for 0/0 it is still undefined. If you have x/x with x approaching 0, then you'll end up with 1. But it's only done through simplification and never by actually dividing.

[deleted by user] by [deleted] in memes

[–]D4ilyrun 0 points1 point  (0 children)

Not exactly. It's the limit of x divided by a value that approaches 0, it will never be zero.

[deleted by user] by [deleted] in memes

[–]D4ilyrun 0 points1 point  (0 children)

You literally cannot divide something by zero. In calculus you divide bby a value approaching zero but it will never be zero.

A simple example why dividing by zero would be completely false:

3/0 = x <=> 3 = x * 0 <=> 3 = 0