mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-06-15 14:29:29 +00:00
Compare commits
2 Commits
7f0b3c5d83
...
90771cb31e
Author | SHA1 | Date | |
---|---|---|---|
|
90771cb31e | ||
|
e8c6fb3efe |
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -68,3 +68,6 @@ error_stack.txt
|
||||||
# Ignore NetBeans project files
|
# Ignore NetBeans project files
|
||||||
Platform/Apple/tools/jace/nb-configuration.xml
|
Platform/Apple/tools/jace/nb-configuration.xml
|
||||||
Platform/Apple/tools/jace/nbactions.xml
|
Platform/Apple/tools/jace/nbactions.xml
|
||||||
|
|
||||||
|
# Ignore temporary pom files
|
||||||
|
Platform/Apple/tools/jace/runPom.xml
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.TreeMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
@ -76,12 +77,27 @@ public class LawlessHacks extends Cheats {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enhance text rendering by forcing the text to be pure B&W
|
// Enhance text rendering by forcing the text to be pure B&W
|
||||||
|
Map<Integer, Integer> detectedEntryPoints = new TreeMap<>();
|
||||||
|
long lastStatus = 0;
|
||||||
private void enhanceText(RAMEvent e) {
|
private void enhanceText(RAMEvent e) {
|
||||||
if (!e.isMainMemory()) {
|
if (!e.isMainMemory()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int pc = Emulator.withComputer(c->c.getCpu().getProgramCounter(), 0);
|
int pc = Emulator.withComputer(c->c.getCpu().getProgramCounter(), 0);
|
||||||
boolean drawingText = pc == 0x0ee46 || pc > 0x0f300;
|
boolean drawingText = (pc >= 0x0ee00 && pc <= 0x0f0c0) || pc > 0x0f100;
|
||||||
|
if (DEBUG) {
|
||||||
|
if (drawingText) {
|
||||||
|
detectedEntryPoints.put(pc, detectedEntryPoints.getOrDefault(pc, 0) + 1);
|
||||||
|
}
|
||||||
|
if ((System.currentTimeMillis() - lastStatus) >= 10000) {
|
||||||
|
lastStatus = System.currentTimeMillis();
|
||||||
|
System.out.println("---text entry points---");
|
||||||
|
detectedEntryPoints.forEach((addr, count) -> {
|
||||||
|
System.out.println(Integer.toHexString(addr) + ": " + count);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Emulator.withVideo(v -> {
|
Emulator.withVideo(v -> {
|
||||||
if (v instanceof LawlessVideo) {
|
if (v instanceof LawlessVideo) {
|
||||||
LawlessVideo video = (LawlessVideo) v;
|
LawlessVideo video = (LawlessVideo) v;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user