Hello :)
Regarding this source code for a random function:
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdlib/rand_r.c;hb=HEAD
How do you call it to get a random number?
I have...
Type: Posts; User: xArt
Hello :)
Regarding this source code for a random function:
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdlib/rand_r.c;hb=HEAD
How do you call it to get a random number?
I have...
Yes ok thanks :) Really just anything above 0.5 to the next integer will do for now.
I’m using an old C30 compiler that doesn’t have round() functions in math library.
You didn’t catch that I...
Hi Guys,
I have a situation where a float calculation is made,
and the result is converted back to an integer.
Is there a neat solution to convert to the nearest integer,
rather than just...
Slow, Very, The closer the better.
Something I realised, I have a function implemented to rotate a point about an origin for graphics x/y coordinates.
So if the point starts 16384 units under the...
Hi Guys :)
I have this sine table for various things in a program such as sine
text and plasma that I’ve been using for the last million years.
Now programming for a micro, and with code running...
It will be some time before I can try. I just came back to thank you for the replies :)
It’s being sent to an API for file IO for the intended platform which was Sony PSP, and have similar file IO functions for other platforms.
I can’t pretend to follow it like execution, but...
Hi Guys,
I’m trying to port a file browser from one platform to another, and trying to avoid using any new C functions if possible.
I’m reading this link:
The GNU C Library: Aligned Memory...
Thanks for the replies :)
I’m programming for dsPic micro at the moment with Microchip C30 compiler.
Memory is tight (RAM), and there comes a point where if I make an unsigned char array a const...
Hi Guys :)
I try to do my own research, but some questions I can’t express well into Google.
Basically, I’d like to know if I’m correct about some things I just assume at the moment.
int n;...
Thanks :)
I had procedure worked out, but couldn’t get it rolled into a loop.
I was wasting time anding the bytes with different bit masks.
Simply look at a vertical row, say all bit 7 for...
Hi Guys :)
I’m looking to bitwise rotate an 8 byte array by 90 degrees clockwise, so this:
unsigned char shape[8] = {
0b00011000,
0b00111100,
0b01111110,
0b11111111,
0b00000000,
Hi Guys :)
I was hoping someone has some example to convert a Human
time & date values to a number of seconds from an epoch moment.
Other C platforms I’ve used have an API to handle conversion for...
Hi Guys :)
What is the height on the Y axis of a 1 meter vertical stick with no thickness,
that is tilted 45 degrees?
If the answer is 50cm, will it take a sin function to work it out at every...
Ok, I will try it, thanks :)
Hi Guys,
I am hoping it would be obvious to someone how this sin table was generated.
This is from a retro plasma demo, and is running fine on a dsPic so fast now
that I have to delay it. I...
Lol but I already did the thing :D
The next step would be tilting any vertical line of a complete character, but I dont think its needed.
This would make more sense (last part of the video).
I don’t think I have to tilt the characters for the effect I want.
https://www.youtube.com/watch?v=bN-XRXLx88Y
You have to click the “To Plain Text” button for the images in code to align properly.
The code so far is to compress a single line of the char graphics which are all five bit wide, but obviously...
Hi again :)
So I haven’t had much programming time, but recently finished that step handling five bits.
I went for... if the bit either side of the centre bit was set, the new middle bit will be...
There are complete programming tutorials independent of language for Tetris online.
then you only have to worry about the specifics of your particular task.
I would have been interested to see...
Hi, yes sorry I didn’t explain well, that was just my eight bit example to show I was essentially doing the same thing,
and the clearing of the first three bits was thrown in there when I realised...
Hi, that is similar approach that I have so far.
No I’m not complaining it’s too slow yet, just checking I’m not doing anything stupid :)
There will be a lot of these operations.
Here is a...
Hi Guys,
I want to shift a byte from the left and right so that it becomes more condensed in the middle for each iteration.
also shifting zeros in either direction so the original value will always...
It’s a 16 bit dsPic doing the drawing to LCD, should have more RAM than low range pics.
I do at least know SD card filesystem routines exist, and do work for it.
People I know on the...