Looking for someone way smarter than myself to add in a DAS meter for the Nintendo/BPS (Non-Tengen) Tetris. Either a hack or a game genie code would be appreciated, just looking for something to play on original hardware. There is a script below that will show a meter with FCEUX, but I'd rather not emulate.
This code wasn't written by me and taken from this youtube video:
Code:
local cnt = {};
for i=0,18 do
cnt[i] = 0;
end;
local prev;
local pieces;
while (true) do
local das = memory.readbyte(0x0046);
--delay is gravity and ARE counter
local delay = memory.readbyte(0x0045);
prev = pieces;
pieces = memory.readbyte(0x001A);
local test = memory.readbyte(0x0019);
if(pieces ~= prev) then
cnt[test] = cnt[test] + 1;
end;
gui.text(100,16,"Gravity/ARE: "..delay.."");
gui.text(100,8,"Next Piece: "..test.."");
gui.text(200,0,"Pieces: "..pieces.."");
for i=0,18 do
gui.text(220,(i+1)*8,i..": "..cnt[i].."");
end;
gui.drawbox(5, 0, 7+4*16, 5, "magenta");
for i=1,4 do
gui.drawbox(6, i, 6+4*das, i, "green");
end;
gui.drawbox(5+4*10, 1, 5+4*10, 4, "white");
local inp1 = joypad.read(1);
if(inp1.left) then
gui.text(5,8,"<L");
elseif(inp1.right) then
gui.text(5,8,"R>");
else
gui.text(5,8,"--");
end;
FCEU.frameadvance();
end;