-
Notifications
You must be signed in to change notification settings - Fork 0
/
zxay_peek.c
51 lines (41 loc) · 897 Bytes
/
zxay_peek.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
/* AYE ZXAYEMUL metadata editor
* by Chris Young 2021, 2022
* https://www.unsatisfactorysoftware.co.uk
*/
/* ZXAY peek routines */
#include <stddef.h>
#include "zxay_file.h"
#include "zxay_peek.h"
/* Peek at a song, song is 0 - ZXAY_SONGCOUNT */
char *zxay_peek_song(void *zxayemul, int song, int type)
{
struct zxay_file *zxay = (struct zxay_file *)zxayemul;
if(song > zxay->header->NumOfSongs) return NULL;
switch(type) {
case ZXAY_SONG_NAME:
return zxay->songname[song];
break;
default:
return NULL;
break;
}
return NULL;
}
char *zxay_peek(void *zxayemul, int type)
{
struct zxay_file *zxay = (struct zxay_file *)zxayemul;
switch(type) {
case ZXAY_AUTHOR:
return zxay->author;
break;
case ZXAY_MISC:
return zxay->misc;
break;
case ZXAY_SONGCOUNT:
return &zxay->header->NumOfSongs;
default:
return NULL;
break;
}
return NULL;
}