2
2
#include " SoundSystem.h"
3
3
#include " FileSystemUtils.h"
4
4
5
+ #include < hal/debug.h>
6
+
5
7
MusicTrack::MusicTrack (const char * fileName)
6
8
{
7
9
m_music = Mix_LoadMUS (fileName);
@@ -32,7 +34,9 @@ SoundTrack::SoundTrack(const char* fileName)
32
34
size_t length = 0 ;
33
35
FILESYSTEM_loadFileToMemory (fileName, &mem, &length);
34
36
SDL_RWops *fileIn = SDL_RWFromMem (mem, length);
37
+ debugPrint (" Loading sound %p %p\n " , fileIn, mem);
35
38
sound = Mix_LoadWAV_RW (fileIn, 1 );
39
+ debugPrint (" Loaded sound %p\n " , sound);
36
40
if (length)
37
41
{
38
42
FILESYSTEM_freeMemory (&mem);
@@ -44,18 +48,47 @@ SoundTrack::SoundTrack(const char* fileName)
44
48
}
45
49
}
46
50
51
+ #include < xboxkrnl/xboxkrnl.h>
52
+
53
+
54
+ extern " C" {
55
+ extern int nextCol;
56
+ extern int nextRow;
57
+ }
58
+
47
59
SoundSystem::SoundSystem ()
48
60
{
49
61
int audio_rate = 44100 ;
50
62
Uint16 audio_format = AUDIO_S16SYS;
51
63
int audio_channels = 2 ;
52
64
int audio_buffers = 1024 ;
53
-
65
+ # if 0
54
66
if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) != 0)
55
67
{
56
68
fprintf(stderr, "Unable to initialize audio: %s\n", Mix_GetError());
57
69
SDL_assert(0 && "Unable to initialize audio!");
58
70
}
71
+ debugPrint("Okay!\n");
72
+
73
+ nextCol = 25;
74
+ nextRow = 300;
75
+
76
+ debugPrint(" Memory statistics:\n");
77
+ MM_STATISTICS ms;
78
+ ms.Length = sizeof(MM_STATISTICS);
79
+ MmQueryStatistics(&ms);
80
+ #define PRINT(stat) debugPrint(" - " #stat ": %d\n", ms.stat);
81
+ PRINT(TotalPhysicalPages)
82
+ PRINT(AvailablePages)
83
+ PRINT(VirtualMemoryBytesCommitted)
84
+ PRINT(VirtualMemoryBytesReserved)
85
+ PRINT(CachePagesCommitted)
86
+ PRINT(PoolPagesCommitted)
87
+ PRINT(StackPagesCommitted)
88
+ PRINT(ImagePagesCommitted)
89
+ #undef PRINT
90
+
91
+ #endif
59
92
}
60
93
61
94
void SoundSystem::playMusic (MusicTrack* music)
0 commit comments