java - How to translate this javascript code which uses array of functions binded and recursively called inside -
it's written in javascript started translating java, got stuck don't see other way this.
i make initializelcdcontroller
getlinecontrol(int index)
not use function binded arrays method.
public void initializelcdcontroller() { long = 0; while (a < 154) { if (a < 143) { linecontrol[a] = function () { if (lcdticks < 80) { scanlinemode2(); } else if (lcdticks < 252) { scanlinemode3(); } else if (lcdticks < 456) { scanlinemode0(); } else { lcdticks -= 456; if (stattracker != 3) { if (stattracker != 2) { if (stattracker == 0 && mode2triggerstat) { interruptsrequested |= 2; } incrementscanlinequeue(); } if (hdmarunning) { executehdma(); } if (mode0triggerstat) { interruptsrequested |= 2; } } actualscanline = ++memory[65348]; if (actualscanline == memory[65349]) { memory[65345] |= 4; if (lycmatchtriggerstat) { interruptsrequested |= 2; } } else { memory[65345] &= 123; } checkirqmatching(); stattracker = 0; modestat = 2; linecontrol[actualscanline](); } } } else if (a == 143) { linecontrol[143] = function () { if (lcdticks < 80) { scanlinemode2(); } else if (b.lcdticks < 252) { scanlinemode3(); } else if (b.lcdticks < 456) { scanlinemode0(); } else { lcdticks -= 456; if (stattracker != 3) { if (stattracker != 2) { if (stattracker == 0 && mode2triggerstat) { interruptsrequested |= 2; } incrementscanlinequeue(); } if (hdmarunning) { executehdma(); } if (mode0triggerstat) { interruptsrequested |= 2; } } actualscanline = b.memory[65348] = 144; if (memory[65349] == 144) { memory[65345] |= 4; if (lycmatchtriggerstat) { interruptsrequested |= 2; } } else { memory[65345] &= 123; } stattracker = 0; modestat = 1; interruptsrequested |= (mode1triggerstat) ? 3 : 1; checkirqmatching(); if (drewblank == 0) { if (totallinespassed < 144 || (totallinespassed == 144 && midscanlineoffset > -1)) { graphicsjitvblank(); prepareframe(); } } else { --drewblank; } linecontrol[144](); } } } else if (a < 153) { linecontrol[a] = function () { if (lcdticks >= 456) { lcdticks -= 456; actualscanline = ++memory[65348]; if (actualscanline == memory[65349]) { memory[65345] |= 4; if (lycmatchtriggerstat) { interruptsrequested |= 2; checkirqmatching(); } } else { memory[65345] &= 123; } linecontrol[actualscanline](); } } } else { linecontrol[153] = function () { if (lcdticks >= 8) { if (stattracker != 4 && memory[65348] == 153) { memory[65348] = 0; if (memory[65349] == 0) { memory[65345] |= 4; if (lycmatchtriggerstat) { interruptsrequested |= 2; checkirqmatching(); } } else { memory[65345] &= 123; } stattracker = 4; } if (lcdticks >= 456) { lcdticks -= 456; stattracker = actualscanline = 0; linecontrol[0](); } } } } ++a; } }
Comments
Post a Comment