Posts for Amaraticando


1 2
14 15 16
26 27
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Link to video Audio has been fixed.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I converted the old Snes9x TAS (9:57.82) into lsnes format, because I wanted to make the comparison between the new runs and the old one. Probably, every SMW TAS can be converted manually (except ones with arbitrary code execution), but the process is annoying. Here's the file: http://tasvideos.org/userfiles/info/27380891235163881
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
dwangoAC wrote:
I was able to console verify this up until what appears to be the very last frame, at which point Mario's final throw appears to miss and instead Mario meets his demise between two of Bowser's mechanical minions.
Strange! Maybe the final frame was missed. Did the 'flying sound' appear a bit after the movie ends?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Warp wrote:
Pi is defined as the ratio between the circumference and the diameter of a circle. This ratio is constant, regardless of the diameter. Everybody kind of takes this for granted, just because they say it is. But this got me thinking how exactly could one prove that the ratio is constant? This doesn't seem to be trivial to prove. It doesn't even seem trivial to see intuitively.
In elementary geometry, the definition of length lacks rigor and is often taken as a primitive concept. However, in analysis we can define the length of curves. The circumference has an equation in the cartesian plan and it's not difficult to determine its size. http://math.stackexchange.com/questions/1049382/verify-the-circumference-of-the-circle-formula-for-a-circle-of-radius-r-using-th
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I'm glad to read all the positive reactions to our work. In the next days, I'll make a comparison video, probably including a lsnes version of some old runs. Amaurea style!
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I don't ever turn on the television. The only show that I watch is The Walking Dead, but through torrent :\ Previously watched series include: Breaking Bad, Dexter, Supernatural, 2 1/2 Men, The Big Bang Theory... I don't need to say that some of those went downfall and ended up in shame (I'm specially speaking to you 2 1/2 men). The press in my country is quite harmful, pretty much always over repeating dramatic tragedies and a bunch of them compromised with the government (to receive advertising budget from the state). Therefore, I don't watch them either.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Windows accepts \ and /, so / is better. And \ is an escape character, so another reason to use /.
Post subject: Re: Lsnes save state?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Dama1138 wrote:
noob question: how do I set a path for lsnes?
Under Configure > Settings > Advanced:
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
You're using GBA core, alright? I'm testing on it and the position of the text is indeed changing if I resize the window. This script shows the actual value changing.
Language: lua

while true do local height =client.screenheight() gui.text(10, 40, height) emu.frameadvance() end
However, the functions that use the native surface (all but gui.text) don't care about the screen size, but about the buffer size: client.bufferheight() and client.bufferwidth(). You should probably be aware of those two issues[1, 2], that were only fixed after the latest release.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Are you sure this code is inside the loop? I use something similar and it definitely is updated every frame (and can be updated even when the emulator is paused).
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
From lsnes IRC: (17:59:36) Amaraticando: Is it possible to plug/unplug controllers on the fly? (18:04:20) Ilari: Amaraticando: Nope. And considering the internal architecture, that would be hard without knowing what the controllers are beforehand. (18:04:35) Ilari: Amaraticando: What this kind of hot-plugging would be for? (18:05:13) Amaraticando: this guy said it can save time in the game he's playing http://tasvideos.org/forum/viewtopic.php?t=17381 (18:07:09) Ilari: Well, that kind of thing wouldn't be major architecture hacking to support at least...
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I don't think it's possible. Does it somehow affect gameplay?
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
lsnes: Load the ROM. Click on File > New > Movie Fill in the form: In general, you don't need to click on the 1st five options. Save prefix is handy, because you don't mix the states of this movie with others, even if you use the same slot. To use many controllers, without a bunch of hotkeys, use Tool > Edit Movie or my Lua script.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Yes. And I guess it would fail if controllers 1 an 3 are connected, but 2 isn't. I'll test and improve.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
To see:
Language: lua

value = 0x96 -- 10010110 for bitnum = 0, 7 do if bit.check(value, bitnum) then some_action() end end
To set: uint32 bit.set(uint num, int pos) Sets the bit 'pos' in 'num' Edit: typo
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Pokota wrote:
E: So, the upshot is now I'm going to be requesting a new joypad function: joypad.countPlayers(). Should just return the number of controllers the core will accept inputs for at that time - example, if in N64 mode you have it set up for three controllers, joypad.countPlayers() should return 3.
You can do it yourself:
Language: lua

function joypad.countPlayers() -- returns the highest argument joypad.get(arg) can have / or nil if arg == 1 returns nil or an empty table local next = next local MAX = 100 for count = 1, MAX do local joyget = joypad.get(count) if (joyget == nil or next(joyget) == nil) then if count == 1 then return nil else return count - 1 end end count = count + 1 if count == MAX then error"joypad.countPlayers: something went wrong" end -- sanity check end end
EDIT: it doesn't count possible unconnected controllers.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Yet another client.SetGameExtraPadding problem: "Sets the extra padding added to the 'emu' surface so that you can draw HUD elements in predictable placements." But you can't really draw anything beyond the default game dimensions (right and bottom), the drawings just change the origin. This screenshot shows it. Script to get this effect:
Language: lua

client.SetGameExtraPadding(32, 32, 64, 32) event.onexit(function() client.SetGameExtraPadding(0, 0, 0, 0) end) while true do -- default SNES NTSC emu space: 256x224 gui.drawRectangle(0, 0, 600, 500, 0xffff0000, 0xa00000ff) gui.drawText(256, 224, "TEST") emu.frameadvance() end
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
It would be kinda funny if his name changed to Wanda.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Electrons repel each other. So, to bring an electron 1 cm to another takes work, because of this repulsive force that follows Coulomb's inverse-square law. The more electrons you have in the bunch, the stronger the force. With 10^52 electrons, in a sphere with radius of 1700 km, those electrons would be really close to their neighbors; and remember that there're no protons to overcome the electric repulsion. Therefore, the total work to bring together all those charges is really huge, so huge that its mass-energy is about the same of the observable universe. A sphere of pure protons would have the same mass (slightly more, because they are naturally heavier). That's why there can be neutron stars, but no electron/proton stars.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
The potential energy of a moon made only of electrons is the potential energy necessary to move every electron from infinite to their position. As this is a huge system and we don't really know the best arrangement to place those electrons (in order to know every pair of distance between them), then we must make an approximation. Consider it a homogeneous sphere of radius R and charge e*10^52. The total energy, at least in order of magnitude, is similar to the gravitational binding energy(but gravitation is attractive), changing the fundamental constants (G to K_e) and mass to charge. So: U = 3*K*(e*10^52)²/(5*R) U = 3*8.98755e9*(1.6e-19*1e52)²/(5*1.737e6) U =~ 7,9475e69 J Converting to mass, using E = mc²: m = U/c² =~ 8.83e52 Kg The mass of the observable universe is around 1e53 Kg.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
In lsnes, I use 20 savestates: F1 to F10 and 1 to 0 F10: the earliest point in the movie that is useful to me. 0: the earliest point in the movie near the part I'm TASing. 6-9: interesting end points. F1-F9, 1-5: regular savestates. I don't imagine myself with only 10 slots. EDIT: I usually take named savestates at the beginning of each level.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
This is absolute beta, because I never investigated this game. A bunch of situations are not accounted or wrong, and you'll see. The width and height are arbitrary.
Language: lua

local abe_semi_width, abe_semi_height = 8, 24 while true do local abe_x = mainmemory.read_u16_le(0x1f6112) local abe_y = mainmemory.read_u16_le(0x1f6116) local camera_x = mainmemory.read_u16_le(0x08abe6) local camera_y = mainmemory.read_u16_le(0x08abea) local x_offset = 203 + abe_x - camera_x local y_offset = 124 + abe_y - camera_y gui.text(0, 64, string.format("Abe (%d, %d)", abe_x, abe_y), "black", "yellow") gui.text(0, 80, string.format("Cam (%d %d)", abe_x - camera_x, abe_y - camera_y), "black", "yellow") gui.drawRectangle(x_offset - abe_semi_width, y_offset - 2*abe_semi_height, 2*abe_semi_width, 2*abe_semi_height, "blue") gui.drawPixel(x_offset, y_offset) emu.frameadvance() end
Further development would be better in the Oddysee thread.
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Tell me the main RAM addresses, I can try. If you wanna do the same for enemies, the problem is: PSXHawk doesn't have a trace logger yet, so the script should be made experimentally. I've done that before, but it's not so trivial. For instance, you may draw Abe with a small hitbox but enemies with bigger ones. Or the reverse... Some games have different hitboxes (vs sprites, vs solid objects, etc), so this is another complication.
Post subject: Re: generic PRNG lua script
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Pokota wrote:
Right now, I'm curious to find out why it sends multiple button presses - it's currently sending two buttons with each update. My current guess is because the key state table (keysArray) isn't actually getting reset between calls.
The code makes it clear that only one key is set per update. I've tested it too. My guess is that you registered core twice. Check the registered functions (F12 in the Lua Console) and see. The best way to avoid it is:
Language: lua

event.unregisterbyname("some-fancy-name-onframestart") -- deletes the first registered function with this name event.onframestart(core, "some-fancy-name-onframestart") -- registers core, on frame start, with this name
Amaraticando
It/Its
Editor, Experienced Forum User, Published Author, Player (158)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I cannot answer much for SMB, but it should be similar to SMW. getTile(dx, dy) gets the 16x16 square-tile around Mario. The tiles are stored in the memory according to the x, y positions, according to some rule. The offset should start at WRAM $0500 and go on, according to some rule, mapping all the level. NES games have really small WRAM space, so it should store only nearby tiles (not the entire level, like in SMW).
Language: lua

local x = marioX + dx + 8 --> gets the relevant X, that is around Mario local y = marioY + dy - 16 --> relevant Y local page = math.floor(x/256)%2 --> x//256 is the screen number, so page is the screen parity local subx = math.floor((x%256)/16) --> horizontal tile (each 16 pixels) local suby = math.floor((y - 32)/16) --> vertical tile (each 16 pixels) local addr = 0x500 + page*13*16+suby*16+subx --> bijection between the pair (subx, suby) and the address it is stored, with offset $0500 if suby >= 13 or suby < 0 then --> ignore tiles far away return 0 end if memory.readbyte(addr) ~= 0 then --> the memory is non-zero iff there's a tile there. It treats all different tiles equally. return 1 else return 0 end
Edit: typos / HTML code screwing.
1 2
14 15 16
26 27