Added a god-mode command, '&', to print out the allocated memory blocks.

This commit is contained in:
Martin Haye 2016-08-03 08:41:36 -07:00
parent 2817f1b25e
commit 70ead12fb1
3 changed files with 16 additions and 3 deletions

View File

@ -1496,8 +1496,13 @@ class A2PackPartitions
else {
codeFile.eachLine { line ->
def m = line =~ /^\s*include\s+"([^"]+)"/
if (m)
if (m) {
deps << jitCopy(new File(baseDir, m.group(1)))
if (m.group(1) =~ /.*gamelib.plh/ && !(codeFile =~ /.*gameloop.pla/)) {
println "Dep for $codeFile: ${m.group(1)} -> gameLoop.pla"
deps << jitCopy(new File(baseDir, m.group(1).replace("gamelib.plh", "gameloop.pla")))
}
}
m = line =~ /^\s*!(source|convtab) "([^"]+)"/
if (m) {
if (codeFile ==~ /.*\.pla$/) {

View File

@ -1508,11 +1508,9 @@ aux_dispatch:
+ cmp #FREE_MEMORY
bne +
jmp mem_free
!if DEBUG {
+ cmp #DEBUG_MEM
bne +
jmp printMem
}
+ cmp #CALC_FREE
bne +
jmp mem_calcFree

View File

@ -2130,6 +2130,15 @@ def addItem()
^$c052
end
def printMem
flipToPage1
^$c051
mmgr(DEBUG_MEM, 0)
rdkey
auxMmgr(DEBUG_MEM, 0)
rdkey
^$c050
end
def setCheatCmds
// install cheat commands
cmdTbl['T'] = @kbdTeleport
@ -2140,6 +2149,7 @@ def setCheatCmds
cmdTbl['!'] = @testCombat
cmdTbl['Y'] = @nextSky
cmdTbl['G'] = @nextGround
cmdTbl['&'] = @printMem
end
def enableGodMode()
if ^$C061 >= 128 and ^$C062 >= 128