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.
Hello everyone!
[EDIT]: resolved (by Toxa! thanks!), I didn't declare the variables in the right place! Thanks!
I'm new here, the usual, interested in making gameboy games, have experience in coding but not the c language (a little rusty). Thank you all for this place existing. So I've been having an issue when compiling, it keeps giving me this error:
main.c:8: error 7: Old style C declaration. IGNORED 'pause' main.c:22: error 101: too many parameters main.c:28: error 101: too many parameters First line mainly, the other two are just when I call that function 'pause'.
The error message comes from SDCC but I'm in way over my head here, although you will see the code is very simple. I was actually doing the « GBDK Joypad Tutorial (program 2) » on this very website: link (and tweaking it to try & get rid of the delay function). I tried removing the for loop and put a while instead, same issue.
Here's the entire app:
#include <stdio.h> // include this file for the printf() function
#include <gb/gb.h> // include this file for Game Boy functions
#include <stdint.h> // Include this file to use std types such as uint8_t
uint8_t i;
uint8_t loops;
void pause(loops){
for(i = 0; i < loops; ++i){
wait_vbl_done();
}
}
void main(void){
while(1){
printf("Please press A?\n");
waitpad(J_A);
printf("You pressed A!\n\n");
pause(10);
printf("Hold down LEFT?\n");
waitpad(J_LEFT);
printf("You're holding down LEFT!\n");
waitpadup();
printf("You've released LEFT!\n\n\n");
pause(10);
}
}Anyone able to help in any way? Thanks in advance!
Last edited by nitro2k01 (2022-01-21 23:18:31)
Offline
Parameters passed to a function need to have a [ype:
void pause(uint8_t loops) {Offline