zisazsnes uses Microsoft ActiveScript technology to connect this compiled application with script like JScript.
zisazsnes supports only emulated 65816 CPU for debugging.
zisazsnes calls scripts when:
Hit a Breakpoint. |
The scripts call zisazsnes back when:
Send a message to zisazsnes LOG CONSOLE box. | |
Add/remove a Breakpoint. | |
Read memory/CPU register thru zsnes emulator. | |
Capture continuous memory to a new file. | |
Formalize a text. | |
Do enable/disable: SingleStep, PostProcess |
I recommend JScript (not VBS) to script this. VBS sometimes treats unsigned integer as signed integer.
Next sample is written in JScript.
external.Message("test test", "test", 1); external.Message(external.CasetteName, "test", 1) |
The sample sends 2 messages.
1st message sends literal text "test test".
2nd message sends rom cartridge name.
You can access zisazsnes thru "external" object. In this case, script acquired the cartridge name.
function OnCodeBreak(addr);
zisazsnes call the script before execution of emulated code, when one
of following condition satisfies.
|
Argument Name | Meaning |
---|---|
address |
An execution address zsnes is wiilling to execute. |
function OnCodeBreakPostProcess(priorAddr, currentAddr);
zisazsnes call the script after execution of emulated code, when all
of following condition satisfies.
|
Argument Name | Meaning |
---|---|
priorAddr |
Eve address zsnes executed previously. |
currentAddr |
An execution address zsnes is wiilling to execute. |
function external.Message(message, source, severity);
Send a text message to LOG CONSOLE. |
Argument Name | Meaning | ||||||||
---|---|---|---|---|---|---|---|---|---|
message |
A literal text to display. | ||||||||
source |
Source of message sender. This is a kind of FYI. zisazsnes is not interested in the name of sender. | ||||||||
severity |
Severity value of message:
|
function external.AddCodeBreak(address);
Add a Breakpoint. | |
Each Breakpoint has reference count. zisazsnes increases reference count if you set a Breakpoint for already added address. | |
The Breakpoint and its reference count are shared with all running scripto. | |
The address is execution address. OnCodeBreak and OnCodeBreakPostProcess is called if hits Breakpoint. | |
Current implement supports up to 10 Breakpoints. |
Argument Name | Meaning |
---|---|
address |
An address to new Breakpoint. Give 0x018000 for address 01/8000 . |
function external.RemoveCodeBreak(address);
Decrase the reference count of corresponding Breakpoint. | |
Remove the Breakpoint if reference count is to be 0. |
Argument Name | Meaning |
---|---|
address |
An address for Breakpoint to be removed. |
function external.ReadMem8(address);
Read a byte from memory, and return a byte value. | |
You can read ROM/RAM address. | |
The implementation fully depends on zsnes code. |
Argument Name | Meaning |
---|---|
address |
An address to be read. |
function external.ReadMem16(address);
Read a word value from memory, and return a signed 16-bits value. | |
You can read ROM/RAM address. | |
The implementation fully depends on zsnes code. |
Argument Name | Meaning |
---|---|
address |
An address to be read. |
function external.ReadMem32(address);
Read a double word value from memory, and return a signed 32-bits value. | |
You can read ROM/RAM address. | |
The implementation fully depends on zsnes code. |
Argument Name | Meaning |
---|---|
address |
An address to be read. |
function external.CaptureMemoryToFile(addrFrom, addrTo, newFileName);
Read continuous memory space. | |
You can read ROM/RAM address. | |
The implementation fully depends on zsnes code. |
Argument Name | Meaning |
---|---|
addrFrom |
An address to start reading. |
addrTo |
An address to finish reading. The capture contains last byte of addrTo
address. |
newFileName |
A filename to be written captured raw data. |
function external.sprintf(format, arrayObject)
The behavior is like sprintf found on C/C++ language. But current implementation doesn't fully support its format specification. See also: http://www.opengroup.org/onlinepubs/007908799/xsh/fprintf.html |
external.sprintf("%u + %u = %u", new Array(11, 22, 33)) |
this sample returns "11 + 22 = 33".
Argument Name | Meaning | ||||
---|---|---|---|---|---|
format |
The format text. | ||||
arrayObject |
Supports:
|
function external.EnableSingleStep()
Enable SingleStep feature. | |
Increase the reference count. | |
Call OnCodeBreak method on each single step in emulator. |
No argument required.
function external.DisableSingleStep()
Disable SingleStep feature if reference count decrased to zero. | |
Decrase the reference count. |
No argument required.
function external.EnablePostProcess()
Enable PostProcess feature. | |
Call OnCodeBreakPostProcess method on next execution after previous Breakpoint passes. | |
Increase the reference count. |
No argument required.
function external.DisablePostProcess()
Disable PostProcess feature if reference count decrased to 0. | |
Decrease the reference count. |
No argument required.
function external.xa()
Returns A register (16-bits). |
function external.xdb()
Returns DataBank register (8-bits). |
function external.xpb()
Returns ProgramBank register (8-bits). |
function external.xs()
Returns Stack register (16-bits). |
function external.xd()
Returns Direct register (16-bits). |
function external.xx()
Returns X register (16-bits). |
function external.xy()
Returns Y register (16-bits). |
function external.CasetteName()
Returns casette name described in rom file. |
function external.PrevAddr()
Returns an address on previous execution. |