We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This code works in GCC 6.5 but does not work in GCC 13.1. I must use "m68k-amigaos-strip" to get it to be executable in GCC 13.1.
#include <stdio.h> #include <unistd.h> #include <proto/exec.h> #include <exec/execbase.h> #include <hardware/intbits.h>
struct Interrupt *vbint2; int counter; int quit; int value=0; int valueEnd=60;
void startInterrupt(void *interruptFuncton) { vbint2=NULL;
if (vbint2 = (struct Interrupt *)AllocMem(sizeof(struct Interrupt), MEMF_PUBLIC|MEMF_CLEAR)) { vbint2->is_Node.ln_Type = NT_INTERRUPT; vbint2->is_Node.ln_Pri = -60; //-60 vbint2->is_Node.ln_Name = "VertB"; vbint2->is_Data = (APTR)&counter; vbint2->is_Code = (void (*)())interruptFuncton; AddIntServer(INTB_VERTB, vbint2); } else { printf("Can't allocate memory for interrupt node\n"); }
}
void endInterrupt() { quit=1;
if (vbint2 != NULL) { RemIntServer(INTB_VERTB, vbint2); FreeMem(vbint2, sizeof(struct Interrupt));
// printf("%ld vertical blanks occurred\nRemoving server\n", counter); } }
int waitInterrupt() { if (quit==2) { quit=0; }
int tempQuit=quit; quit++; return tempQuit;
int interruptLoop() { while(!waitInterrupt()) { value++;
if (value>=valueEnd) { value=valueEnd; } }
int main() { startInterrupt((void*)interruptLoop);
while(value<valueEnd) { sleep(3); } endInterrupt(); printf("value %d\n", value); return 0;
The text was updated successfully, but these errors were encountered:
I forgot... m68k-amigaos-g++ -w -O3 -mno-align-int -funsafe-math-optimizations -ffast-math -mhard-float -fomit-frame-pointer -m68060 -noixemul -o main main.cpp
Sorry, something went wrong.
please check again
No branches or pull requests
This code works in GCC 6.5 but does not work in GCC 13.1.
I must use "m68k-amigaos-strip" to get it to be executable in GCC 13.1.
#include <stdio.h>
#include <unistd.h>
#include <proto/exec.h>
#include <exec/execbase.h>
#include <hardware/intbits.h>
struct Interrupt *vbint2;
int counter;
int quit;
int value=0;
int valueEnd=60;
void startInterrupt(void *interruptFuncton)
{
vbint2=NULL;
}
void endInterrupt()
{
quit=1;
// printf("%ld vertical blanks occurred\nRemoving server\n", counter);
}
}
int waitInterrupt()
{
if (quit==2)
{
quit=0;
}
}
int interruptLoop()
{
while(!waitInterrupt())
{
value++;
}
int main()
{
startInterrupt((void*)interruptLoop);
}
The text was updated successfully, but these errors were encountered: