Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PacManX = $1A
- PacManX_decimal = $1B
- PacManY = $1C
- PacManY_decimal = $1D
- BlinkyX = $1E
- BlinkyX_decimal = $1F
- BlinkyY = $20
- BlinkyY_decimal = $21
- PinkyX = $22
- PinkyX_decimal = $23
- PinkyY = $24
- PinkyY_decimal = $25
- InkyX = $26
- InkyX_decimal = $27
- InkyY = $28
- InkyY_decimal = $29
- ClydeX = $2A
- ClydeX_decimal = $2B
- ClydeY = $2C
- ClydeY_decimal = $2D
- PacMan_CHR_pattern = $32
- Blinky_CHR_pattern = $33
- Pinky_CHR_pattern = $34
- Inky_CHR_pattern = $35
- Clyde_CHR_pattern = $36
- GhoatPallet = $39-$3C
- PlayingFlag = $48
- Direction = $50
- DirectionBuffer = $51
- HiScore = $61-$66
- RemainingLives = $67
- StageCount = $68
- RestartFlag = $69
- DotCount = $6A
- ExtendsCount = $6B
- PowerPillState1 = $6C
- PowerPillState2 = $6D
- PowerPillState3 = $6E
- PowerPillState4 = $6F
- Score = $70-$75
- AnotherPlayerBuffer = $77-$86
- FrightFlag = $88
- FrightTimerSeconds = $89
- FrightTimerFrames = $8A
- BrinkySpeedCounter1 = $8D
- BrinkySpeedCounter2 = $8E
- ModeTimer = $97-$9E
- SpeedTable = $9F-$B4
- CurrentPacManSpeed = $B5-$B6
- PacManRunCounter = $B7
- BlinkyStatus = $B8
- BlinkyDirection = $B9
- PinkyStatus = $BA
- PinkyDirection = $BB
- InkyStatus = $BC
- InkyDirection = $BD
- ClydeStatus = $BE
- ClydeDirection = $BF
- TargetX = $CD
- TargetY = $CE
- ModeCounterSeconds = $CF
- GhostMode = $D0
- ModeCounterFrames = $D1
- FruitsTimerSeconds = $D7
- FruitsTimerFrames = $D8
- PacMan_Current_VRAM_Address = $0200-$0201
- PacMan_Upside_VRAM_Address = $0202-$0203
- PacMan_Left_VRAM_Address = $0204-$0205
- PacMan_Downside_VRAM_Address = $0206-$0207
- PacMan_Rightside_VRAM_Address = $0208-$0209
- Blinky_Upside_VRAM_Address = $020A-$020B
- Blinky_Left_VRAM_Address = $020C-$020D
- Blinky_Downside_VRAM_Address = $020E-$020F
- Blinky_Rightside_VRAM_Address = $0210-$0211
- Pinky_Upside_VRAM_Address = $0212-$0213
- Pinky_Left_VRAM_Address = $0214-$0215
- Pinky_Downside_VRAM_Address = $0216-$0217
- Pinky_Rightside_VRAM_Address = $0218-$0219
- Inky_Upside_VRAM_Address = $021A-$021B
- Inky_Left_VRAM_Address = $021C-$021D
- Inky_Downside_VRAM_Address = $021E-$021F
- Inky_Rightside_VRAM_Address = $0220-$0221
- Clyde_Upside_VRAM_Address = $0222-$0223
- Clyde_Left_VRAM_Address = $0224-$0225
- Clyde_Downside_VRAM_Address = $0226-$0227
- Clyde_Rightside_VRAM_Address = $0228-$0229
- PacMan_CurrentBlock = $022A
- PacMan_UpsideBlock = $022B
- PacMan_LeftsideBlock = $022C
- PacMan_DownsideBlock = $022D
- PacMan_RightsideBlock = $022E
- Blinky_UpsideBlock = $022F
- Blinky_LeftsideBlock = $0230
- Blinky_DownsideBlock = $0231
- Blinky_RightsideBlock = $0232
- Pinky_UpsideBlock = $0233
- Pinky_LeftsideBlock = $0234
- Pinky_DownsideBlock = $0235
- Pinky_RightsideBlock = $0236
- Inky_UpsideBlock = $0237
- Inky_LeftsideBlock = $0238
- Inky_DownsideBlock = $0239
- Inky_RightsideBlock = $023A
- Clyde_UpsideBlock = $023B
- Clyde_LeftsideBlock = $023C
- Clyde_DownsideBlock = $023D
- Clyde_RightsideBlock = $023E
- ]]
- Direction = {"U","L","D","R"}
- ColorTable = {"#FC9838","#A40000","#D4C8FC","#3CBCFC","#C84C0C","#0070EC","#C84C0C70"}
- TargetPosition = {0,0,0,0,0,0,0,0}
- InvincibleMode = true
- DisplayParameter = false
- KeyBuffer = {}
- KeyInput = {}
- GhostPattern = 0x33
- PacManX = 0x1A
- PacManY = 0x1C
- GhostX = 0x1E
- GhostY = 0x20
- FruitsTargetFlag = 0x30
- FruitsOBJ_No = 0x37
- PlayingFlag = 0x48
- PauseCounter = 0x4A
- StageCount = 0x68
- DotCount = 0x6A
- FrightTimerSeconds = 0x89
- FrightTimerFrames = 0x8A
- BrinkySpeedCounter1 = 0x8D
- BrinkySpeedCounter2 = 0x8E
- CurrentPacManSpeed = 0xB5
- GhostStatus = 0xB8
- GhostDirection = 0xB9
- CurrentBlinkySpeed = 0xC2
- CurrentPinkySpeed = 0xC4
- CurrentInkySpeed = 0xC6
- CurrentClydeSpeed = 0xC8
- ModeCounterSeconds = 0xCF
- GhostMode = 0xD0
- ModeCounterFrames = 0xD1
- ElroyModeFlag = 0xD2
- FruitsTargetTimerS = 0xD7
- FruitsTargetTimerF = 0xD8
- function IsPress()
- KeyBuffer = KeyInput
- KeyInput = joypad.get(1)
- return false
- end
- function Invincible()
- if InvincibleMode then
- memory.setregister("pc", 0xD2B0)
- end
- end
- function BDash()
- if KeyInput["B"] then
- memory.writebyte(0xB5, 0xE0)
- memory.writebyte(0xB6, 0x01)
- end
- end
- function Brinky_taeget()
- TargetPosition[1] = memory.readbyte(0xCD)
- TargetPosition[2] = memory.readbyte(0xCE)
- end
- function Pinky_taeget()
- TargetPosition[3] = memory.readbyte(0xCD)
- TargetPosition[4] = memory.readbyte(0xCE)
- end
- function Inky_taeget()
- TargetPosition[5] = memory.readbyte(0xCD)
- TargetPosition[6] = memory.readbyte(0xCE)
- end
- function Clyde_taeget()
- TargetPosition[7] = memory.readbyte(0xCD)
- TargetPosition[8] = memory.readbyte(0xCE)
- end
- memory.registerexecute(0xD2A2,Invincible)
- memory.register(0x00B6, BDash)
- memory.register(0x00B9, Brinky_taeget)
- memory.register(0x00BB, Pinky_taeget)
- memory.register(0x00BD, Inky_taeget)
- memory.register(0x00BF, Clyde_taeget)
- while true do
- if KeyInput["A"] and not KeyBuffer["A"] and not KeyInput["B"] then
- DisplayParameter = not(DisplayParameter)
- end
- IsPress()
- if KeyInput["select"] and not KeyBuffer["select"] then
- InvincibleMode = not(InvincibleMode)
- end
- if InvincibleMode then
- gui.text(180, 220, "Invincible Mode", white)
- end
- if
- KeyInput["A"] and KeyInput["B"] and not KeyBuffer["A"] and
- memory.readbyte(0x3F) ~= 0x10 and
- memory.readbyte(0x3F) ~= 0x00 and
- memory.readbyte(PlayingFlag) ~= 0xFF then
- -- memory.writebyte(0x6A, 0x00)
- memory.writebyte(0x3F, 0x0C)
- memory.writebyte(0x87, 0x00)
- -- memory.writebyte(0x4C, 0x48)
- memory.writebyte(0x6C, 0x07)
- memory.writebyte(0x6D, 0x07)
- memory.writebyte(0x6E, 0x07)
- memory.writebyte(0x6F, 0x07)
- for i=0, 0x3B do
- memory.writebyte(0x0760 + i, 0x00)
- end
- end
- -- for i=0, 16, 4 do
- -- gui.drawbox(memory.readbyte(PacManX + i) - 12, memory.readbyte(PacManY + i) + 4, memory.readbyte(PacManX + i) + 3, memory.readbyte(PacManY + i) + 19, 0, ColorTable[i / 4 + 1])
- -- end
- keys = input.get()
- DrugX = keys.xmouse - keys.xmouse % 8 + 8
- DrugY = keys.ymouse - keys.ymouse % 8 - 8
- if keys["leftclick"] then
- for i=0, 16, 4 do
- if
- memory.readbyte(PacManX + i) - 20 <= keys.xmouse and
- keys.xmouse <= memory.readbyte(PacManX + i) + 11 and
- memory.readbyte(PacManY + i) - 4 <= keys.ymouse and
- keys.ymouse <= memory.readbyte(PacManY + i) + 27 then
- memory.writebyte(PacManX + i, DrugX)
- memory.writebyte(PacManY + i, DrugY)
- end
- end
- end
- if
- memory.readbyte(0x6C) ~= 0x2D then
- if
- DisplayParameter and
- memory.readbyte(0x3F) ~= 0x00 and
- memory.readbyte(0x3F) ~= 0x10 then
- gui.drawbox(176, 24, 248, 219, "#000000")
- Stage = string.sub(" " .. memory.readbyte(StageCount) + 1, -3)
- gui.text(180, 20, "Stage", ColorTable[6], 0)
- gui.text(183, 28, string.sub(" " .. Stage, -11), white, 0)
- --ゴーストモードタイマー表示
- if memory.readbyte(GhostMode) % 2 == 0x00 then
- Mode = "Scatter"
- TextColor = "black"
- ModeColor = "green"
- else
- Mode = " Chase "
- TextColor = "white"
- ModeColor = "red"
- end
- ModeFrames = string.sub("0" .. 59 - memory.readbyte(ModeCounterFrames), -2)
- ModeSeconds = string.sub("0" .. memory.readbyte(ModeCounterSeconds), -2)
- if memory.readbyte(ModeCounterSeconds) == 255 then
- count = "__:__"
- else
- count = ModeSeconds .. ":" .. ModeFrames
- end
- gui.text(180,36, "Ghost Mode", ColorTable[6], 0)
- gui.text(180,44, Mode, TextColor, ModeColor)
- gui.text(180,44, string.sub(" " .. count, -12), white, 0)
- TimerFrames = string.sub("0" .. 59 - memory.readbyte(FrightTimerFrames), -2)
- TimerSeconds = string.sub("0" .. memory.readbyte(FrightTimerSeconds), -2)
- if memory.readbyte(FrightTimerSeconds) == 255 then
- FrightTimer = "__:__"
- FrightColor = "white"
- else
- FrightTimer = TimerSeconds .. ":" .. TimerFrames
- FrightColor = "red"
- end
- gui.text(180, 52, "Fright Timer", ColorTable[6], 0)
- gui.text(180, 60, string.sub(" " .. FrightTimer, -12), white, 0)
- DotsLeft = memory.readbyte(DotCount)
- EatenDots = 192 - DotsLeft
- gui.text(180, 68, "Dots Left", ColorTable[6], 0)
- gui.text(183, 76, string.sub(" " .. DotsLeft, -11), white, 0)
- FruitsFrames = string.sub("0" .. memory.readbyte(FruitsTargetTimerF) -1, -2)
- FruitsSeconds = string.sub("0" .. memory.readbyte(FruitsTargetTimerS), -2)
- if
- memory.readbyte(FruitsTargetFlag) == 0x80 and
- memory.readbyte(FruitsOBJ_No) >= 0x24 and
- memory.readbyte(FruitsOBJ_No) <= 0x2B then
- Ftimer = FruitsSeconds .. ":" .. FruitsFrames
- else
- Ftimer = "__:__"
- end
- gui.text(180, 84, "Fruits Target", ColorTable[6], 0)
- gui.text(180, 92, string.sub(" " .. Ftimer, -12), white, 0)
- if EatenDots > 58 then
- Fruits1st = "__"
- else
- Fruits1st = "0" .. 58 - EatenDots
- end
- if EatenDots > 137 then
- Fruits2nd = "___"
- else
- Fruits2nd = "00" .. 137 - EatenDots
- end
- gui.text(180, 92, string.sub(Fruits1st, -2) .. "/" .. string.sub(Fruits2nd, -3), white, 0)
- BSCount1 = memory.readbyte(BrinkySpeedCounter1)
- BSCount2 = memory.readbyte(BrinkySpeedCounter2)
- if DotsLeft > BSCount1 then
- BSpeed1 = "00" .. DotsLeft - BSCount1
- else
- BSpeed1 = "___"
- end
- if DotsLeft > BSCount2 then
- BSpeed2 = "00" .. DotsLeft - BSCount2
- else
- BSpeed2 = "___"
- end
- if memory.readbyte(ElroyModeFlag) == 1 then
- ElroyColor = "red"
- else
- ElroyColor = "white"
- end
- gui.text(180, 100, "Cruise Elroy ", ColorTable[6], 0)
- gui.text(178, 108, " " .. string.sub(BSpeed1, -3) .. "/" .. string.sub(BSpeed2, -3), ElroyColor, 0)
- PSpeed =(memory.readbyte(CurrentPacManSpeed) + memory.readbyte(CurrentPacManSpeed+1)*256)/16 .. "/16"
- gui.text(180, 116, "PacMan Speed", ColorTable[6], 0)
- gui.text(184, 124, string.sub(" " .. PSpeed, -11), FrightColor, 0)
- BSpeed =(memory.readbyte(CurrentBlinkySpeed) + memory.readbyte(CurrentBlinkySpeed+1)*256)/16 .. "/16"
- gui.text(180, 132, "Blinky Speed", ColorTable[6], 0)
- gui.text(184, 140, string.sub(" " .. BSpeed, -11), ElroyColor, 0)
- OSpeed =(memory.readbyte(CurrentPinkySpeed) + memory.readbyte(CurrentPinkySpeed+1)*256)/16 .. "/16"
- gui.text(180, 148, "Pinky Speed", ColorTable[6], 0)
- gui.text(184, 156, string.sub(" " .. OSpeed, -11), white, 0)
- OSpeed =(memory.readbyte(CurrentInkySpeed) + memory.readbyte(CurrentInkySpeed+1)*256)/16 .. "/16"
- gui.text(180, 164, "Inky Speed", ColorTable[6], 0)
- gui.text(184, 172, string.sub(" " .. OSpeed, -11), white, 0)
- OSpeed =(memory.readbyte(CurrentClydeSpeed) + memory.readbyte(CurrentClydeSpeed+1)*256)/16 .. "/16"
- gui.text(180, 180, "Clyde Speed", ColorTable[6], 0)
- gui.text(184, 188, string.sub(" " .. OSpeed, -11), white, 0)
- end
- if
- memory.readbyte(0x20) ~= 0x00 and
- TargetPosition[1] ~= 0x00 then
- if
- memory.readbyte(GhostStatus + 6) ~= 0x00 and
- memory.readbyte(GhostStatus + 6) ~= 0x02 and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x1E and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x1F and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x2D and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x2F and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x32 and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x34 then
- if
- math.abs(memory.readbyte(PacManX) - memory.readbyte(GhostX + 12)) < 32 and
- math.abs(memory.readbyte(PacManY) - memory.readbyte(GhostY + 12)) < 32 and
- memory.readbyte(GhostMode) % 2 ~= 0x00 and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x20 and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x21 and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x22 and
- memory.readbyte(GhostPattern + 6 / 2) ~= 0x23 then
- gui.drawbox(memory.readbyte(PacManX) - 4 - 25, memory.readbyte(PacManY) + 12 - 25, memory.readbyte(PacManX) - 4 + 24, memory.readbyte(PacManY) + 12 + 24, 0, ColorTable[5])
- else
- gui.drawbox(memory.readbyte(PacManX) - 4 - 25, memory.readbyte(PacManY) + 12 - 25, memory.readbyte(PacManX) - 4 + 24, memory.readbyte(PacManY) + 12 + 24, 0, ColorTable[7])
- gui.drawbox(TargetPosition[7] - 7, TargetPosition[8] + 9, TargetPosition[7] - 2, TargetPosition[8] + 14, ColorTable[5])
- gui.drawline(TargetPosition[7] - 4, TargetPosition[8] + 12, memory.readbyte(GhostX + 12) - 4, memory.readbyte(GhostY + 12) + 12, ColorTable[5])
- end
- end
- for i=0, 4, 2 do
- if
- memory.readbyte(GhostStatus + i) ~= 0x00 and
- memory.readbyte(GhostStatus + i) ~= 0x02 and
- memory.readbyte(GhostPattern + i / 2) ~= 0x1E and
- memory.readbyte(GhostPattern + i / 2) ~= 0x1F and
- memory.readbyte(GhostPattern + i / 2) ~= 0x2D and
- memory.readbyte(GhostPattern + i / 2) ~= 0x2F and
- memory.readbyte(GhostPattern + i / 2) ~= 0x32 and
- memory.readbyte(GhostPattern + i / 2) ~= 0x34 then
- gui.drawbox(TargetPosition[i + 1] - 7, TargetPosition[i + 2] + 9, TargetPosition[i + 1] - 2, TargetPosition[i + 2] + 14, ColorTable[i / 2 + 2])
- gui.drawline(TargetPosition[i + 1] - 4, TargetPosition[i + 2] + 12, memory.readbyte(GhostX + i * 2) - 4, memory.readbyte(GhostY + i * 2) + 12, ColorTable[i / 2 + 2])
- end
- end
- end
- end
- if
- memory.readbyte(PauseCounter) % 2 == 1 and
- memory.readbyte(PlayingFlag) ~= 0xFF then
- gui.text(60, 120, " P A U S E ")
- end
- FCEU.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement