Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
detect AGA example
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <stdio.h> | ||
#include <proto/exec.h> | ||
#include <graphics/gfxbase.h> | ||
|
||
struct GfxBase *GraphicsBase; | ||
|
||
main() | ||
{ | ||
int isAGA = 0; | ||
|
||
// first AGA Amiga had V39 | ||
// V37 is found in kickstart 2.04 | ||
// V34 in kickstart 1.3 | ||
int version = 39; | ||
GraphicsBase=(struct GfxBase *)OpenLibrary("graphics.library",version); | ||
|
||
if (GraphicsBase){ | ||
printf("Graphics.library V%d OK \n",version); | ||
isAGA = (GraphicsBase->ChipRevBits0 & GFXF_AA_ALICE) > 0; | ||
printf("has AGA: %d \n",isAGA); | ||
CloseLibrary((struct Library *)GraphicsBase); | ||
}else{ | ||
printf("No AGA \n"); | ||
version = 37; | ||
GraphicsBase=(struct GfxBase *)OpenLibrary("graphics.library",version); | ||
if (GraphicsBase){ | ||
printf("Graphics.library V%d OK \n",version); | ||
CloseLibrary((struct Library *)GraphicsBase); | ||
}else{ | ||
printf("Graphics.library Version lower then 37 \n"); | ||
} | ||
} | ||
|
||
return 0; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Hello world using AmigaOS API. | ||
*/ | ||
|
||
#include <proto/exec.h> | ||
#include <proto/dos.h> | ||
#include <string.h> | ||
|
||
main(int argc, void *argv[]) | ||
{ | ||
struct Library *SysBase; | ||
struct Library *DOSBase; | ||
|
||
SysBase = *((struct Library **)4UL); | ||
DOSBase = OpenLibrary("dos.library",0); | ||
|
||
if (DOSBase) { | ||
Write(Output(),"Hello world !\n",13); | ||
CloseLibrary(DOSBase); | ||
} | ||
|
||
return(0); | ||
} |