Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This LUA script is intended for TMNT: Tournament fighters for NES.
- -- ---------------------------------------------------------------------------
- -- This script tries to display the input data stored at the variables the game actually uses to determines the actions of the characters fighting. This includes the commands from AI or the CPU Player.
- -- The script displays keys as pressed from both tapping and holding. The difference in this matter might be implemented later.
- local key_a = 128;
- local key_b = 64;
- local key_select = 32;
- local key_start = 16;
- local key_up = 8;
- local key_down = 4;
- local key_left = 2;
- local key_right = 1;
- local p1tap = 0;
- local p2tap = 0;
- local p1hold = 0;
- local p2hold = 0;
- local function draw_a(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 65;
- else
- player = 235;
- end;
- gui.drawbox(player, 68, player + 5, 72, iswhite);
- end;
- local function draw_b(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 55;
- else
- player = 225;
- end;
- gui.drawbox(player, 68, player + 5, 72, iswhite);
- end;
- local function draw_select(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 35;
- else
- player = 215;
- end;
- gui.drawbox(player, 68, player + 5, 70, iswhite);
- end;
- local function draw_start(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 45;
- else
- player = 205;
- end;
- gui.drawbox(player, 68, player + 5, 70, iswhite);
- end;
- local function draw_down(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 20;
- else
- player = 190;
- end;
- gui.drawbox(player, 66, player + 3, 73, iswhite);
- end;
- local function draw_up(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 20;
- else
- player = 190;
- end;
- gui.drawbox(player, 53, player + 3, 60, iswhite);
- end;
- local function draw_left(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 10;
- else
- player = 180;
- end;
- gui.drawbox(player, 62, player + 7, 64, iswhite);
- end;
- local function draw_right(player_, iswhite)
- if iswhite then
- iswhite = "white";
- else
- iswhite = "black";
- end;
- if player_ == 1 then
- player = 25;
- else
- player = 195;
- end;
- gui.drawbox(player, 62, player + 7, 64, iswhite);
- end;
- while (true) do
- p1tap = memory.readbyte(0x008E);
- p2tap = memory.readbyte(0x008F);
- p1hold = memory.readbyte(0x0091);
- p2hold = memory.readbyte(0x0092);
- draw_a(1, ((AND(p1tap, key_a) ~= 0) or (AND(p1hold, key_a) ~= 0)));
- draw_b(1, ((AND(p1tap, key_b) ~= 0) or (AND(p1hold, key_b) ~= 0)));
- draw_select(1, ((AND(p1tap, key_select) ~= 0) or (AND(p1hold, key_select) ~= 0)));
- draw_start(1, ((AND(p1tap, key_start) ~= 0) or (AND(p1hold, key_start) ~= 0)));
- draw_up(1, ((AND(p1tap, key_up) ~= 0) or (AND(p1hold, key_up) ~= 0)));
- draw_down(1, ((AND(p1tap, key_down) ~= 0) or (AND(p1hold, key_down) ~= 0)));
- draw_left(1, ((AND(p1tap, key_left) ~= 0) or (AND(p1hold, key_left) ~= 0)));
- draw_right(1, ((AND(p1tap, key_right) ~= 0) or (AND(p1hold, key_right) ~= 0)));
- draw_a(2, ((AND(p2tap, key_a) ~= 0) or (AND(p2hold, key_a) ~= 0)));
- draw_b(2, ((AND(p2tap, key_b) ~= 0) or (AND(p2hold, key_b) ~= 0)));
- draw_select(2, ((AND(p2tap, key_select) ~= 0) or (AND(p2hold, key_select) ~= 0)));
- draw_start(2, ((AND(p2tap, key_start) ~= 0) or (AND(p2hold, key_start) ~= 0)));
- draw_up(2, ((AND(p2tap, key_up) ~= 0) or (AND(p2hold, key_up) ~= 0)));
- draw_down(2, ((AND(p2tap, key_down) ~= 0) or (AND(p2hold, key_down) ~= 0)));
- draw_left(2, ((AND(p2tap, key_left) ~= 0) or (AND(p2hold, key_left) ~= 0)));
- draw_right(2, ((AND(p2tap, key_right) ~= 0) or (AND(p2hold, key_right) ~= 0)));
- FCEU.frameadvance();
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement