mirror of
https://github.com/mtheall/vram.git
synced 2025-06-18 10:35:39 -04:00
Sub engine, syntax highlight, share link as anchors, better out of range check
This commit is contained in:
parent
ecae3393f7
commit
723a89c8b2
@ -40,6 +40,11 @@ td.y { background: #FFFF00; }
|
||||
td.x { background: #777777; }
|
||||
td.black { background: #000000; }
|
||||
|
||||
.comm { color: #444; }
|
||||
.func { color: #630; }
|
||||
.deff { color: #040; }
|
||||
.numm { color: #008; }
|
||||
|
||||
#Content { margin: 8pt; }
|
||||
|
||||
#ShareLink
|
||||
|
236
banks.js
236
banks.js
@ -1,14 +1,23 @@
|
||||
function getParameterByName(name) {
|
||||
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||||
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
||||
var regex = new RegExp(regexS);
|
||||
var results = regex.exec(window.location.search);
|
||||
var regex = new RegExp("[\\#&]" + name + "=([^&#]*)");
|
||||
var results = regex.exec(window.location.hash);
|
||||
if(results == null)
|
||||
return "";
|
||||
else
|
||||
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
function hasParameterByName(name) {
|
||||
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||||
var regex = new RegExp("[\\#&]" + name + "=([^&#]*)");
|
||||
var results = regex.exec(window.location.hash);
|
||||
if(results == null)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function OListSize(obj) {
|
||||
var size = 0;
|
||||
for (key in obj) {
|
||||
@ -86,124 +95,124 @@ var BankingMap = {
|
||||
|
||||
var CPUAccessMap = {
|
||||
// LCD
|
||||
'A_LCD' :'ARM9 0x06800000 - 0x0681FFFF (128KB)',
|
||||
'B_LCD' :'ARM9 0x06820000 - 0x0683FFFF (128KB)',
|
||||
'C_LCD' :'ARM9 0x06840000 - 0x0685FFFF (128KB)',
|
||||
'D_LCD' :'ARM9 0x06860000 - 0x0687FFFF (128KB)',
|
||||
'E_LCD' :'ARM9 0x06880000 - 0x0688FFFF ( 64KB)',
|
||||
'F_LCD' :'ARM9 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'G_LCD' :'ARM9 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'H_LCD' :'ARM9 0x06898000 - 0x0689FFFF ( 32KB)',
|
||||
'I_LCD' :'ARM9 0x068A0000 - 0x068A3FFF ( 16KB)',
|
||||
'A_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06800000 - 0x0681FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06820000 - 0x0683FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06840000 - 0x0685FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06860000 - 0x0687FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'E_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06880000 - 0x0688FFFF</span> <span class="deff">( 64KB)</span>',
|
||||
'F_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'H_LCD' :'<span class="func">ARM9</span> <span class="numm">0x06898000 - 0x0689FFFF</span> <span class="deff">( 32KB)</span>',
|
||||
'I_LCD' :'<span class="func">ARM9</span> <span class="numm">0x068A0000 - 0x068A3FFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// ARM7
|
||||
'C_ARM70' :'ARM7 0x06000000 - 0x0601FFFF (128KB)',
|
||||
'D_ARM70' :'ARM7 0x06000000 - 0x0601FFFF (128KB)',
|
||||
'C_ARM71' :'ARM7 0x06020000 - 0x0603FFFF (128KB)',
|
||||
'D_ARM71' :'ARM7 0x06020000 - 0x0603FFFF (128KB)',
|
||||
'C_ARM70' :'<span class="func">ARM7</span> <span class="numm">0x06000000 - 0x0601FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_ARM70' :'<span class="func">ARM7</span> <span class="numm">0x06000000 - 0x0601FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_ARM71' :'<span class="func">ARM7</span> <span class="numm">0x06020000 - 0x0603FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_ARM71' :'<span class="func">ARM7</span> <span class="numm">0x06020000 - 0x0603FFFF</span> <span class="deff">(128KB)</span>',
|
||||
|
||||
// Main Background
|
||||
'A_MBG0' :'ARM9 0x06000000 - 0x0601FFFF (128KB)',
|
||||
'A_MBG1' :'ARM9 0x06020000 - 0x0603FFFF (128KB)',
|
||||
'A_MBG2' :'ARM9 0x06040000 - 0x0605FFFF (128KB)',
|
||||
'A_MBG3' :'ARM9 0x06060000 - 0x0607FFFF (128KB)',
|
||||
'B_MBG0' :'ARM9 0x06000000 - 0x0601FFFF (128KB)',
|
||||
'B_MBG1' :'ARM9 0x06020000 - 0x0603FFFF (128KB)',
|
||||
'B_MBG2' :'ARM9 0x06040000 - 0x0605FFFF (128KB)',
|
||||
'B_MBG3' :'ARM9 0x06060000 - 0x0607FFFF (128KB)',
|
||||
'C_MBG0' :'ARM9 0x06000000 - 0x0601FFFF (128KB)',
|
||||
'C_MBG1' :'ARM9 0x06020000 - 0x0603FFFF (128KB)',
|
||||
'C_MBG2' :'ARM9 0x06040000 - 0x0605FFFF (128KB)',
|
||||
'C_MBG3' :'ARM9 0x06060000 - 0x0607FFFF (128KB)',
|
||||
'D_MBG0' :'ARM9 0x06000000 - 0x0601FFFF (128KB)',
|
||||
'D_MBG1' :'ARM9 0x06020000 - 0x0603FFFF (128KB)',
|
||||
'D_MBG2' :'ARM9 0x06040000 - 0x0605FFFF (128KB)',
|
||||
'D_MBG3' :'ARM9 0x06060000 - 0x0607FFFF (128KB)',
|
||||
'E_MBG' :'ARM9 0x06000000 - 0x0600FFFF ( 64KB)',
|
||||
'F_MBG00' :'ARM9 0x06000000 - 0x06003FFF ( 16KB)',
|
||||
'F_MBG01' :'ARM9 0x06004000 - 0x06007FFF ( 16KB)',
|
||||
'F_MBG02' :'ARM9 0x06008000 - 0x0600BFFF ( 16KB)',
|
||||
'F_MBG03' :'ARM9 0x0600C000 - 0x0600FFFF ( 16KB)',
|
||||
'G_MBG00' :'ARM9 0x06000000 - 0x06003FFF ( 16KB)',
|
||||
'G_MBG01' :'ARM9 0x06004000 - 0x06007FFF ( 16KB)',
|
||||
'G_MBG02' :'ARM9 0x06008000 - 0x0600BFFF ( 16KB)',
|
||||
'G_MBG03' :'ARM9 0x0600C000 - 0x0600FFFF ( 16KB)',
|
||||
'A_MBG0' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x0601FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'A_MBG1' :'<span class="func">ARM9</span> <span class="numm">0x06020000 - 0x0603FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'A_MBG2' :'<span class="func">ARM9</span> <span class="numm">0x06040000 - 0x0605FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'A_MBG3' :'<span class="func">ARM9</span> <span class="numm">0x06060000 - 0x0607FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_MBG0' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x0601FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_MBG1' :'<span class="func">ARM9</span> <span class="numm">0x06020000 - 0x0603FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_MBG2' :'<span class="func">ARM9</span> <span class="numm">0x06040000 - 0x0605FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_MBG3' :'<span class="func">ARM9</span> <span class="numm">0x06060000 - 0x0607FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_MBG0' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x0601FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_MBG1' :'<span class="func">ARM9</span> <span class="numm">0x06020000 - 0x0603FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_MBG2' :'<span class="func">ARM9</span> <span class="numm">0x06040000 - 0x0605FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_MBG3' :'<span class="func">ARM9</span> <span class="numm">0x06060000 - 0x0607FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_MBG0' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x0601FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_MBG1' :'<span class="func">ARM9</span> <span class="numm">0x06020000 - 0x0603FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_MBG2' :'<span class="func">ARM9</span> <span class="numm">0x06040000 - 0x0605FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_MBG3' :'<span class="func">ARM9</span> <span class="numm">0x06060000 - 0x0607FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'E_MBG' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x0600FFFF</span> <span class="deff">( 64KB)</span>',
|
||||
'F_MBG00' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x06003FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_MBG01' :'<span class="func">ARM9</span> <span class="numm">0x06004000 - 0x06007FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_MBG02' :'<span class="func">ARM9</span> <span class="numm">0x06008000 - 0x0600BFFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_MBG03' :'<span class="func">ARM9</span> <span class="numm">0x0600C000 - 0x0600FFFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MBG00' :'<span class="func">ARM9</span> <span class="numm">0x06000000 - 0x06003FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MBG01' :'<span class="func">ARM9</span> <span class="numm">0x06004000 - 0x06007FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MBG02' :'<span class="func">ARM9</span> <span class="numm">0x06008000 - 0x0600BFFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MBG03' :'<span class="func">ARM9</span> <span class="numm">0x0600C000 - 0x0600FFFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// Main Sprite
|
||||
'A_MOBJ0' :'ARM9 0x06400000 - 0x0641FFFF (128KB)',
|
||||
'A_MOBJ1' :'ARM9 0x06420000 - 0x0643FFFF (128KB)',
|
||||
'B_MOBJ0' :'ARM9 0x06400000 - 0x0641FFFF (128KB)',
|
||||
'B_MOBJ1' :'ARM9 0x06420000 - 0x0643FFFF (128KB)',
|
||||
'E_MOBJ' :'ARM9 0x06400000 - 0x0640FFFF ( 64KB)',
|
||||
'F_MOBJ00':'ARM9 0x06400000 - 0x06403FFF ( 16KB)',
|
||||
'F_MOBJ01':'ARM9 0x06404000 - 0x06407FFF ( 16KB)',
|
||||
'F_MOBJ02':'ARM9 0x06880000 - 0x0688FFFF ( 64KB)',
|
||||
'F_MOBJ03':'ARM9 0x06410000 - 0x06413FFF ( 16KB)',
|
||||
'G_MOBJ00':'ARM9 0x06400000 - 0x06403FFF ( 16KB)',
|
||||
'G_MOBJ01':'ARM9 0x06404000 - 0x06407FFF ( 16KB)',
|
||||
'G_MOBJ02':'ARM9 0x06880000 - 0x0688FFFF ( 64KB)',
|
||||
'G_MOBJ03':'ARM9 0x06410000 - 0x06413FFF ( 16KB)',
|
||||
'A_MOBJ0' :'<span class="func">ARM9</span> <span class="numm">0x06400000 - 0x0641FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'A_MOBJ1' :'<span class="func">ARM9</span> <span class="numm">0x06420000 - 0x0643FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_MOBJ0' :'<span class="func">ARM9</span> <span class="numm">0x06400000 - 0x0641FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_MOBJ1' :'<span class="func">ARM9</span> <span class="numm">0x06420000 - 0x0643FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'E_MOBJ' :'<span class="func">ARM9</span> <span class="numm">0x06400000 - 0x0640FFFF</span> <span class="deff">( 64KB)</span>',
|
||||
'F_MOBJ00':'<span class="func">ARM9</span> <span class="numm">0x06400000 - 0x06403FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_MOBJ01':'<span class="func">ARM9</span> <span class="numm">0x06404000 - 0x06407FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_MOBJ02':'<span class="func">ARM9</span> <span class="numm">0x06880000 - 0x0688FFFF</span> <span class="deff">( 64KB)</span>',
|
||||
'F_MOBJ03':'<span class="func">ARM9</span> <span class="numm">0x06410000 - 0x06413FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MOBJ00':'<span class="func">ARM9</span> <span class="numm">0x06400000 - 0x06403FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MOBJ01':'<span class="func">ARM9</span> <span class="numm">0x06404000 - 0x06407FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_MOBJ02':'<span class="func">ARM9</span> <span class="numm">0x06880000 - 0x0688FFFF</span> <span class="deff">( 64KB)</span>',
|
||||
'G_MOBJ03':'<span class="func">ARM9</span> <span class="numm">0x06410000 - 0x06413FFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// Main Background Extended Palette
|
||||
'E_BGEPAL' :'LCD: 0x06880000 - 0x06887FFF ( 32KB)',
|
||||
'F_BGEPAL01':'LCD: 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'F_BGEPAL23':'LCD: 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'G_BGEPAL01':'LCD: 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'G_BGEPAL23':'LCD: 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'E_BGEPAL' :'<span class="func">LCD:</span> <span class="numm">0x06880000 - 0x06887FFF</span> <span class="deff">( 32KB)</span>',
|
||||
'F_BGEPAL01':'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_BGEPAL23':'<span class="func">LCD:</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_BGEPAL01':'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_BGEPAL23':'<span class="func">LCD:</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// Main Sprite Extended Palette
|
||||
'F_OBJEPAL' :'LCD: 0x06890000 - 0x06891FFF ( 8KB)',
|
||||
'G_OBJEPAL' :'LCD: 0x06890000 - 0x06891FFF ( 8KB)',
|
||||
'F_OBJEPAL' :'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06891FFF</span> <span class="deff">( 8KB)</span>',
|
||||
'G_OBJEPAL' :'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06891FFF</span> <span class="deff">( 8KB)</span>',
|
||||
|
||||
// Sub Background
|
||||
'C_SBG' :'ARM9 0x06200000 - 0x0621FFFF (128KB)',
|
||||
'H_SBG0':'ARM9 0x06200000 - 0x06207FFF ( 32KB)',
|
||||
'I_SBG1':'ARM9 0x06208000 - 0x0620BFFF ( 16KB)',
|
||||
'C_SBG' :'<span class="func">ARM9</span> <span class="numm">0x06200000 - 0x0621FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'H_SBG0':'<span class="func">ARM9</span> <span class="numm">0x06200000 - 0x06207FFF</span> <span class="deff">( 32KB)</span>',
|
||||
'I_SBG1':'<span class="func">ARM9</span> <span class="numm">0x06208000 - 0x0620BFFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// Sub Sprite
|
||||
'D_SOBJ':'ARM9 0x06600000 - 0x0661FFFF (128KB)',
|
||||
'I_SOBJ':'ARM9 0x06600000 - 0x06603FFF ( 16KB)',
|
||||
'D_SOBJ':'<span class="func">ARM9</span> <span class="numm">0x06600000 - 0x0661FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'I_SOBJ':'<span class="func">ARM9</span> <span class="numm">0x06600000 - 0x06603FFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// Sub Background Extended Palette
|
||||
'H_SBGEPAL' :'LCD: 0x06898000 - 0x0689FFFF ( 32KB)',
|
||||
'H_SBGEPAL' :'<span class="func">LCD:</span> <span class="numm">0x06898000 - 0x0689FFFF</span> <span class="deff">( 32KB)</span>',
|
||||
|
||||
// Sub Sprite Extended Palette
|
||||
'I_SOBJEPAL':'LCD: 0x068A0000 - 0x068A3FFF ( 16KB)',
|
||||
'I_SOBJEPAL':'<span class="func">LCD:</span> <span class="numm">0x068A0000 - 0x068A3FFF</span> <span class="deff">( 16KB)</span>',
|
||||
|
||||
// Texture Slot 0
|
||||
'A_TS0':'LCD: 0x06800000 - 0x0681FFFF (128KB)',
|
||||
'B_TS0':'LCD: 0x06800000 - 0x0681FFFF (128KB)',
|
||||
'C_TS0':'LCD: 0x06800000 - 0x0681FFFF (128KB)',
|
||||
'D_TS0':'LCD: 0x06800000 - 0x0681FFFF (128KB)',
|
||||
'A_TS0':'<span class="func">LCD:</span> <span class="numm">0x06800000 - 0x0681FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_TS0':'<span class="func">LCD:</span> <span class="numm">0x06800000 - 0x0681FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_TS0':'<span class="func">LCD:</span> <span class="numm">0x06800000 - 0x0681FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_TS0':'<span class="func">LCD:</span> <span class="numm">0x06800000 - 0x0681FFFF</span> <span class="deff">(128KB)</span>',
|
||||
|
||||
// Texture Slot 1
|
||||
'A_TS1':'LCD: 0x06820000 - 0x0683FFFF (128KB)',
|
||||
'B_TS1':'LCD: 0x06820000 - 0x0683FFFF (128KB)',
|
||||
'C_TS1':'LCD: 0x06820000 - 0x0683FFFF (128KB)',
|
||||
'D_TS1':'LCD: 0x06820000 - 0x0683FFFF (128KB)',
|
||||
'A_TS1':'<span class="func">LCD:</span> <span class="numm">0x06820000 - 0x0683FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_TS1':'<span class="func">LCD:</span> <span class="numm">0x06820000 - 0x0683FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_TS1':'<span class="func">LCD:</span> <span class="numm">0x06820000 - 0x0683FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_TS1':'<span class="func">LCD:</span> <span class="numm">0x06820000 - 0x0683FFFF</span> <span class="deff">(128KB)</span>',
|
||||
|
||||
// Texture Slot 2
|
||||
'A_TS2':'LCD: 0x06840000 - 0x0685FFFF (128KB)',
|
||||
'B_TS2':'LCD: 0x06840000 - 0x0685FFFF (128KB)',
|
||||
'C_TS2':'LCD: 0x06840000 - 0x0685FFFF (128KB)',
|
||||
'D_TS2':'LCD: 0x06840000 - 0x0685FFFF (128KB)',
|
||||
'A_TS2':'<span class="func">LCD:</span> <span class="numm">0x06840000 - 0x0685FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_TS2':'<span class="func">LCD:</span> <span class="numm">0x06840000 - 0x0685FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_TS2':'<span class="func">LCD:</span> <span class="numm">0x06840000 - 0x0685FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_TS2':'<span class="func">LCD:</span> <span class="numm">0x06840000 - 0x0685FFFF</span> <span class="deff">(128KB)</span>',
|
||||
|
||||
// Texture Slot 3
|
||||
'A_TS3':'LCD: 0x06860000 - 0x0687FFFF (128KB)',
|
||||
'B_TS3':'LCD: 0x06860000 - 0x0687FFFF (128KB)',
|
||||
'C_TS3':'LCD: 0x06860000 - 0x0687FFFF (128KB)',
|
||||
'D_TS3':'LCD: 0x06860000 - 0x0687FFFF (128KB)',
|
||||
'A_TS3':'<span class="func">LCD:</span> <span class="numm">0x06860000 - 0x0687FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'B_TS3':'<span class="func">LCD:</span> <span class="numm">0x06860000 - 0x0687FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'C_TS3':'<span class="func">LCD:</span> <span class="numm">0x06860000 - 0x0687FFFF</span> <span class="deff">(128KB)</span>',
|
||||
'D_TS3':'<span class="func">LCD:</span> <span class="numm">0x06860000 - 0x0687FFFF</span> <span class="deff">(128KB)</span>',
|
||||
|
||||
// Texture Palette
|
||||
'E_TPAL' :'LCD: 0x06880000 - 0x0688FFFF ( 64KB)',
|
||||
'F_TPAL0':'LCD: 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'G_TPAL0':'LCD: 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'F_TPAL1':'LCD: 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'G_TPAL1':'LCD: 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'F_TPAL4':'LCD: 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'G_TPAL4':'LCD: 0x06890000 - 0x06893FFF ( 16KB)',
|
||||
'F_TPAL5':'LCD: 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'G_TPAL5':'LCD: 0x06894000 - 0x06897FFF ( 16KB)',
|
||||
'E_TPAL' :'<span class="func">LCD:</span> <span class="numm">0x06880000 - 0x0688FFFF</span> <span class="deff">( 64KB)</span>',
|
||||
'F_TPAL0':'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_TPAL0':'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_TPAL1':'<span class="func">LCD:</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_TPAL1':'<span class="func">LCD:</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_TPAL4':'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_TPAL4':'<span class="func">LCD:</span> <span class="numm">0x06890000 - 0x06893FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'F_TPAL5':'<span class="func">LCD:</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
'G_TPAL5':'<span class="func">LCD:</span> <span class="numm">0x06894000 - 0x06897FFF</span> <span class="deff">( 16KB)</span>',
|
||||
};
|
||||
|
||||
var Sel = {'A':'', 'B':'', 'C':'', 'D':'', 'E':'', 'F':'', 'G':'', 'H':'', 'I':''};
|
||||
@ -213,15 +222,15 @@ function loadp() {
|
||||
var i, allElem = document.forms["banks"].elements;
|
||||
|
||||
// Load parameters
|
||||
Sel['A'] = getParameterByName('A');
|
||||
Sel['B'] = getParameterByName('B');
|
||||
Sel['C'] = getParameterByName('C');
|
||||
Sel['D'] = getParameterByName('D');
|
||||
Sel['E'] = getParameterByName('E');
|
||||
Sel['F'] = getParameterByName('F');
|
||||
Sel['G'] = getParameterByName('G');
|
||||
Sel['H'] = getParameterByName('H');
|
||||
Sel['I'] = getParameterByName('I');
|
||||
if (hasParameterByName('A')) Sel['A'] = getParameterByName('A');
|
||||
if (hasParameterByName('B')) Sel['B'] = getParameterByName('B');
|
||||
if (hasParameterByName('C')) Sel['C'] = getParameterByName('C');
|
||||
if (hasParameterByName('D')) Sel['D'] = getParameterByName('D');
|
||||
if (hasParameterByName('E')) Sel['E'] = getParameterByName('E');
|
||||
if (hasParameterByName('F')) Sel['F'] = getParameterByName('F');
|
||||
if (hasParameterByName('G')) Sel['G'] = getParameterByName('G');
|
||||
if (hasParameterByName('H')) Sel['H'] = getParameterByName('H');
|
||||
if (hasParameterByName('I')) Sel['I'] = getParameterByName('I');
|
||||
|
||||
// Mark selected items
|
||||
for (var i=0; i < allElem.length; i++) {
|
||||
@ -308,20 +317,20 @@ function upd() {
|
||||
// Generate the function call
|
||||
FCall = document.getElementById('FunctionCall');
|
||||
if (numerr == 0) {
|
||||
FCall.innerHTML = "vramSetBankA(VRAM_A_" + BankingMap['f'+Sel['A']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankB(VRAM_B_" + BankingMap['f'+Sel['B']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankC(VRAM_C_" + BankingMap['f'+Sel['C']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankD(VRAM_D_" + BankingMap['f'+Sel['D']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankE(VRAM_E_" + BankingMap['f'+Sel['E']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankF(VRAM_F_" + BankingMap['f'+Sel['F']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankG(VRAM_G_" + BankingMap['f'+Sel['G']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankH(VRAM_H_" + BankingMap['f'+Sel['H']] + ");<br />";
|
||||
FCall.innerHTML += "vramSetBankI(VRAM_I_" + BankingMap['f'+Sel['I']] + ");<br />";
|
||||
FCall.innerHTML = "<span class='func'>vramSetBankA</span>(<span class='deff'>VRAM_A_" + BankingMap['f'+Sel['A']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankB</span>(<span class='deff'>VRAM_B_" + BankingMap['f'+Sel['B']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankC</span>(<span class='deff'>VRAM_C_" + BankingMap['f'+Sel['C']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankD</span>(<span class='deff'>VRAM_D_" + BankingMap['f'+Sel['D']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankE</span>(<span class='deff'>VRAM_E_" + BankingMap['f'+Sel['E']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankF</span>(<span class='deff'>VRAM_F_" + BankingMap['f'+Sel['F']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankG</span>(<span class='deff'>VRAM_G_" + BankingMap['f'+Sel['G']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankH</span>(<span class='deff'>VRAM_H_" + BankingMap['f'+Sel['H']] + "</span>);<br />";
|
||||
FCall.innerHTML += "<span class='func'>vramSetBankI</span>(<span class='deff'>VRAM_I_" + BankingMap['f'+Sel['I']] + "</span>);<br />";
|
||||
}
|
||||
else
|
||||
FCall.innerHTML = "Error: Conflict found!";
|
||||
|
||||
// Generate the function call
|
||||
// Generate the cpu access
|
||||
CPUAcc = document.getElementById('CPUAccess');
|
||||
if (numerr == 0) {
|
||||
CPUAcc.innerHTML = "<b>A:</b> " + CPUAccessMap['A_'+Sel['A']] + "<br />";
|
||||
@ -348,6 +357,7 @@ function upd() {
|
||||
if (Sel['G'] != "LCD") ShareLink += "&G=" + Sel['G'];
|
||||
if (Sel['H'] != "LCD") ShareLink += "&H=" + Sel['H'];
|
||||
if (Sel['I'] != "LCD") ShareLink += "&I=" + Sel['I'];
|
||||
ShareLink = "?" + ShareLink.substring(1);
|
||||
ShareLink = "#" + ShareLink.substring(1);
|
||||
document.getElementById('ShareLink').innerHTML = "<a href=" + ShareLink + ">" + ShareLink + "</a>";
|
||||
window.location.hash = ShareLink;
|
||||
}
|
||||
|
10
vram.css
10
vram.css
@ -43,6 +43,16 @@ td.y { background: #FFFF00; }
|
||||
td.x { background: #777777; }
|
||||
td.black { background: #000000; }
|
||||
|
||||
p.sube
|
||||
{
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
.comm { color: #444; }
|
||||
.func { color: #630; }
|
||||
.deff { color: #040; }
|
||||
.numm { color: #008; }
|
||||
|
||||
#Content { margin: 8pt; }
|
||||
|
||||
#ShareLink
|
||||
|
14
vram.html
14
vram.html
@ -13,11 +13,12 @@
|
||||
<h1>NDS Homebrew VRAM BG Allocation Conflict Viewer</h1>
|
||||
<h4>For the VRAM Banks Selector tool <a href="banks.html">click here</a></h4>
|
||||
<h4>Please contact mtheall in #dsdev on irc.blitzed.org regarding errors, discrepancies, suggestions, or bugs with this tool</h4>
|
||||
<h4>Link for sharing: <span id='ShareLink'>Javascript must be enabled</span></h4>
|
||||
<h4>Link for sharing: <span id='ShareLink'>Loading...</span></h4>
|
||||
<hr />
|
||||
<form name='bgvram'>
|
||||
<table class='main'>
|
||||
<tr><td class='main' style='width:350px'>
|
||||
<p class="sube"><input type="checkbox" name="SubEngine" value="yes" onClick="upd()"> Sub Engine</p>
|
||||
<h2>Base select</h2>
|
||||
<p>DISPCNT Map Base 64KB Step</p>
|
||||
<select name="MS" onChange="upd()">
|
||||
@ -656,22 +657,21 @@
|
||||
<p> </p>
|
||||
<h2>Function Call</h2>
|
||||
<table style='width:320px'>
|
||||
<thead>
|
||||
<tr><td class='left'><input type="checkbox" name="FuncCallSub" value="yes" onClick="upd()">Generate for Sub Engine</td></tr>
|
||||
</thead>
|
||||
<tr><td class='left' id='FunctionCall'>Javascript must be enabled</td></tr>
|
||||
<tr><td class='left' id='FunctionCall'>Loading...</td></tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<table style='width:320px'>
|
||||
<tr><td colspan=3 class="left">Legend</td></tr>
|
||||
<tr><td class="" style='width=32px'></td><td class="left">Empty</td><td class="left"></td></tr>
|
||||
<tr><td class="x" style='width=32px'></td><td class="left">Empty</td><td class="left"></td></tr>
|
||||
<tr><td class="g" style='width=32px'></td><td class="left">Okay!</td><td class="left"></td></tr>
|
||||
<tr><td class="y" style='width=32px'></td><td class="left">Warning!</td><td class="left">Safe if shared tileset graphics</td></tr>
|
||||
<tr><td class="r" style='width=32px'></td><td class="left">Error!</td><td class="left">You will definitely have corrupted graphics.<br>Additionally, zeromus will slap you.</td></tr>
|
||||
<tr><td class="" style='width=32px'></td><td class="left">Empty</td><td class="left"></td></tr>
|
||||
<tr><td class="dr" style='width=32px'></td><td class="left">Error!</td><td class="left">Graphics fall outside the valid range.</td></tr>
|
||||
</table>
|
||||
</td><td class='main'>
|
||||
<div id="VRAMBGAlloc">
|
||||
<div id='BGAllocationTable'>Javascript must be enabled</div>
|
||||
<div id='BGAllocationTable'>Loading...</div>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
173
vram.js
173
vram.js
@ -1,8 +1,7 @@
|
||||
function getParameterByName(name) {
|
||||
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||||
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
||||
var regex = new RegExp(regexS);
|
||||
var results = regex.exec(window.location.search);
|
||||
var regex = new RegExp("[\\#&]" + name + "=([^&#]*)");
|
||||
var results = regex.exec(window.location.hash);
|
||||
if(results == null)
|
||||
return "";
|
||||
else
|
||||
@ -11,9 +10,8 @@ function getParameterByName(name) {
|
||||
|
||||
function hasParameterByName(name) {
|
||||
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
||||
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
||||
var regex = new RegExp(regexS);
|
||||
var results = regex.exec(window.location.search);
|
||||
var regex = new RegExp("[\\#&]" + name + "=([^&#]*)");
|
||||
var results = regex.exec(window.location.hash);
|
||||
if(results == null)
|
||||
return false;
|
||||
else
|
||||
@ -24,6 +22,7 @@ function V2Digits(size) {
|
||||
return Math.round(size * 100) / 100;
|
||||
}
|
||||
|
||||
var SubEngine = 0;
|
||||
var DISPCNT_MapBase = 0;
|
||||
var DISPCNT_TileBase = 0;
|
||||
|
||||
@ -60,14 +59,16 @@ var BGType_B16Siz = [16, 48, 64, 128, 256];
|
||||
var ShareLink;
|
||||
var Function_Call;
|
||||
var CPU_Access;
|
||||
var MaxAllocated;
|
||||
|
||||
function loadp() {
|
||||
var i;
|
||||
var i, j;
|
||||
|
||||
// Initialize 2D array
|
||||
for (i=0; i<8; i++) VRAM_BGMapping[i] = Array();
|
||||
|
||||
// Setup options
|
||||
if (hasParameterByName('SUB')) document.forms['bgvram'].SubEngine.checked = (getParameterByName('SUB') != 0) ? true : false;
|
||||
if (hasParameterByName('MS')) document.forms['bgvram'].MS.options.selectedIndex = getParameterByName('MS');
|
||||
if (hasParameterByName('TS')) document.forms['bgvram'].TS.options.selectedIndex = getParameterByName('TS');
|
||||
if (hasParameterByName('T0')) document.forms['bgvram'].T0.options.selectedIndex = getParameterByName('T0');
|
||||
@ -103,6 +104,12 @@ function loadp() {
|
||||
document.forms['bgvram'].B16S3.options.selectedIndex = getParameterByName('S3');
|
||||
}
|
||||
|
||||
// Set all options to a valid state
|
||||
for (i=0; i<document.forms['bgvram'].length; i++) {
|
||||
j = document.forms['bgvram'].elements[i];
|
||||
if ((j.type == 'select-one') && (j.selectedIndex == -1)) j.selectedIndex = 0;
|
||||
}
|
||||
|
||||
// Update
|
||||
upd();
|
||||
}
|
||||
@ -117,14 +124,16 @@ function bg_alloc_from(bgnum, bgtype, size, maxtiles, mapbase, tilebase) {
|
||||
sz = Math.ceil(sz_t);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_TileBase * 32) + (tilebase * 8) + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum][j] = 1;
|
||||
}
|
||||
|
||||
sz_m = BGType_TSiz[size];
|
||||
sz = Math.ceil(sz_m);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_MapBase * 32) + mapbase + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
}
|
||||
}
|
||||
else if (bgtype == 2) {
|
||||
@ -132,14 +141,16 @@ function bg_alloc_from(bgnum, bgtype, size, maxtiles, mapbase, tilebase) {
|
||||
sz = Math.ceil(sz_t);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_TileBase * 32) + (tilebase * 8) + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum][j] = 1;
|
||||
}
|
||||
|
||||
sz_m = BGType_TSiz[size];
|
||||
sz = Math.ceil(sz_m);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_MapBase * 32) + mapbase + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
}
|
||||
}
|
||||
else if (bgtype == 3) {
|
||||
@ -147,14 +158,16 @@ function bg_alloc_from(bgnum, bgtype, size, maxtiles, mapbase, tilebase) {
|
||||
sz = Math.ceil(sz_t);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_TileBase * 32) + (tilebase * 8) + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum][j] = 1;
|
||||
}
|
||||
|
||||
sz_m = BGType_RSiz[size];
|
||||
sz = Math.ceil(sz_m);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_MapBase * 32) + mapbase + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
}
|
||||
}
|
||||
else if (bgtype == 4) {
|
||||
@ -162,14 +175,16 @@ function bg_alloc_from(bgnum, bgtype, size, maxtiles, mapbase, tilebase) {
|
||||
sz = Math.ceil(sz_t);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_TileBase * 32) + (tilebase * 8) + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum][j] = 1;
|
||||
}
|
||||
|
||||
sz_m = BGType_ERSiz[size];
|
||||
sz = Math.ceil(sz_m);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_MapBase * 32) + mapbase + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum+1][j] = 1;
|
||||
}
|
||||
}
|
||||
else if (bgtype == 5) {
|
||||
@ -177,7 +192,8 @@ function bg_alloc_from(bgnum, bgtype, size, maxtiles, mapbase, tilebase) {
|
||||
sz = Math.ceil(sz_t);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_MapBase * 32) + (mapbase * 8) + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum][j] = 2;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum][j] = 2;
|
||||
}
|
||||
|
||||
sz_m = 0;
|
||||
@ -187,7 +203,8 @@ function bg_alloc_from(bgnum, bgtype, size, maxtiles, mapbase, tilebase) {
|
||||
sz = Math.ceil(sz_t);
|
||||
for (i=0; i<sz; i++) {
|
||||
j = (DISPCNT_MapBase * 32) + (mapbase * 8) + i;
|
||||
if ((j >= 0) && (j < 257)) VRAM_BGMapping[bgnum][j] = 2;
|
||||
if (j >= 256) j = 256;
|
||||
if (j >= 0) VRAM_BGMapping[bgnum][j] = 2;
|
||||
}
|
||||
|
||||
sz_m = 0;
|
||||
@ -202,14 +219,29 @@ function bg_alloc_conflict() {
|
||||
for (i=0; i<256; i++) {
|
||||
VRAM_BGError[i] = 0;
|
||||
numweight = 0;
|
||||
|
||||
// Mark weight
|
||||
for (bg=0; bg<8; bg+=2) {
|
||||
// Mark weight
|
||||
if (SubEngine && (i >= 64) && (VRAM_BGMapping[bg][i] != 0)) numweight += 4;
|
||||
if (VRAM_BGMapping[bg+1][i] != 0) numweight += 4;
|
||||
if (VRAM_BGMapping[bg][i] == 1) numweight++;
|
||||
if (VRAM_BGMapping[bg][i] >= 2) numweight += numweight+1;
|
||||
if (VRAM_BGMapping[bg+1][i] != 0) numweight += 2;
|
||||
if (VRAM_BGMapping[bg][i] >= 2) numweight += (numweight == 0) ? 1 : 4;
|
||||
}
|
||||
if (numweight == 2) {
|
||||
// Mark warnings
|
||||
|
||||
// Mark valid
|
||||
if (numweight <= 1)
|
||||
{
|
||||
if (SubEngine && (i >= 64))
|
||||
{
|
||||
for (bg=0; bg<8; bg++) {
|
||||
VRAM_BGMapping[bg][i] = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Mark warnings
|
||||
if ((numweight >= 2) && (numweight < 5))
|
||||
{
|
||||
for (bg=0; bg<8; bg+=2) {
|
||||
if (VRAM_BGMapping[bg][i] > 0) {
|
||||
VRAM_BGMapping[bg][i] = 3;
|
||||
@ -217,11 +249,27 @@ function bg_alloc_conflict() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (numweight >= 3) {
|
||||
// Mark errors
|
||||
|
||||
// Mark errors
|
||||
if (numweight >= 5)
|
||||
{
|
||||
for (bg=0; bg<8; bg+=2) {
|
||||
if (VRAM_BGMapping[bg][i] > 0) VRAM_BGMapping[bg][i] = 4;
|
||||
if (VRAM_BGMapping[bg+1][i] > 0) VRAM_BGMapping[bg+1][i] = 4;
|
||||
if (SubEngine && (i >= 64))
|
||||
{
|
||||
if (VRAM_BGMapping[bg][i] > 0)
|
||||
VRAM_BGMapping[bg][i] = 6;
|
||||
else
|
||||
VRAM_BGMapping[bg][i] = 5;
|
||||
if (VRAM_BGMapping[bg+1][i] > 0)
|
||||
VRAM_BGMapping[bg+1][i] = 6;
|
||||
else
|
||||
VRAM_BGMapping[bg+1][i] = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VRAM_BGMapping[bg][i] > 0) VRAM_BGMapping[bg][i] = 4;
|
||||
if (VRAM_BGMapping[bg+1][i] > 0) VRAM_BGMapping[bg+1][i] = 4;
|
||||
}
|
||||
}
|
||||
VRAM_BGError[i] = 1;
|
||||
ret = 3;
|
||||
@ -241,16 +289,17 @@ function bg_alloc_conflict() {
|
||||
function bg_allocation() {
|
||||
var i, sz, szopt, maxtiles, mapbase, tilebase;
|
||||
var bgtype0, bgtype1, bgtype2, bgtype3;
|
||||
var wmode, funccallsub, a, b;
|
||||
var wmode, a, b;
|
||||
var bgcodesnippet = "";
|
||||
var largebitmap = false;
|
||||
|
||||
// Set DISPCNT offsets
|
||||
SubEngine = document.forms['bgvram'].SubEngine.checked;
|
||||
if (SubEngine) ShareLink += "&SUB=1";
|
||||
DISPCNT_MapBase = document.forms['bgvram'].MS.options.selectedIndex;
|
||||
if (DISPCNT_MapBase != 0) ShareLink += "&MS=" + DISPCNT_MapBase;
|
||||
DISPCNT_TileBase = document.forms['bgvram'].TS.options.selectedIndex;
|
||||
if (DISPCNT_TileBase != 0) ShareLink += "&TS=" + DISPCNT_TileBase;
|
||||
funccallsub = document.forms['bgvram'].FuncCallSub.checked;
|
||||
|
||||
// Setup array
|
||||
for (i=0; i<257; i++) {
|
||||
@ -370,9 +419,10 @@ function bg_allocation() {
|
||||
}
|
||||
if (bgtype0 > 0) {
|
||||
ShareLink += "&S0=" + sz;
|
||||
if (funccallsub) bgcodesnippet += "bgInitSub(0"; else bgcodesnippet += "bgInit(0";
|
||||
bgcodesnippet += ", BgType_" + document.forms['bgvram'].T0.options[document.forms['bgvram'].T0.options.selectedIndex].value;
|
||||
bgcodesnippet += ", BgSize_" + szopt[szopt.selectedIndex].value + ", " + mapbase + ", " + tilebase + ");<br />";
|
||||
bgcodesnippet += "<span class='func'>bgInit" + (SubEngine ? "Sub" : "") + "</span>(<span class='numm'>0</span>";
|
||||
bgcodesnippet += ", <span class='deff'>BgType_" + document.forms['bgvram'].T0.options[document.forms['bgvram'].T0.options.selectedIndex].value + "</span>";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_" + szopt[szopt.selectedIndex].value + "</span>";
|
||||
bgcodesnippet += ", <span class='numm'>" + mapbase + "</span>, <span class='numm'>" + tilebase + "</span>);<br />";
|
||||
}
|
||||
bg_alloc_from(0, bgtype0, sz, maxtiles, mapbase, tilebase);
|
||||
|
||||
@ -403,9 +453,10 @@ function bg_allocation() {
|
||||
}
|
||||
if (bgtype1 > 0) {
|
||||
ShareLink += "&S1=" + sz;
|
||||
if (funccallsub) bgcodesnippet += "bgInitSub(1"; else bgcodesnippet += "bgInit(1";
|
||||
bgcodesnippet += ", BgType_" + document.forms['bgvram'].T1.options[document.forms['bgvram'].T1.options.selectedIndex].value;
|
||||
bgcodesnippet += ", BgSize_" + szopt[szopt.selectedIndex].value + ", " + mapbase + ", " + tilebase + ");<br />";
|
||||
bgcodesnippet += "<span class='func'>bgInit" + (SubEngine ? "Sub" : "") + "</span>(<span class='numm'>1</span>";
|
||||
bgcodesnippet += ", <span class='deff'>BgType_" + document.forms['bgvram'].T1.options[document.forms['bgvram'].T1.options.selectedIndex].value + "</span>";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_" + szopt[szopt.selectedIndex].value + "</span>";
|
||||
bgcodesnippet += ", <span class='numm'>" + mapbase + "</span>, <span class='numm'>" + tilebase + "</span>);<br />";
|
||||
}
|
||||
bg_alloc_from(1, bgtype1, sz, maxtiles, mapbase, tilebase);
|
||||
|
||||
@ -459,17 +510,17 @@ function bg_allocation() {
|
||||
}
|
||||
if (bgtype2 > 0) {
|
||||
ShareLink += "&S2=" + sz;
|
||||
if (funccallsub) bgcodesnippet += "bgInitSub(2"; else bgcodesnippet += "bgInit(2";
|
||||
bgcodesnippet += ", BgType_" + document.forms['bgvram'].T2.options[document.forms['bgvram'].T2.options.selectedIndex].value;
|
||||
bgcodesnippet += "<span class='func'>bgInit" + (SubEngine ? "Sub" : "") + "</span>(<span class='numm'>2</span>";
|
||||
bgcodesnippet += ", <span class='deff'>BgType_" + document.forms['bgvram'].T2.options[document.forms['bgvram'].T2.options.selectedIndex].value + "</span>";
|
||||
if (szopt[szopt.selectedIndex].value == 'B8_256x192')
|
||||
bgcodesnippet += ", BgSize_B8_256x256";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_B8_256x256</span>";
|
||||
else if (szopt[szopt.selectedIndex].value == 'B16_256x192')
|
||||
bgcodesnippet += ", BgSize_B16_256x256";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_B16_256x256</span>";
|
||||
else
|
||||
bgcodesnippet += ", BgSize_" + szopt[szopt.selectedIndex].value;
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_" + szopt[szopt.selectedIndex].value + "</span>";
|
||||
bgcodesnippet += ", <span class='numm'>" + mapbase + "</span>, <span class='numm'>" + tilebase + "</span>);<br />";
|
||||
if ((szopt[szopt.selectedIndex].value == 'B8_512x1024') || (szopt[szopt.selectedIndex].value == 'B8_1024x512')) largebitmap = true;
|
||||
bgcodesnippet += ", " + mapbase + ", " + tilebase + ");<br />";
|
||||
if (funccallsub && largebitmap) bgcodesnippet += "// Error! Large bitmap isn't supported on Sub Engine";
|
||||
if (SubEngine && largebitmap) bgcodesnippet += "<span class='comm'>// Error! Large bitmap isn't supported on Sub Engine</span>";
|
||||
}
|
||||
bg_alloc_from(2, bgtype2, sz, maxtiles, mapbase, tilebase);
|
||||
|
||||
@ -523,15 +574,15 @@ function bg_allocation() {
|
||||
}
|
||||
if (bgtype3 > 0) {
|
||||
ShareLink += "&S3=" + sz;
|
||||
if (funccallsub) bgcodesnippet += "bgInitSub(3"; else bgcodesnippet += "bgInit(3";
|
||||
bgcodesnippet += ", BgType_" + document.forms['bgvram'].T3.options[document.forms['bgvram'].T3.options.selectedIndex].value;
|
||||
bgcodesnippet += "<span class='func'>bgInit" + (SubEngine ? "Sub" : "") + "</span>(<span class='numm'>3</span>";
|
||||
bgcodesnippet += ", <span class='deff'>BgType_" + document.forms['bgvram'].T3.options[document.forms['bgvram'].T3.options.selectedIndex].value + "</span>";
|
||||
if (szopt[szopt.selectedIndex].value == 'B8_256x192')
|
||||
bgcodesnippet += ", BgSize_B8_256x256";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_B8_256x256</span>";
|
||||
else if (szopt[szopt.selectedIndex].value == 'B16_256x192')
|
||||
bgcodesnippet += ", BgSize_B16_256x256";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_B16_256x256</span>";
|
||||
else
|
||||
bgcodesnippet += ", BgSize_" + szopt[szopt.selectedIndex].value;
|
||||
bgcodesnippet += ", " + mapbase + ", " + tilebase + ");<br />";
|
||||
bgcodesnippet += ", <span class='deff'>BgSize_" + szopt[szopt.selectedIndex].value + "</span>";
|
||||
bgcodesnippet += ", <span class='numm'>" + mapbase + "</span>, <span class='numm'>" + tilebase + "</span>);<br />";
|
||||
}
|
||||
bg_alloc_from(3, bgtype3, sz, maxtiles, mapbase, tilebase);
|
||||
|
||||
@ -559,7 +610,7 @@ function bg_allocation() {
|
||||
switch (bgcstatus)
|
||||
{
|
||||
case 1: document.getElementById('Mapping_Status').innerHTML = "VRAM BG Allocation okay!"; break;
|
||||
case 2: document.getElementById('Mapping_Status').innerHTML = "<i>Warning:</i> VRAM BG Allocation has some warnings, ignore if gfx has shared tileset graphics."; break;
|
||||
case 2: document.getElementById('Mapping_Status').innerHTML = "<b>Warning:</b> VRAM BG Allocation has some warnings, ignore if gfx has shared tileset graphics."; break;
|
||||
case 3: document.getElementById('Mapping_Status').innerHTML = "<b>Error:</b> VRAM BG Allocation has errors."; break;
|
||||
case 4: document.getElementById('Mapping_Status').innerHTML = "<b>Error:</b> VRAM BG Allocation is outside the range."; break;
|
||||
}
|
||||
@ -581,16 +632,21 @@ function bg_allocation() {
|
||||
else
|
||||
{
|
||||
document.getElementById('Recommended_Mode').innerHTML = "<b>Mode " + wmode + "</b> will support your options.";
|
||||
if (funccallsub && largebitmap)
|
||||
if (SubEngine && largebitmap)
|
||||
{
|
||||
document.getElementById('Recommended_Mode').innerHTML = "<b>Error:</b> Sub Engine don't support large bitmaps.";
|
||||
document.getElementById('Working_Engines').innerHTML = "<b>Error:</b> Combination won't work on hardware!";
|
||||
wmode = -1;
|
||||
}
|
||||
else if ((DISPCNT_MapBase == 0) && (DISPCNT_TileBase == 0))
|
||||
else if ((DISPCNT_MapBase == 0) && (DISPCNT_TileBase == 0) && (!largebitmap) && (MaxAllocated < 64))
|
||||
document.getElementById('Working_Engines').innerHTML = "Works for Main Engine or Sub Engine.";
|
||||
else
|
||||
document.getElementById('Working_Engines').innerHTML = "Works for Main Engine only!<br />For Sub Engine map, use DISPCNT 64KB steps of 0.";
|
||||
if (MaxAllocated >= 64)
|
||||
document.getElementById('Working_Engines').innerHTML = "Works for Main Engine only!<br />For Sub Engine map, don't use more than 128KB.";
|
||||
else if (largebitmap)
|
||||
document.getElementById('Working_Engines').innerHTML = "Works for Main Engine only!<br />For Sub Engine map, don't use large bitmap.";
|
||||
else
|
||||
document.getElementById('Working_Engines').innerHTML = "Works for Main Engine only!<br />For Sub Engine map, use DISPCNT 64KB steps of 0.";
|
||||
}
|
||||
|
||||
if ((wmode >= 0) && (bgcstatus < 3)) {
|
||||
@ -605,10 +661,10 @@ function bg_allocation() {
|
||||
|
||||
// Generate function calls
|
||||
if ((wmode < 0) || (bgcstatus >= 3))
|
||||
Function_Call += "// Error(s) found<br />";
|
||||
Function_Call += "<span class='comm'>// Error(s) found<br />";
|
||||
else
|
||||
{
|
||||
Function_Call += "videoSetMode" + (funccallsub ? "Sub" : "") + "(MODE_" + wmode + "_2D);<br />";
|
||||
Function_Call += "<span class='func'>videoSetMode" + (SubEngine ? "Sub" : "") + "</span>(<span class='deff'>MODE_" + wmode + "_2D</span>);<br />";
|
||||
if (bgcodesnippet.length > 0) Function_Call += "<br />";
|
||||
Function_Call += bgcodesnippet;
|
||||
}
|
||||
@ -669,6 +725,7 @@ function bg_allocation_table() {
|
||||
for (j=0; j<8; j++) {
|
||||
td = document.createElement('TD');
|
||||
td.style.backgroundColor = ColorCode[VRAM_BGMapping[j][i]];
|
||||
if (VRAM_BGMapping[j][i] != 0) MaxAllocated = i;
|
||||
tr.appendChild(td);
|
||||
}
|
||||
|
||||
@ -709,6 +766,7 @@ function upd() {
|
||||
ShareLink = "";
|
||||
Function_Call = "";
|
||||
CPU_Access = "";
|
||||
MaxAllocated = 0;
|
||||
|
||||
// Update BG allocation
|
||||
bg_allocation();
|
||||
@ -717,11 +775,8 @@ function upd() {
|
||||
bg_allocation_table();
|
||||
|
||||
// Update globals
|
||||
ShareLink = "?" + ShareLink.substring(1);
|
||||
ShareLink = "#" + ShareLink.substring(1);
|
||||
document.getElementById('ShareLink').innerHTML = "<a href=" + ShareLink + ">" + ShareLink + "</a>";
|
||||
if (Function_Call.length == 0) {
|
||||
document.getElementById('FunctionCall').innerHTML = "// Empty";
|
||||
}
|
||||
else
|
||||
document.getElementById('FunctionCall').innerHTML = Function_Call;
|
||||
document.getElementById('FunctionCall').innerHTML = Function_Call;
|
||||
window.location.hash = ShareLink;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user