misc. things
This commit is contained in:
parent
7c1443b973
commit
50d2ffb207
|
@ -174,6 +174,9 @@ void ARM::JumpTo(u32 addr, bool restorecpsr)
|
||||||
// aging cart debug crap
|
// aging cart debug crap
|
||||||
//if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]);
|
//if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]);
|
||||||
//if (addr == 0x020175D8) printf("capture test %d: res=%08X\n", R[6], R[0]);
|
//if (addr == 0x020175D8) printf("capture test %d: res=%08X\n", R[6], R[0]);
|
||||||
|
/*if (addr==0x037FBD49) printf("zog! %08X\n", R[15]);
|
||||||
|
if (addr==0x037FBD4C) printf("zog2 %08X\n", R[15]);
|
||||||
|
if (R[15]==0x037FBD54) printf("zog jump to %08X %08X\n", addr, CodeRead32(addr));*/
|
||||||
|
|
||||||
if (addr & 0x1)
|
if (addr & 0x1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1001,6 +1001,7 @@ s32 CalculateLighting()
|
||||||
// according to some hardware tests
|
// according to some hardware tests
|
||||||
// * diffuse level is saturated to 255
|
// * diffuse level is saturated to 255
|
||||||
// * shininess level mirrors back to 0 and is ANDed with 0xFF, that before being squared
|
// * shininess level mirrors back to 0 and is ANDed with 0xFF, that before being squared
|
||||||
|
// TODO: check how it behaves when the computed shininess is >=0x200
|
||||||
|
|
||||||
s32 difflevel = (-(LightDirection[i][0]*normaltrans[0] +
|
s32 difflevel = (-(LightDirection[i][0]*normaltrans[0] +
|
||||||
LightDirection[i][1]*normaltrans[1] +
|
LightDirection[i][1]*normaltrans[1] +
|
||||||
|
|
|
@ -837,6 +837,14 @@ void debug(u32 param)
|
||||||
fwrite(&val, 4, 1, shit);
|
fwrite(&val, 4, 1, shit);
|
||||||
}
|
}
|
||||||
fclose(shit);*/
|
fclose(shit);*/
|
||||||
|
/*FILE*
|
||||||
|
shit = fopen("debug/pictochat7.bin", "wb");
|
||||||
|
for (u32 i = 0x037F0000; i < 0x03810000; i+=4)
|
||||||
|
{
|
||||||
|
u32 val = ARM7Read32(i);
|
||||||
|
fwrite(&val, 4, 1, shit);
|
||||||
|
}
|
||||||
|
fclose(shit);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,12 @@
|
||||||
#include "SPU.h"
|
#include "SPU.h"
|
||||||
|
|
||||||
|
|
||||||
|
// SPU TODO
|
||||||
|
// * loop mode 3, what does it do?
|
||||||
|
// * the FIFO, whatever it is. GBAtek mentions it but gives no details.
|
||||||
|
// * consider mixing every sample instead of every 16?
|
||||||
|
|
||||||
|
|
||||||
namespace SPU
|
namespace SPU
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
48
src/Wifi.cpp
48
src/Wifi.cpp
|
@ -48,6 +48,32 @@ u16 RFData2;
|
||||||
u32 RFRegs[0x40];
|
u32 RFRegs[0x40];
|
||||||
|
|
||||||
|
|
||||||
|
// multiplayer host TX sequence:
|
||||||
|
// 1. preamble
|
||||||
|
// 2. IRQ7
|
||||||
|
// 3. send data
|
||||||
|
// 4. wait for client replies (duration: 112 + ((10 * CMD_REPLYTIME) * numclients))
|
||||||
|
// 5. IRQ7
|
||||||
|
// 6. send ack (16 bytes)
|
||||||
|
// 7. IRQ12 (and optional IRQ1)
|
||||||
|
//
|
||||||
|
// RFSTATUS values:
|
||||||
|
// 0 = initial
|
||||||
|
// 1 = RX????
|
||||||
|
// 2 = switching from RX to TX
|
||||||
|
// 3 = TX
|
||||||
|
// 4 = switching from TX to RX
|
||||||
|
// 5 = MP host data sent, waiting for replies (RFPINS=0x0084)
|
||||||
|
// 6 = RX
|
||||||
|
// 7 = ??
|
||||||
|
// 8 = MP host sending ack (RFPINS=0x0046)
|
||||||
|
// 9 = idle
|
||||||
|
|
||||||
|
|
||||||
|
// wifi TODO:
|
||||||
|
// * work out how power saving works, there are oddities
|
||||||
|
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
memset(RAM, 0, 0x2000);
|
memset(RAM, 0, 0x2000);
|
||||||
|
@ -131,6 +157,13 @@ void SetIRQ14(bool forced)
|
||||||
IOPORT(W_TXReqRead) &= 0xFFF2; // todo, eventually?
|
IOPORT(W_TXReqRead) &= 0xFFF2; // todo, eventually?
|
||||||
|
|
||||||
// TODO: actually send beacon
|
// TODO: actually send beacon
|
||||||
|
if (IOPORT(W_TXSlotBeacon) & 0x8000)
|
||||||
|
{
|
||||||
|
printf("SEND BEACON\n");
|
||||||
|
/*FILE* f = fopen("beacon.bin", "wb");
|
||||||
|
fwrite(RAM, 0x2000, 1, f);
|
||||||
|
fclose(f);*/
|
||||||
|
}
|
||||||
|
|
||||||
if (IOPORT(W_ListenCount) == 0)
|
if (IOPORT(W_ListenCount) == 0)
|
||||||
IOPORT(W_ListenCount) = IOPORT(W_ListenInterval);
|
IOPORT(W_ListenCount) = IOPORT(W_ListenInterval);
|
||||||
|
@ -460,6 +493,21 @@ void Write(u32 addr, u16 val)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case W_RXCnt:
|
||||||
|
if (val & 0x0001)
|
||||||
|
{
|
||||||
|
IOPORT(W_RXBufWriteCursor) = IOPORT(W_RXBufWriteAddr);
|
||||||
|
}
|
||||||
|
if (val & 0x0080)
|
||||||
|
{
|
||||||
|
IOPORT(W_TXSlotReply2) = IOPORT(W_TXSlotReply1);
|
||||||
|
IOPORT(W_TXSlotReply1) = 0;
|
||||||
|
}
|
||||||
|
val &= 0xFF0E;
|
||||||
|
if (val & 0x7FFF) printf("wifi: unknown RXCNT bits set %04X\n", val);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
case W_TXBufDataWrite:
|
case W_TXBufDataWrite:
|
||||||
{
|
{
|
||||||
u32 wraddr = IOPORT(W_TXBufWriteAddr) & 0x1FFE;
|
u32 wraddr = IOPORT(W_TXBufWriteAddr) & 0x1FFE;
|
||||||
|
|
Loading…
Reference in New Issue