Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2017-03-29 21:20:20

Anagarm
New member
Registered: 2017-03-29
Posts: 1

Modulus not working with lcc?

Hello,
I started working on a game a couple days ago and the modulus operator isn't working with UINT32. Here's a code snippet:

Code:

UINT8 map6[6];
UINT32 score;
UINT32 longX;
void drawScore() {
    //convert score to tiles
    for (i = 1; i <= 6; i++) {
        longX = 10;
        for (x = 1; x < i; x++)
            longX *= 10;
        map6[i - 1] = 53 + (score % longX);
    }
}

However, when I compile it with lcc, I get the following errors:

Code:

?ASlink-Warning-Undefined Global __modulong referenced by module lcc21840

?ASlink-Warning-Undefined Global __mululong referenced by module lcc21840

What am I doing wrong?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson