-
Notifications
You must be signed in to change notification settings - Fork 1
/
ModPlay.c
66 lines (46 loc) · 1.22 KB
/
ModPlay.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/****************************************
PT-Player 2.0 � 1994 BetaSoft
uses PTReplay.library also by BetaSoft
and Andreas [Pucko] P�lsson
Modified in 2020 by Nicolas BAUW
for cross-compilation (VBCC) +
quit bugfix
****************************************/
#include <exec/types.h>
#include <clib/exec_protos.h>
#include <pragmas/exec_pragmas.h>
#include <dos/dos.h>
#include <stdio.h>
#include <stdlib.h>
#include "include/ptreplay.h"
struct Library *PTReplayBase;
struct Module *Mod = NULL;
char *vstr="$VER: SmallPlay 2.0 (23.12.93)";
int main(int argc, char **argv)
{
BYTE SigBit;
ULONG SigMask;
if(argc > 2)
{ puts("specify one module only\n"); return 20; }
if(argc < 2)
{ puts("play what module?\n"); return 20; }
if(PTReplayBase = OpenLibrary("ptreplay.library",0L))
{
if(Mod = PTLoadModule(argv[1]))
{
if((SigBit=AllocSignal(-1))==-1)
{
puts("couldn't allocate signal\n");
exit(0);
};
PTInstallBits(Mod, SigBit, -1, -1, -1);
PTPlay(Mod);
SigMask=Wait(SIGBREAKF_CTRL_C);
PTStop(Mod);
FreeSignal(SigBit);
PTUnloadModule(Mod);
}else puts("couldn't open/load module\n");
CloseLibrary(PTReplayBase);
} else puts("couldn't open ptreplay.library\n");
return(0);
}