diff options
| author | Vi Grey <vi@vigrey.com> | 2023-09-24 18:52:21 +0000 |
|---|---|---|
| committer | Vi Grey <vi@vigrey.com> | 2023-09-24 18:52:21 +0000 |
| commit | b65c44c4a8e86a4af2f2d96c26a1fe16753637ba (patch) | |
| tree | f427f535439dceb453a9ca1f0837fb8e8171d4c4 /tools/lua | |
| parent | 78d50d4227d1414bcb27317f328fbdc029bfa092 (diff) | |
| download | tasd-b65c44c4a8e86a4af2f2d96c26a1fe16753637ba.tar.gz tasd-b65c44c4a8e86a4af2f2d96c26a1fe16753637ba.zip | |
Add 2 new packets. Remove 2 packets.
Changed
- Specify INPUT_CHUNK offset for Index Value of TRANSITION packet
Fixed
- EXPERIMENTAL packet drawing error and packet value length
Added
- PORT_LATCH_FILTER
- Port value to TRANSITION packet
Removed
- SNES_LATCH_FILTER and NES_LATCH_FILTER
Diffstat (limited to 'tools/lua')
| -rw-r--r-- | tools/lua/tasd-fceux-dumpscript.lua | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/lua/tasd-fceux-dumpscript.lua b/tools/lua/tasd-fceux-dumpscript.lua index 27f9c71..e5d968d 100644 --- a/tools/lua/tasd-fceux-dumpscript.lua +++ b/tools/lua/tasd-fceux-dumpscript.lua @@ -38,10 +38,10 @@ local RERECORDS = 0x000e -- Done local MEMORY_INIT = 0x0012 -- Done local GAME_IDENTIFIER = 0x0013 -- Done local PORT_CONTROLLER = 0x00f0 -- Done (More to handle later) +local PORT_OVERREAD = 0x00f1 -- Done local NES_LATCH_FILTER = 0x0101 -- Done local NES_CLOCK_FILTER = 0x0102 -- Done -local NES_OVERREAD = 0x0103 -- Done local INPUT_CHUNK = 0xfe01 -- Done (More to handle later) local TRANSITION = 0xfe03 -- Done @@ -60,6 +60,7 @@ local cpuCyclesLastFrame = 0 local region = "" local tasdFile +local lastController local nesControls = {"right", "left", "down", "up", "start", "select", "B", "A"} @@ -172,6 +173,17 @@ function getPortControllerPacket(playerCount, controllerType) return finishedPackets end +function getPortOverreadPacket(playerCount, controllerType) + local finishedPackets = "" + for x = 1, playerCount, 1 do + local packetPayload = intToBytes(x, 1) + packetPayload = packetPayload .. intToBytes(0x00, 1) + finishedPackets = finishedPackets .. makePacket(PORT_OVERREAD, packetPayload) + end + return finishedPackets +end + + function getNESLatchFilterPacket() local packetPayload = intToBytes(8000, 2) return makePacket(NES_LATCH_FILTER, packetPayload) @@ -182,11 +194,6 @@ function getNESClockFilterPacket() return makePacket(NES_CLOCK_FILTER, packetPayload) end -function getNESOverreadPacket() - local packetPayload = intToBytes(0, 1) - return makePacket(NES_OVERREAD, packetPayload) -end - function getInputChunkPacket(player, inputs, controllerType) local payloadLen = 1 if (controllerType == NES_STANDARD_CONTROLLER) then @@ -205,6 +212,7 @@ end function getTransitionPacket() local packetPayload = intToBytes(0x01, 1) + packetPayload = packetPayload .. intToBytes(0x00, 1) packetPayload = packetPayload .. intToBytes(movie.framecount(), 8) packetPayload = packetPayload .. intToBytes(0x01, 1) return makePacket(TRANSITION, packetPayload) @@ -237,9 +245,9 @@ function startDump() tasdFile:write(getTotalFramesPacket()) tasdFile:write(getRerecordsPacket()) tasdFile:write(getPortControllerPacket(2, NES_STANDARD_CONTROLLER)) + tasdFile:write(getPortOverreadPacket(2)) tasdFile:write(getNESLatchFilterPacket()) tasdFile:write(getNESClockFilterPacket()) - tasdFile:write(getNESOverreadPacket()) -- Rest CPU cycle count to 0 debugger.resetcyclescount() movie.playbeginning() |
