mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-09-29 11:55:21 +00:00
Removed font speedup hacks -- we should just rely on transwarp softswitch for speedups.
This commit is contained in:
parent
aa9a94b678
commit
461fe41f79
@ -1,7 +1,5 @@
|
||||
package jace.lawless;
|
||||
|
||||
import jace.apple2e.MOS65C02;
|
||||
import jace.apple2e.SoftSwitches;
|
||||
import jace.cheat.Cheats;
|
||||
import jace.core.Computer;
|
||||
import jace.core.RAMEvent;
|
||||
@ -12,11 +10,6 @@ import jace.lawless.LawlessVideo.RenderEngine;
|
||||
*/
|
||||
public class LawlessHacks extends Cheats {
|
||||
|
||||
// Location of font routines
|
||||
int FONT_ROUTINES = 0x0EC00;
|
||||
int FONT_ROUTINES_END = 0x0f800;
|
||||
int FONT_SPEEDUP_CYCLES = 10000;
|
||||
int FONT_ROUTINES_LEN = 0x0f00;
|
||||
// Modes specified by the game engine
|
||||
int MODE_SOFTSWITCH = 0x0C020;
|
||||
|
||||
@ -28,21 +21,6 @@ public class LawlessHacks extends Cheats {
|
||||
@Override
|
||||
public void registerListeners() {
|
||||
// Observe graphics changes
|
||||
addCheat(RAMEvent.TYPE.WRITE, (e) -> {
|
||||
if (e.getAddress() >= 0x02000 && e.getAddress() <= 0x05FFF) {
|
||||
((LawlessVideo) computer.getVideo()).setBWFlag(e.getAddress(),
|
||||
!SoftSwitches.RAMWRT.getState() ||
|
||||
computer.getCpu().getProgramCounter() < FONT_ROUTINES ||
|
||||
computer.getCpu().getProgramCounter() > FONT_ROUTINES_END);
|
||||
}
|
||||
}, 0x02000, 0x05FFF);
|
||||
// Watch for font routine usage for speedup
|
||||
addCheat(RAMEvent.TYPE.EXECUTE, (e) -> {
|
||||
if ((e.getAddress() & 0x0ff00) == FONT_ROUTINES) {
|
||||
computer.motherboard.requestSpeed(this);
|
||||
}
|
||||
}, FONT_ROUTINES, FONT_ROUTINES | 0x0ff);
|
||||
// Try to detect engines changing
|
||||
addCheat(RAMEvent.TYPE.ANY, false, (e) -> {
|
||||
if ((e.getAddress() & 0x0FFF0) == MODE_SOFTSWITCH) {
|
||||
System.out.println("Trapped " + e.getType().toString() + " to $"+Integer.toHexString(e.getAddress()));
|
||||
|
@ -84,25 +84,6 @@ public class LawlessVideo extends VideoNTSC {
|
||||
System.out.println("Detected engine same as before: " + e.name());
|
||||
}
|
||||
}
|
||||
|
||||
public void setBWFlag(int addr, boolean b) {
|
||||
addr &= 0x01FFF;
|
||||
int row = VideoNTSC.identifyHiresRow(addr);
|
||||
if (row < 0 || row > 192) {
|
||||
return;
|
||||
}
|
||||
int col = addr - VideoNTSC.calculateHiresOffset(row);
|
||||
/*
|
||||
if (row > 20 && row < 136 && col < 20) {
|
||||
boolean prev = activeMask[row][col*2];
|
||||
activeMask[row][col*2] = b;
|
||||
activeMask[row][col*2+1] = b;
|
||||
if (prev ^ b) {
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
static public int[] divBy56 = new int[560];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user