Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
-- this outputs some information related to the map loading procedure when the screen scrolls, -- hopefully helpful for researching and recreating the scroll bug -- script by mugg ; with help from ais523, Sand local PRINT_INFO = false console.clear() memory.usememorydomain("System Bus") local cycles_at_frame_start = emu.totalexecutedcycles() local cycles_at_frame_end = emu.totalexecutedcycles() local print_after_this_frame = emu.framecount() + 1 local game_version = "-" local t = "" local t_frame_info = "" local frames_processed = 0 -- these have to happen in the same frame local requirement1 = false -- timer interrupt happens while ffea is 0x01 local requirement2 = false -- ffea gets set to 0x03 local bugframe_tbl = {} local double_timer_interrupt_tbl = {} local timer_interrupts_same_frame = 0 if gameinfo.getromhash() == "3A4DDB39B234A67FFB361EE7ABC3D23E0A8B1C89" then game_version = "1.0" elseif gameinfo.getromhash() == "418203621B887CAA090215D97E3F509B79AFFD3E" then game_version = "1.1" else print("This script will work only with GB Super Mario Land v1.0 or v1.1.") return end function text(x, y, text, color, backcolor) gui.pixelText(x, y, text, color, backcolor) end event.onframestart(function() cycles_at_frame_start = emu.totalexecutedcycles() if emu.framecount() > print_after_this_frame then local prefix = "" if frames_processed > 1 then prefix = "\n" end t_frame_info = prefix .. " FRAME " .. emu.framecount() + 1 end end) event.onframeend(function() if emu.framecount()-1 > print_after_this_frame then t_frame_info = t_frame_info .. " Cy:" .. emu.totalexecutedcycles() - cycles_at_frame_end end if emu.islagged() and emu.framecount()-1 > print_after_this_frame then t_frame_info = t_frame_info .. " **LAG**" end cycles_at_frame_end = emu.totalexecutedcycles() -- only print if the string isn't empty if PRINT_INFO then if #t_frame_info > 0 and #t > 0 then print(t_frame_info .. "\n" .. t) elseif #t_frame_info > 0 then print(t_frame_info) end end -- bugframe happened, save framecount and pixel pos if requirement1 and requirement2 then print("Bug frame!!!") local bugframe_info = {emu.framecount(), memory.read_u8(0xFFE9)*8} table.insert(bugframe_tbl, bugframe_info) end -- reset values requirement1 = false requirement2 = false t = "" t_frame_info = "" timer_interrupts_same_frame = 0 frames_processed = frames_processed + 1 end) tastudio.onbranchload(function() print_after_this_frame = emu.framecount() + 1 frames_processed = -1 console.clear() bugframe_tbl = {} double_timer_interrupt_tbl = {} end) event.onloadstate(function() print_after_this_frame = emu.framecount() + 1 frames_processed = -1 console.clear() bugframe_tbl = {} double_timer_interrupt_tbl = {} end) -- Write to $FFEA -- passed val is always 0, it seems, hinting that this hook is not fully implemented event.on_bus_write(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local raw_val = memory.read_u8(0xFFEA) local val = string.upper(string.format("%02x",raw_val)) local myname = "Write $FFEA (" .. val .. ")" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start if raw_val == 0x03 then requirement2 = true end end end, 0xFFEA) -- Write to $FFE9 event.on_bus_write(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local val = string.upper(string.format("%02x",memory.read_u8(0xFFE9))) local myname = "Write $FFE9 (" .. val .. ")" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0xFFE9) -- Exec $0040 event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $0040 (VBLANK INTERRUPT)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0x0040) -- Exec $0050 event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $0050 (TIMER INTERRUPT)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start local ffea = memory.read_u8(0xFFEA) if ffea == 0x01 then requirement1 = true end timer_interrupts_same_frame = timer_interrupts_same_frame + 1 if timer_interrupts_same_frame >= 2 then t = t .. "\nTwo Timer Interrupts!" table.insert(double_timer_interrupt_tbl, emu.framecount()+1) end end end, 0x0050) -- Exec $0060 --[[ event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $0060 (JOYPAD INTERRUPT)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0x0060) --]] -- game version dependent execs if game_version == "1.0" then event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $2258 (READ $FFEA)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0x224F) event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $2254 (READ $FFE9)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0x2254) elseif game_version == "1.1" then event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $2258 (READ $FFEA)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0x2258) event.on_bus_exec(function(addr, val, flags) if emu.framecount() > print_after_this_frame then local myname = "Execu $225D (READ $FFE9)" t = t .. "\n" .. string.format("%-32s", myname) .. " cycle: " .. emu.totalexecutedcycles() - cycles_at_frame_start end end, 0x225D) end while true do gui.clearGraphics() if #bugframe_tbl > 0 then for i=1, #bugframe_tbl, 1 do local bugframe_entry = bugframe_tbl[i] if bugframe_entry ~= nil then local bugframe_framecount = bugframe_entry[1] local bugframe_pixel = bugframe_entry[2] local current_pixel = memory.read_u8(0xFFE9) * 8 local display_pixel = (bugframe_pixel - current_pixel) - memory.read_u8(0xFF43)%8 + 216 text(10, 10 + i*8, "bug Frame " .. bugframe_framecount, 0xFF00FF00, 0x80000000) if display_pixel > 160 then text(136,10 + i*8, "--->", 0xFFFF0000, 0x80000000) else gui.drawLine(display_pixel, 17, display_pixel, 144, 0xFFFF0000) end if display_pixel < 0 then bugframe_tbl[i] = nil end end end end --[[ if #double_timer_interrupt_tbl > 0 then for j=1, #double_timer_interrupt_tbl, 1 do local frame = double_timer_interrupt_tbl[j] text(10, 80 + j*8, "two timer interrupts frame " .. frame, 0xFF00FF00, 0x80000000) end end --]] emu.frameadvance() end
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐⭐
Java | 3 sec ago | 0.17 KB
⭐⭐Exchange Exploit⭐ 6
JavaScript | 8 sec ago | 0.27 KB
⭐ ✅ Free SOLANA Method ✅ ⭐
JavaScript | 11 sec ago | 0.25 KB
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐⭐
Java | 14 sec ago | 0.17 KB
⭐ChangeNOW Exploit⭐⭐ 2
JavaScript | 18 sec ago | 0.27 KB
✅⭐ Make huge profits on trading ⭐
JavaScript | 24 sec ago | 0.25 KB
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐⭐
Java | 26 sec ago | 0.17 KB
⭐✅ MAKE $2500 IN 15 MIN 4
JavaScript | 30 sec ago | 0.27 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!