Search found 336 matches

by matteus
Tue Sep 20, 2016 6:09 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

I use code::block
by matteus
Tue Sep 20, 2016 1:55 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

yes I've changed the flag, I tried recompiling the libraries as well
by matteus
Mon Sep 19, 2016 7:14 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

Code: Select all

main.c|| undefined reference to `sqrttab16'|
main.c|| undefined reference to `sqrttab16'|
by matteus
Mon Sep 19, 2016 7:13 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

Thanks! and this one

u16Happiness = u16Happiness + Round(((u16Popularity * 10) / 1000) / 4)

I'm guessing I don't need to change as a standard int will just truncate? lol
by matteus
Mon Sep 19, 2016 6:56 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

Having had a good look at the maths support I don't think it's possible for me to do with fix16 via the math functions as u16Popularity goes up to 100 and u16EnergyCommitedPerTourDate goes up to 1000.
by matteus
Mon Sep 19, 2016 6:11 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

if anyone knows how you'd write this without floating point as an SGDK equivalent I'd be very impressed (grateful)!

Code: Select all

round((sqrt(u16Popularity + u16EnergyCommitedPerTourDate) * 1000) / 120)
by matteus
Mon Sep 19, 2016 5:14 pm
Forum: SGDK
Topic: random number seeding issue
Replies: 14
Views: 2804

Re: random number seeding issue

okay I almost understand :) So do I call setRandomSeed after VDP_waitVSync? and if so what do I need to put into the Random Seed? What functions can I call to get the event time?
by matteus
Mon Sep 19, 2016 5:02 pm
Forum: SGDK
Topic: sprintf speed nightmare
Replies: 8
Views: 1419

Re: sprintf speed nightmare

You'll notice further down I used a strlen on Verse1.charLine1Part1, I have to store this in char to get it's length later on in the code :)
by matteus
Mon Sep 19, 2016 4:58 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Re: Small floating point numbers

It's based on old ZX spectrum basic which seems to allow for float point numbers in some weird way!
by matteus
Fri Sep 16, 2016 11:06 am
Forum: SGDK
Topic: random number seeding issue
Replies: 14
Views: 2804

Re: random number seeding issue

So does that basically mean my software will only work properly on proper hardware? :/
by matteus
Thu Sep 15, 2016 8:13 pm
Forum: SGDK
Topic: Small floating point numbers
Replies: 29
Views: 3225

Small floating point numbers

I've a few numbers that are .8, 1.2, etc and was wondering how I'd use those in the SGDK? :)
by matteus
Thu Sep 15, 2016 8:12 pm
Forum: SGDK
Topic: sprintf speed nightmare
Replies: 8
Views: 1419

Re: sprintf speed nightmare

Noticeable too! :) Thank you so much
by matteus
Thu Sep 15, 2016 9:37 am
Forum: SGDK
Topic: Function to generate random within specific range
Replies: 4
Views: 856

Re: Function to generate random within specific range

P.S you've just helped me no end! I'm really grateful :)
by matteus
Thu Sep 15, 2016 9:25 am
Forum: SGDK
Topic: Function to generate random within specific range
Replies: 4
Views: 856

Re: Function to generate random within specific range

Code: Select all

x = (random()%finishInt-1)+1;

Is this right?
by matteus
Thu Sep 15, 2016 8:52 am
Forum: SGDK
Topic: sprintf speed nightmare
Replies: 8
Views: 1419

Re: sprintf speed nightmare

strcpy(Verse1.charLine1Part1, Lyrics.charLine1Part1[randomNumberGenerator(10)]); strcpy(Verse1.charLine2Part1, Lyrics.charLine1Part1[randomNumberGenerator(10)]); SYS_disableInts(); VDP_drawText(Verse1.charLine1Part1, SONG_TEXT_START_COLUMN, SONG_TEXT_START_ROW+7); VDP_drawText(Lyrics.charLine1Part2...