• R/O
  • SSH
  • HTTPS

oswanpsp: Commit


Commit MetaInfo

Revisão29 (tree)
Hora2009-08-28 13:46:16
Autorbird_may_nike

Mensagem de Log

(mensagem de log vazia)

Mudança Sumário

Diff

--- trunc/src/fileio.c (revision 28)
+++ trunc/src/fileio.c (revision 29)
@@ -120,6 +120,26 @@
120120 return pszSlash;
121121 }
122122
123+void fileioRomPatch(WSROMHEADER *rom)
124+{
125+ if (rom->developperId == 0x01 && rom->cartId == 0x16) // SWJ-BANC16 Star Hearts
126+ {
127+ rom->saveSize = 2;
128+ }
129+ if (rom->developperId == 0x01 && rom->cartId == 0x2C) // SWJ-BAN02C-02F デジタルパートナー
130+ {
131+ rom->saveSize = 2;
132+ }
133+ if (rom->developperId == 0x18 && rom->cartId == 0x03) // SWJ-KGT003 爆走デコトラ伝説
134+ {
135+ rom->saveSize = 2;
136+ }
137+ if (rom->developperId == 0x33 && rom->cartId == 0x01) // SWJ-WIZC01 激闘! クラッシュギア T
138+ {
139+ rom->saveSize = 2;
140+ }
141+}
142+
123143 int fileioOpenRom(void)
124144 {
125145 SceUID fd;
@@ -131,6 +151,7 @@
131151 fd = sceIoOpen(RomPath, PSP_O_RDONLY, 0777);
132152 sceIoLseek32(fd, -10, SEEK_END);
133153 sceIoRead(fd, &WsRomHeader, sizeof(WsRomHeader));
154+ fileioRomPatch(&WsRomHeader);
134155 switch (WsRomHeader.romSize)
135156 {
136157 case 0: CartSize = 0x20000; break;
--- trunc/src/apu.c (revision 28)
+++ trunc/src/apu.c (revision 29)
@@ -22,11 +22,18 @@
2222
2323 static int SndWr = 0;
2424 static int SndRd = 0;
25+static int wPos = 0;
26+static int nPos = 0;
2527 static short sndbuffer[SND_RNGSIZE][2]; // Sound Ring Buffer
2628 static int SndSleep = 0;
27-int PspAudioCh = -1;
28-int PspAudioThread = -1;
29-int WsWaveVol = 80;
29+static int PspAudioCh = -1;
30+static int PspAudioThread = -1;
31+static int WsWaveVol = 80;
32+static short WaveDataL[WAV_BUFFER + 4];
33+static short WaveDataR[WAV_BUFFER + 4];
34+static unsigned char PData[4][32];
35+static unsigned char PDataN[8][BUFSIZEN];
36+static unsigned int RandData[BUFSIZEN];
3037 unsigned long WaveMap;
3138 int ChPlay[] = {0, 0, 0, 0};
3239 int ChFreq[] = {0, 0, 0, 0};
@@ -35,15 +42,11 @@
3542 int VoiceOn = 0;
3643 SWEEP Swp;
3744 NOISE Noise;
38-short WaveDataL[WAV_BUFFER + 4];
39-short WaveDataR[WAV_BUFFER + 4];
40-unsigned char PData[4][32];
41-unsigned char PDataN[8][BUFSIZEN];
4245
4346 int apuInit(void)
4447 {
4548 int i, j;
46- SndWr = SndRd = 0;
49+ SndWr = SndRd = wPos = nPos = 0;
4750
4851 for (i = 0; i < 4; i++) {
4952 for (j = 0; j < 32; j++) {
@@ -59,6 +62,9 @@
5962 PDataN[i][j] = ((apuMrand(15 - i) & 1) ? 15 : 0);
6063 }
6164 }
65+ for (i = 0; j < BUFSIZEN; i++) {
66+ RandData[i] = apuMrand(15);
67+ }
6268 // sceAudioSetFrequency(PSP_AUDIO_FREQ_48K);
6369 PspAudioCh = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, SND_BNKSIZE, PSP_AUDIO_FORMAT_STEREO);
6470 if (PspAudioCh < 0) {
@@ -293,7 +299,6 @@
293299 int channel, index;
294300 short value, lVol[4], rVol[4];
295301 short LL, RR, vVol;
296- static int wPos = 0;
297302 //ChPlay[0] = 1;
298303 //ChPlay[1] = 0;
299304 //ChPlay[2] = 0;
@@ -343,4 +348,8 @@
343348 apuSoundProc16(WaveDataL, WaveDataR, WAV_BUFFER);
344349 wPos = 0;
345350 }
351+ if (++nPos >= BUFSIZEN) {
352+ nPos = 0;
353+ }
354+ *((unsigned short*)(IO + 0x92)) = RandData[nPos];
346355 }
--- trunc/src/apu.h (revision 28)
+++ trunc/src/apu.h (revision 29)
@@ -16,7 +16,6 @@
1616 int pattern;
1717 } NOISE;
1818
19-extern int PspAudioThread;
2019 extern unsigned long WaveMap;
2120 extern int ChPlay[];
2221 extern int ChFreq[];
@@ -25,7 +24,6 @@
2524 extern int VoiceOn;
2625 extern SWEEP Swp;
2726 extern NOISE Noise;
28-extern unsigned char PData[4][32];
2927
3028 int apuInit(void);
3129 void apuEnd(void);
--- trunc/src/gpu.c (revision 28)
+++ trunc/src/gpu.c (revision 29)
@@ -41,7 +41,7 @@
4141 int line;
4242
4343 tileIndex = tileInfo & 0x1FF;
44- if (bank) // bank
44+ if (bank && (IO[0x60] & 0x80)) // 4-color bank
4545 {
4646 tileIndex += 512;
4747 }
Show on old repository browser