_940_ctl_t *shared_ctl = 0;\r
unsigned char *mp3_mem = 0;\r
\r
-#define MP3_SIZE_MAX (0x1000000 - 4*640*480)\r
+#define MP3_SIZE_MAX (0x400000 + 0x800000) // 12M\r
\r
int crashed_940 = 0;\r
\r
shared_data = (_940_data_t *) (shared_mem+0x100000);\r
/* this area must not get buffered on either side */\r
shared_ctl = (_940_ctl_t *) (shared_mem+0x200000);\r
- mp3_mem = (unsigned char *) mmap(0, MP3_SIZE_MAX, PROT_READ|PROT_WRITE, MAP_SHARED, memdev, 0x3000000);\r
+ mp3_mem = (unsigned char *) mmap(0, MP3_SIZE_MAX, PROT_READ|PROT_WRITE, MAP_SHARED, memdev, 0x2400000);\r
if (mp3_mem == MAP_FAILED)\r
{\r
printf("mmap(mp3_mem) failed with %i\n", errno);\r
\r
if (loaded_mp3 != f)\r
{\r
- // printf("loading mp3... "); fflush(stdout);\r
if (PicoMessage != NULL)\r
{\r
fseek(f, 0, SEEK_END);\r
}\r
fseek(f, 0, SEEK_SET);\r
fread(mp3_mem, 1, MP3_SIZE_MAX, f);\r
- // if (feof(f)) printf("done.\n");\r
- // else printf("done. mp3 too large, not all data loaded.\n");\r
+ if (!feof(f)) printf("Warning: mp3 was too large, not all data loaded.\n");\r
shared_ctl->mp3_len = ftell(f);\r
loaded_mp3 = f;\r
\r
mcr p15, 0, r0, c6, c3, 0\r
mcr p15, 0, r0, c6, c3, 1\r
\r
- @ set up region 4: 16M 0x01000000-0x02000000 (mp3 area)\r
- mov r0, #(0x17<<1)|1\r
- orr r0, r0, #0x01000000\r
+ @ region 4: 4K 0x00000000-0x00001000 (boot code protection region)\r
+ mov r0, #(0x0b<<1)|1\r
mcr p15, 0, r0, c6, c4, 0\r
mcr p15, 0, r0, c6, c4, 1\r
\r
- @ region 5: 4K 0x00000000-0x00001000 (boot code protection region)\r
- mov r0, #(0x0b<<1)|1\r
+ @ region 5: 4M 0x00400000-0x00800000 (mp3 area part1)\r
+ mov r0, #(0x15<<1)|1\r
+ orr r0, r0, #0x00400000\r
mcr p15, 0, r0, c6, c5, 0\r
mcr p15, 0, r0, c6, c5, 1\r
\r
- @ set regions 1, 4 and 5 to be cacheable (so the first 2M and mp3 area will be cacheable)\r
- mov r0, #(1<<1)|(1<<4)|(1<<5)\r
+ @ region 6: 8M 0x00800000-0x01000000 (mp3 area part2)\r
+ mov r0, #(0x16<<1)|1\r
+ orr r0, r0, #0x00800000\r
+ mcr p15, 0, r0, c6, c6, 0\r
+ mcr p15, 0, r0, c6, c6, 1\r
+\r
+ @ set regions 1, 4, 5 and 6 to be cacheable (so the first 2M and mp3 area will be cacheable)\r
+ mov r0, #(1<<1)|(1<<4)|(1<<5)|(1<<6)\r
mcr p15, 0, r0, c2, c0, 0\r
mcr p15, 0, r0, c2, c0, 1\r
\r
mcr p15, 0, r0, c3, c0, 0\r
\r
@ set access protection\r
- @ data: [no, full, full, full, full, no access] for regions [5 4 3 2 1 0]\r
- mov r0, #(0<<10)|(3<<8)|(3<<6)|(3<<4)|(3<<2)|(0)\r
+ @ data: [full, full, no, full, full, full, no access] for regions [6 5 4 3 2 1 0]\r
+ mov r0, # (3<<12)|(3<<10)|(0<<8)\r
+ orr r0, r0, #(3<<6)|(3<< 4)|(3<< 2)|(0<<0)\r
mcr p15, 0, r0, c5, c0, 0\r
- @ instructions: [full, no access, no, no, full, no]\r
- mov r0, #(0<< 6)|(0<<4)|(3<<2)|(0)\r
- orr r0, r0, #(3<<10)|(0<<8)\r
+ @ instructions: [no, no, full, no, no, full, no]\r
+ mov r0, # (0<<12)|(0<<10)|(3<<8)\r
+ orr r0, r0, #(0<<6)|(0<< 4)|(3<< 2)|(0<<0)\r
mcr p15, 0, r0, c5, c0, 1\r
\r
mrc p15, 0, r0, c1, c0, 0 @ fetch current control reg\r
Badly encoded mp3s can cause various kind of problems, like noises, incorrect\r
playback speeds, not repeating music or even prevent game from starting.\r
* Use lower bitrate for better performance (96 or 128kbps CBRs recommended).\r
-* Due to internal implementation mp3s must not be larger that ~15MB\r
- (15548416 bytes). Larger mp3s will not be fully loaded.\r
+* Due to internal implementation mp3s must not be larger that 12MB\r
+ (12582912 bytes). Larger mp3s will not be fully loaded.\r
* RAM timings option is good for dualcore operation (it is disabled by\r
default because it doesn't work on every GP2X, so enable it in advanced\r
options).\r
\r
Changelog\r
---------\r
+1.321\r
+ * Sometimes stray sounds were played after loading a savestate. Fixed.\r
+ * Fixed a problem where >6MB mp3s were corrupted in memory (sound glitches in\r
+ Snatcher).\r
+ * PD no longer overwrites video player code in memory, video player now can be\r
+ used after PicoDrive.\r
+\r
1.32\r
+ Added some new scaling options.\r
+ Added ability to reload CD images while game is running (needed for games\r