Fixed display problems with godmode teleport.

This commit is contained in:
Martin Haye 2017-08-14 08:16:38 -07:00
parent 9c45ed0fb5
commit abcf6f9c94
3 changed files with 15 additions and 9 deletions

View File

@ -39,6 +39,7 @@ import gamelib
predef countArray(arr)#1
predef countList(p)#1
predef countListFiltered(p, offset, filterFunc)#1
predef crout()#0
predef displayChar(chr)#0
predef displayf1(fmt, arg1)#0
predef displayf2(fmt, arg1, arg2)#0

View File

@ -730,7 +730,7 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Print a carriage return
asm crout()#0
export asm crout()#0
+asmPlasmNoRet 0
lda #$8D
jmp _safeCout
@ -2568,6 +2568,7 @@ def toggleGodMode()#1
if ^kbd == $84 // ctrl-D
^kbdStrobe
global->b_godmode = !global->b_godmode
flipToPage1()
clearTextWindow()
displayf1("gm:%d\n", global->b_godmode & 1)
beep; beep

View File

@ -24,6 +24,14 @@ predef _addItem(player)#1
predef _addPlayer()#1
word[] funcTbl = @_setCheatCmds, @_addItem, @_addPlayer
///////////////////////////////////////////////////////////////////////////////////////////////////
def splitScreenMode()#0
flipToPage1()
textHome()
^$c053
^$25 = 19
crout()
end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Godmode cheats
@ -32,12 +40,10 @@ def kbdTeleport()#1
word x, y
byte dir
flipToPage1()
^$c053
if ^$25 < 23; ^$25 = 23; fin
splitScreenMode()
getPos(@x, @y)
dir = getDir()
printf3("\nCurrent: X=%d Y=%d Facing=%d\n", x, y, dir)
printf3("Current: X=%d Y=%d Facing=%d\n", x, y, dir)
printf1("3D [%d]: ", mapIs3D)
d3 = parseDecWithDefault(readStr(), mapIs3D)
@ -62,11 +68,9 @@ def showPos()#1
word x, y
byte dir
flipToPage1()
^$c053
if ^$25 < 23; ^$25 = 23; fin
splitScreenMode()
getPos(@x, @y)
printf2("\nX=%d Y=%d ", x, y)
printf2("X=%d Y=%d ", x, y)
if mapIs3D
printf3("Facing=%d Sky=%d Ground=%d", getDir(), skyNum, groundNum)
fin