Posts for creaothceann


creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
thatguy wrote:
The rules are stacked so far in the casinos' favour
Of course. It's a business; you pay to be entertained by the illusion of having a chance. Just like you go to a magician's show for the illusion that magic exists.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
the person reading has to "know" that last is implicit
Yes. If you use a script/programming language you have to know it.
Pokota wrote:
implied return last doesn't happen unless the last line of a script is a clip
Doesn't even have to be a clip.
Language: avisynth

BlankClip(1, color=Test) function Test {$524361}
Functions don't even have to return anything.
Language: avisynth

global s = "1" Test BlankClip(1).SubTitle(s) function Test {global s = "2"}
Aktan wrote:
poking fun at creaothceann
:˙(
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Yeah, all of that works. But it's highly redundant - you already set last with a single line of "AVISynth(...)". "return last" looks like "i = i + 1;" to a C programmer.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
When writing functions that take a clip as their first parameter, I (almost) always put the clip variable on its own line to make it the "current" clip. So yes, it does work.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
if you start doing something like last = clip
last doesn't need to be set anyway...
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
feos wrote:
Does the motion with that last method look blurred too? I mean, while the screen and the objects are moving, is it obvious that the whole thing is filtered, or it mostly resembles the clean footage? I think none of the methods used allows to only filter the mesh itself. Probably that might be hacked into the emulator core itself. Until then, I wouldn't object against mesh too much, but I want to give the filter a chance as well.
There is no motion blur because it works spatially (in 2D), not temporally. The problem is that games with very small text will have that blurred. Example: Castlevania
Language: AviSynth

Open("castlevaniasotn-tas-maria-arandomgametaser.mkv") sh1 = StackHorizontal(Method_0.RightBorder, Method_1.RightBorder, Method_2).BottomBorder sh2 = StackHorizontal(Method_3.RightBorder, Method_4.RightBorder, Method_5) StackVertical(sh1, sh2) FullScreen(1920, 1080) # enter your screen size; intended for viewing with MPC-HC (or other players) in fullscreen function Method_0(clip c) {c .PointResize(c.Width * 2, c.Height * 2).Subtitle("original (no change)" , text_color=$FFFFFF)} function Method_1(clip c) {c.Layer(c, level=128, x=1) .PointResize(c.Width * 2, c.Height * 2).Subtitle("method 1 (add left neighbor pixel at 4/8 intensity)" , text_color=$FFFFFF)} function Method_2(clip c) {c.Layer(c, op="lighten", level=160, x=1) .PointResize(c.Width * 2, c.Height * 2).Subtitle("method 2 (lighten with left neighbor pixel at 5/8 intensity)" , text_color=$FFFFFF)} function Method_3(clip c) {c.Layer(c, op="lighten", level= 64, x=1).Layer(c, op="lighten", level= 64, x=-1).PointResize(c.Width * 2, c.Height * 2).Subtitle("method 3 (lighten with left and right pixels at 2/8 intensity)", text_color=$FFFFFF)} function Method_4(clip c) {c.Layer(c, op="lighten", level= 96, x=1).Layer(c, op="lighten", level= 96, x=-1).PointResize(c.Width * 2, c.Height * 2).Subtitle("method 4 (lighten with left and right pixels at 3/8 intensity)", text_color=$FFFFFF)} function Method_5(clip c) {c.Layer(c, op="lighten", level=128, x=1).Layer(c, op="lighten", level=128, x=-1).PointResize(c.Width * 2, c.Height * 2).Subtitle("method 5 (lighten with left and right pixels at 4/8 intensity)", text_color=$FFFFFF)} function FullScreen(clip c, int Screen_Width, int Screen_Height) { c x = (Screen_Width - Width ) / 2 y = (Screen_Height - Height) / 2 AddBorders(x, y, x, y) } function Open(string f) { v = DSS2(f, pixel_type="RGB32") a = DirectShowSource(f, video=false) AudioDub(v, a) } function BottomBorder(clip c) {c.Crop(0, 0, 0, -1).AddBorders(0, 0, 0, 1, color=$FFFFFF)} function RightBorder(clip c) {c.Crop(0, 0, -1, 0).AddBorders(0, 0, 1, 0, color=$FFFFFF)} function Show(clip a, clip b, string "text_a", string "text_b") { text_a = default(text_a, "") text_b = default(text_b, "") a = a.ConvertToRGB32 b = b.ConvertToRGB32 c = Subtract(a, b) x = a.Width / 2 y = a.Height / 2 a1 = a.Crop(0, 0, 0, -y).Crop(1, 1, -1, -1).AddBorders(1, 1, +1, +1, $FF0000).Subtitle(text_a, text_color=$FFFFFF) a2 = a.Crop(0, +y, 0, 0).Crop(1, 1, -1, -1).AddBorders(1, 1, +1, +1, $0000FF) b1 = b.Crop(0, 0, 0, -y).Crop(1, 1, -1, -1).AddBorders(1, 1, +1, +1, $FF0000).Subtitle(text_b, text_color=$FFFFFF) b2 = b.Crop(0, +y, 0, 0).Crop(1, 1, -1, -1).AddBorders(1, 1, +1, +1, $0000FF) c1 = c.Crop(0, 0, 0, -y).Crop(1, 1, -1, -1).AddBorders(1, 1, +1, +1, $FF0000).Subtitle("top" , text_color=$FFFFFF, halo_color=$FF0000) c2 = c.Crop(0, +y, 0, 0).Crop(1, 1, -1, -1).AddBorders(1, 1, +1, +1, $0000FF).Subtitle("bottom", text_color=$FFFFFF, halo_color=$0000FF) a = StackVertical (a1, a2) b = StackVertical (b1, b2) c = StackHorizontal(c1, c2) StackVertical(StackHorizontal(a, b), c) }
Result (view in fullscreen / download and view with fullscreen viewers like IrfanView)
  • [Picture 01] Method_1 completely removes the mesh but blurs the small text (e.g. the "START" button).
  • [Picture 02] The "lighten" methods preserve the text, but cannot remove the mesh completely. (They also make the picture a little bit brighter.)
  • [Picture 04] As you can see the algorithm works purely horizontally.
  • [Picture 05] Removing static meshes is the most important job of such a filter. As said above the "lighten" filters fail here.
For games where the meshes are only used for small, fast-moving objects (like Maria in the examples) I wouldn't apply a filter. I suspect that what we'd need is a "bloom" filter which makes only the bright pixels bleed into the dark pixels.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Well, of course it is a bit blurry. Perfect detection of the pattern seems to be impossible.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
The second frame was a good compromise between "remove the mesh / vertical lines" and blurriness. Anyway, check out this code:
Language: AviSynth

ImageSource("00.png", 0, 0).ConvertToRGB32.Crop(5, 0, -5, 0) f0 = Method_1.Zoom.Subtitle("bilinear resize to 2/3" , text_color=$FFFFFF) f1 = Method_2.Zoom.Subtitle("bilinear resize to 3/4" , text_color=$FFFFFF) f2 = Method_3.Zoom.Subtitle("add left neighbor pixel at 50% intensity", text_color=$FFFFFF) f3 = last .Zoom.Subtitle("original" , text_color=$FFFFFF) Interleave(f0, f1, f2, f3) function Method_1(clip c) {c.BilinearResize(int(1.0 * c.Width * 2/3), c.Height).BilinearResize(c.Width, c.Height)} function Method_2(clip c) {c.BilinearResize(int(1.0 * c.Width * 3/4), c.Height).BilinearResize(c.Width, c.Height)} function Method_3(clip c) {c.Layer(c, level=128, x=1)} function Zoom (clip c) {c.PointResize(c.Width * 3, c.Height * 3)}
Personally I think method 3 is close to perfect. (It even reduces jaggies a bit.) Note that it requires RGB32.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
fsvgm777 wrote:
creaothceann wrote:
Language: AviSynth

ImageSource("00.png", 0, 0) Crop(5, 0, -5, 0) f0 = BilinearResize(int(1.0 * Width * 1/2), Height).BilinearResize(Width, Height) f1 = BilinearResize(int(1.0 * Width * 2/3), Height).BilinearResize(Width, Height) f2 = BilinearResize(int(1.0 * Width * 3/4), Height).BilinearResize(Width, Height) f3 = last Interleave(f0, f1, f2, f3)
I'm....not sure if I like the end result (especially since it quadruples the amount of frames).
You're supposed to choose only one of these methods... the Interleave call is just to compare these frames in AvsPmod / VirtualDub.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
It seems that mdapt or gdapt would be an alternative (depending on the game); unfortunately they're RetroArch shaders. https://www.reddit.com/r/emulation/comments/34jg1z/after_some_intense_debate_exodus_considered_the/cqvjk97/ http://www.sega-16.com/forum/showthread.php?32262
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Language: avisynth

ImageSource("00.png", 0, 0) Crop(5, 0, -5, 0) f0 = BilinearResize(int(1.0 * Width * 1/2), Height).BilinearResize(Width, Height) f1 = BilinearResize(int(1.0 * Width * 2/3), Height).BilinearResize(Width, Height) f2 = BilinearResize(int(1.0 * Width * 3/4), Height).BilinearResize(Width, Height) f3 = last Interleave(f0, f1, f2, f3)
I prefer frame 1.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
ZTE Axon 7
User Agent: Mozilla/5.0 (Android 6.0.1; Mobile; rv:54.0) Gecko/54.0 Firefox/54.0
Vector	Block	Result	Duration
12	3	correct	173.33ms
13	3	correct	317.86ms
14	3	correct	511.37ms
15	3	correct	1001.65ms
16	3	correct	1962.18ms
12	4	correct	238.03ms
13	4	correct	488.05ms
14	4	correct	968.05ms
15	4	correct	1937.04ms
16	4	correct	3958.24ms
12	5	correct	495.45ms
13	5	correct	986.75ms
14	5	correct	1971.68ms
15	5	correct	3887.93ms
16	5	failed	2.52ms
Status: Done.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
It's always better to give the user at least a choice.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
jlun2 wrote:
Most of the run looks "similar" to the previous versions as well. I know it's technically redone, but after watching the 5th or so versions they all start appearing "similar".
I dunno, after watching some Super Metroid runs I can see more differences.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warp wrote:
The stock web browser in my Samsung Galaxy Express 2 (which I have absolutely no idea which browser it is
Not even at useragentstring.com?
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
bun wrote:
Setting the playback speed to 2x does wonders on that one. (for the music too!)
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Here's the test that failed before:
creaothceann wrote:
my SurfTab wintron 10.1 tablet, no power brick plugged in
User Agent: Mozilla/5.0 (Windows NT 6.3; rv:54.0) Gecko/20100101 Firefox/54.0
Vector	Block	Result	Duration
12	3	correct	286.08ms
13	3	correct	537.55ms
14	3	correct	951.20ms
15	3	correct	2018.20ms
16	3	correct	3896.43ms
12	4	correct	561.35ms
13	4	correct	993.18ms
14	4	correct	2018.90ms
15	4	correct	4018.05ms
16	4	correct	7945.24ms
12	5	correct	1014.86ms
13	5	correct	2079.39ms
14	5	correct	4195.41ms
15	5	correct	8087.49ms
16	5	correct	16467.56ms
Status: Done.
It seems that the times improve slightly when the test is repeated a few times.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
p4wn3r wrote:
So, in principle, if you receive a letter claiming infringement, you can always reply with another one saying that you're sorry they think their rights are being violated, but that you are not doing anything wrong for whatever reason, and state that you will "troll them back" in court if they move forward. Even simple cases take years to be decided in court, and are very expensive for the people stating the claim, so I really don't see any copyright holder pushing forward unless you are hurting their sales by a significant margin.
relevant link
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warepire wrote:
Intel i7 4790k:
...
Ran while the PC was under otherwise normal (for me) workload.
Was the CPU running at only 3.3GHz? My results are pretty much 1/3 faster.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
There's lots of videos: https://www.youtube.com/watch?v=NLEMsw1SjDY https://www.youtube.com/watch?v=Ulcq0pVlQ1c https://www.youtube.com/watch?v=qvpwf50a48E https://www.youtube.com/watch?v=fr-t9plOkHY You can check Wikipedia, it pretty much always has a list of components that you can then google. Also check out [MOD EDIT: Removed link to site with commercial ROMs -Mothrayas], 6502 and RHDN's docs.
Post subject: Re: What skills and knowledge are needed to code an emulator?
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
ClearSky wrote:
I've been wondering about this. What skills and knowledge does one need to learn to be able to code an emulator, or at least understand what is going on in the source code?
Divide the problem into sub-problems until the problems become trivial; then put the solutions together. This means that if you want to create your own emulator, after learning about the console you must start at the bottom (the CPU) and work your way up. Don't start at the GUI and "work your way down". Anyway, here's a short introduction:
  1. An emulator recreates a video game console. It does that by simulating the functions of the hardware components. (Video game consoles are just computers - though not IBM compatible - they have microprocessors (CPU) and memory chips (ROM, RAM) and digital signal processors (DSP) and digital-to-analog converters (DAC) just like a PC.)
  2. It turns out that the CPU is the most important piece, and about the most important thing it can do is adding two numbers. → These two numbers are stored in registers; find out what registers exactly are available on your console's CPU. → Oops, first you need to know what CPU you're dealing with. → Looks like a CPU can only add numbers of a certain length, like 8, 16, 32 or 64 bits. (This is so important that we've named entire video game console generations after them.) → Note that they can also detect if the result overflows the allowed number of bits.
  3. CPUs can also subtract numbers; they just make one of them negative and add them together.
  4. CPUs can also compare numbers; they just subtract them and look if the result was zero. (There's more stuff you can do with the result, like finding out which number was larger.)
  5. Adding or subtracting only the same two numbers all the time is boring, so there's a whole infrastructure for feeding new values to the CPU. On the CPU there's usually one physical pin per bit, and the voltage level on that pin determines if it's 0 or 1. (Note that this may be inverted.) This set of pins is the data bus.
  6. Theoretically the data bus could be connected to anything, but in practice each data bus line is connected to a memory chip that provides the numbers to the CPU. This chip also needs a number to select one of its memory cells, so there's a second set of lines (the address bus) going into the memory chip. → The number of lines in the address bus roughly determines how much memory can be used by the system. It can (and often is) different from the data bus width.
  7. You might think that with all these pins you could directly select a cell in the memory chip and directly instruct the CPU what to do with the number going into (or out of) the CPU; turns out that it's much faster to also give the CPU address bus pins, connect the memory chip's address bus to these pins, and store instructions for the CPU in the memory chip alongside the data. → The instructions are called opcodes, and the CPU has a special register called program counter (PC) to keep track of its position in the instruction stream.
  8. The opcodes (which are themselves just numbers, most often 1 byte in size) plus their operands form the machine language of the CPU. Writings programs in this machine language is extremely tedious (basically it would amount to putting a sequence of hex numbers into memory), but this is in fact what is involved in creating an ACE TAS. → The human-readable translation of machine language is assembly code (ASM), and this is what people used to write their games in. (At least until about the 32-bit era.) → When you look at a game's ROM file in a hex editor, you see its machine language code. It can be automatically translated ("disassembled") back to ASM, but the original identifiers are lost and making sense of the code takes lots of time.
  9. You'll see that the game code seems to read from and write to special addresses. The truth is that there are often much more addresses available to the CPU than how much memory is installed in the system. In fact the address bus and the data bus are not only connected to "the memory chip" mentioned above, but also to other devices like RAM chips, video chips, audio chips, or even the controller port connectors. → These extra addresses are listed in video game console-specific memory maps. → What numbers can be sent to or received from these addresses, and when, is discussed in the programming manual for a particular video game console, written by the manufacturer (or by hackers).
  10. Emulating a game means creating variables to record the state of every component in the system, and then looking at the game's instruction stream and changing those variables accordingly. The GUI sets the variables that record the state of the input devices, and reads out the variables that record the state of the video/audio output.
ClearSky wrote:
Do you need to be a computer scientist or a software engineer to be able to do that?
No. If you can write programs and if you can understand the programming manuals for your chosen console then you can in theory also write an emulator.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Phenom II X2 560 @ 3.3 GHz
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0
Vector	Block	Result	Duration
12	3	correct	94.25ms
13	3	correct	187.43ms
14	3	correct	381.03ms
15	3	correct	743.80ms
16	3	correct	1469.24ms
12	4	correct	193.68ms
13	4	correct	388.32ms
14	4	correct	792.52ms
15	4	correct	1559.55ms
16	4	correct	3111.33ms
12	5	correct	399.16ms
13	5	correct	801.82ms
14	5	correct	1604.32ms
15	5	correct	3186.30ms
16	5	correct	6421.88ms
Status: Done.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
This is on my SurfTab wintron 10.1 tablet, no power brick plugged in. FF didn't load the first link, so here's the second one:
User Agent: Mozilla/5.0 (Windows NT 6.3; rv:54.0) Gecko/20100101 Firefox/54.0
Vector	Block	Result	Duration
12	3	correct	283.77ms
13	3	correct	541.44ms
14	3	correct	1092.31ms
15	3	correct	2210.41ms
16	3	correct	4419.20ms
12	4	correct	572.77ms
13	4	correct	1119.78ms
14	4	correct	2280.78ms
15	4	correct	4526.51ms
16	4	failed	16.05ms
12	5	correct	1140.46ms
13	5	correct	2283.08ms
14	5	failed	17.65ms
15	5	failed	17.37ms
16	5	failed	1.01ms
Status: Done.
Chrome:
User Agent: Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Vector	Block	Result	Duration
12	3	correct	1433.14ms
13	3	correct	1260.47ms
14	3	correct	1667.26ms
15	3	correct	2922.70ms
16	3	correct	5715.48ms
12	4	correct	863.87ms
13	4	correct	1606.48ms
14	4	correct	3309.75ms
15	4	correct	6333.34ms
16	4	correct	12676.37ms
12	5	correct	1641.08ms
13	5	correct	3232.21ms
14	5	correct	6495.37ms
15	5	correct	13148.12ms
16	5	correct	24273.51ms
Status: Done.
This is from a Samsung Galaxy J3 2016:
User Agent: Mozilla/5.0 (Android 5.1.1; Mobile; rv:54.0) Gecko/54.0 Firefox/54.0
Vector	Block	Result	Duration
12	3	correct	384.34ms
13	3	correct	749.88ms
14	3	correct	1503.72ms
15	3	correct	3006.13ms
16	3	correct	5995.36ms
12	4	correct	785.13ms
13	4	correct	1564.76ms
14	4	correct	3124.21ms
15	4	correct	6387.36ms
16	4	correct	12769.65ms
12	5	correct	1615.50ms
13	5	correct	3214.14ms
14	5	correct	6426.42ms
15	5	correct	12847.44ms
16	5	correct	26275.72ms
Status: Done.
Also tried to open it on my old Kindle from 2013 (b/w, no touchpad etc.) but it didn't want to load the page. :)