mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
runs code in 1M wram, cell arrange, decode (untested)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@54 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
3a81ecde1c
commit
fa1e5e2948
16 changed files with 787 additions and 551 deletions
|
@ -16,3 +16,41 @@ unsigned char formatted_bram[4*0x10] =
|
|||
};
|
||||
|
||||
|
||||
// offs | 2Mbit | 1Mbit |
|
||||
// 0 | [ 2M | unused |
|
||||
// 128K | bit ] | bank0 |
|
||||
// 256K | unused | bank1 |
|
||||
|
||||
void wram_2M_to_1M(unsigned char *m)
|
||||
{
|
||||
unsigned short *m1M_b0, *m1M_b1;
|
||||
unsigned int i, tmp, *m2M;
|
||||
|
||||
m2M = (unsigned int *) (m + 0x40000);
|
||||
m1M_b0 = (unsigned short *) m2M;
|
||||
m1M_b1 = (unsigned short *) (m + 0x60000);
|
||||
|
||||
for (i = 0x40000/4; i; i--)
|
||||
{
|
||||
tmp = *(--m2M);
|
||||
*(--m1M_b0) = tmp;
|
||||
*(--m1M_b1) = tmp >> 16;
|
||||
}
|
||||
}
|
||||
|
||||
void wram_1M_to_2M(unsigned char *m)
|
||||
{
|
||||
unsigned short *m1M_b0, *m1M_b1;
|
||||
unsigned int i, tmp, *m2M;
|
||||
|
||||
m2M = (unsigned int *) m;
|
||||
m1M_b0 = (unsigned short *) (m + 0x20000);
|
||||
m1M_b1 = (unsigned short *) (m + 0x40000);
|
||||
|
||||
for (i = 0x40000/4; i; i--)
|
||||
{
|
||||
tmp = *m1M_b0++ | (*m1M_b1++ << 16);
|
||||
*m2M++ = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue