Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
So umm... What is the current status with this emulator with regards to these pages:
http://tasvideos.org/EmulatorResources/Features.htmlhttp://tasvideos.org/EmulatorResources/Requirements.html
Let's start with:
-- Does it work on most systems by simply extracting a package, running the executable within, selecting an ISO, and clicking a "load" button, and then just playing, without need to run configuration & plugin selection?
-- Are the most used options accessible on the commandline? I.e. can I launch e.g. "pcsx x.iso test.pxm" to have it bind "x.iso" to the emulated CD drive and playback the "test.pxm" movie, with no pointing&clicking or other types of menu navigation needed?
-- Continuation to the commandline topic: Can AVI recording also be activated from the commandline?
-- Does it compile with free/libris development tools (MINGW/GCC toolchain)?
-- Does it work on Linux? (WINE not accepted; most plugins are high-likely not WINE-compatible)
-- Are all the plugins that are required for TASing, free from requirements of some particular hardware or third-party software versions?
-- Are all those plugins installed by default?
-- Is the rendering quality (audio & video) close to original? (I.e. 15-bit dithering and all)
-- Do most popular games work on it?
-- Is it stable, i.e. does not crash if you navigate menu accidentally in the wrong order or leave some checkbox unchecked?
-- Is the movie file format stable? I.e. does it include all the necessary things?
-- Continuation: Does the movie file format include a way to tell whether the movie begins from a cold reboot (power cycle), from a soft reboot (reset button) or a savestate?
-- Continuation: Does the movie file format include a way to tell the FPS on which the movie runs? Is the said FPS constant throughout the movie? I.e. can the movie length in milliseconds be derived from the movie file alone, tamper-securely?
-- Continuation: Does the movie file format include way to indicate CD changes (including the information about which CD was inserted)? Note: Should also include information about which CD was inserted in the beginning of the movie.
-- Continuation: Does the movie file format include way to include soft reboot (reset button) events in the movie?
-- Is the movie playback robust against differences between whatever memory card the user has inserted in comparison to whatever memory card the player had inserted?
-- Continuation: Is the movie playback safe against memory card alteration? I.e. playing back a movie should not produce changes to your memory cards unless you explicitly want so. Movie playback should _allow_ accessing a memorycard, but the said memorycard should be entirely a simulated one for the purposes of the movie playback, separate from whatever the playback-user has inserted.
-- Continuation: Does the movie file format include a way to determine memory card switch events (and the contents of said memorycards)?
-- Can the movie be paused and/or speed changed during playback, without these actions affecting the sync of the movie?
-- Related question: Can the movie be paused and/or speed changed during playback, without these actions affecting the A/V sync or the playback speed within the AVI that is produced during the playback, if AVI recording is activated?
I think that the emulator can be accepted on this site once the answer to all of these questions is "yes". Maybe a bit earlier if the particular shortcoming is not an important one. Most of these are important, though.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I have to say, Flagitious's one is the most interesting one, abusing the fact that Ruby uses bignums for math.
Then comes the regexp one which I discovered around half-way to the contest, and which I realized that it must be the one that mr. Omni used for his entry. Seems that Pauli also discovered it at some point. Unfortunately, I didn't know Perl syntax well enough to compete reasonably with Omni. My Perl version was just a direct translation of the PHP version I wrote myself.
I was well surprised though, how small we got the PHP entry with qFox. In all fairness, the idea of iterating through two variables with a single loop was mine, but I need to recognize qFox because without his insistance, I would not have believed that pursuing the just-loop-and-mod algorithm is worthwhile.
In retrospect, implementing our PHP algorithm in GW-BASIC would become:
1?"1";
2j=j-1:IF j<2THEN 4
3IF i MOD j=0AND i MOD 7THEN?STR$(i);ELSE 2
4i=i+1:j=i:IF j<=1e3THEN 2
(100 bytes, requires CRLF. QuickBASIC version is the same except that labels "1" and "3" can be removed and just LF suffices, making it 95 bytes.)
However, the tokenized GW-BASIC format is even shorter, 87 bytes:
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
These changes start suddenly reminding me of panel three of this strip:
We're You're decomposing the game, turning things upsidedown and discovering new physics.
(Translation of the texts in the strip:
Some people were curious, too…
Only a few months more…
That's an awesome building… I think I'll make one too! (whose building is that anyway?)
(Sign: Pysy poissa!)
Dr.Wily didn't know Dr.Light yet.
So shall I do!
After a month:
Are you sure you have done everything right?
Hmm…
And:..)
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
A few basic things I have learned about short C code:
― Embed the pre- and post-increment in expressions that have another purpose. For example, instead of for(int a=1; a<100; ++a), say for(int a=0; ++a<100; ), or for(int a=0; a++<99; ). Decide whether a post-increment or a pre-increment serves you better.
― Instead of if()else, use && and || or ?: , whenever possible. (Which is almost always.). Also check whether mathematical operators, such as + or * would work in your favor. Be aware of non-obvious function return values. In PHP, print always returns (int)1. For example, if(a==0) c; can be converted into a||c. And if(a) b; can be converted into a&&b. And if(a) { b; } else { c; } can be converted into a?b:c. This is assuming that b and c are expressions and not statements.
― Instead of while(), use for(). It's never a loss, and usually it's a win. For example, a(); while(b < 6) c(); can be converted into for(a(); b<6; c()); This saves one character.
― Reuse variables. For example, if you use argc to capture the number of commandline arguments, reuse it as a loop iteration variable. Note that it does not need to be named argc.
― Be aware of shorter but equivalent commands. In PHP, print and echo do the same thing, but echo is shorter, but is a statement, whereas print is a function. Functions can be used in expressions, but statements cannot.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
If you shrink your code to a minimum and it reaches the same length as mine, it's likely the same algorithm… otherwise, not.
I suppose you know these:
― <?php does not require a matching ?>. These two are just metacommands that change between "print-everything" and "interpret PHP syntax" modes.
― PHP syntax is similar to C syntax. Have a look at C entries in similar contests to get ideas. I don't know if you have experience with obfuscated programming or not. (what's the matter with IOCCC btw?)
Too bad PHP does not have stuff like list comprehensions, and things like create_function() are just a bit too long words to even consider.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
It's not like you can't improve your submission without Internet connection…
Well, unless you need to look for other algorithms or manual page lookups.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
After I wrote about God's calling, many people have asked me, how does God call people. How does God communicate?
After a long ponder of how and whether I should respond, for many of those are not asking seriously, here is my response anyway.
Most commonly, I think, God's calling is comparable to an urge. In a similar manner as how migratory birds just know that now is their time to leave, sometimes God's will builds up inside you as an intuitive feeling that one must do something.
It is not the only way, though. At biblical times, God occasionally called up some people as prophets. Those prophets were ordinary people who were thoroughly dedicated to serving God for the greater good; they lived a quite different live than other ordinary people. And God used them; he put words in their mouths. Literally. They would open their mouth, and without a single plan, they would speak out words that come from the God. Often, they would be shocked of the words as they spoke them, because the contents were a surprise to them as well. Often, those were words that they rather not dare to speak ― Jonah's case is a good example ― but they have to, for the obedience to God. Such speaking was not usually done casually ― it was after long fasting, etc., that it came. Prophets were usually needed when God's word needed to be delivered to many people, or to an entire nation, at once.
In today's world, prophets still exist ― they are even more common than they were at biblical times. Those prophets usually work in a congregation, serving the congregation's needs ― even the needs of singular people. Sometimes God's word is received through those prophets. I have received such word as well. Sometimes, the intuitive feeling inside me confirms whether it is God's word or not. False prophets exist too.
I wrote this for the help of those who want to know. If you want to debunk these words, do so. I don't care; debating of the issue won't help me or anyone else. Post an X-Files I-want-to-believe poster if you want. Be a temple robber if you want. You will receive your reward.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I'm very glad to see things progressing after a long, long halt!
Thank you, everyone who have contributed towards that goal.
Rejoice for that Shinryuu has so many fans :D
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Feh, readibility would be nice. Also, what is the character encoding you are supposing? The exact byte values of your characters matter to a great deal I suppose and converting the characters into bytes, depends on the character encoding used. I can make an educated guess, but it would be better if it came from the horse's mouth.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Nice one, though incomplete. Here's one for Linux.
extern printf,exit
global main
main sub esp,8192
lea ebp,[esp+4000]
mov ebx,0
mov esi,1
call o ;hope hard here that cx != 0
b mov cx,1 ;test primality. Start by dividing with 2.
p inc cx
cmp cx,si
jae c ;do division tests up to n-1
call i
jne p ;loop until primality confirmed false
r mov cx,7
call i ;also divide by 7
je c ;don't output if it was a multiple of 7
call o
c inc si
cmp si,1001
jb b
mov[ebp+ebx],byte 0 ; ensure the format string ends with '\0'.
push ebp
call printf
jmp exit
o mov[ebp+ebx],dword"%1d "
add ebx,4 ;swap order of add&mov because we're in a subcall (esp has -4 in it)
mov[esp+ebx],esi
; Note: continues straight into "i".
; If the program crashes due to cx being zero
; at the program start, insert a "ret" here.
i mov dx,0
mov ax,si
div cx
or dx,dx
ret
To run:
$ nasm -f elf code.S (yasm works too)
$ gcc -m32 code.o
$ ./a.out
EDIT: For those who think that using libc is cheating, here's a version that runs without any linked in libraries (no, nobody complained, I'm just saying). This also produces the e5520566aa3e1456e05d1f17d91ab9d4-hash output, i.e. no trailing space:
;global _start
; _start: ; -- these two lines are optional, but you can enable them for purity
sub esp,4096
mov edi,esp
mov ebx,1
mov eax,1
mov[edi],byte"1"
b mov si,ax
mov cx,7 ;test modulo 7
call i
jz c
lea cx,[si-1]
call p ;test primality
jne c
mov[edi+ebx],byte" "
inc bx
mov cx,10 ;output in base10
mov ax,si
call d
c lea ax,[si+1] ;next number
cmp ax,1001
jb b
mov dx,bx
mov bx,1
mov ecx,esp
mov ax,4 ;NR_write
int 128 ;syscall
; mov ax,1 ;NR_exit -- enable these two lines if you want the program
; int 128 ;syscall -- to terminate _without_ a segmentation fault
d call i
or ax,ax
jz e
push dx
call d
pop dx
e or dl,48
mov[edi+ebx],dl
inc bx ; note: continues straight into "i", however, a bare "ret" would suffice
i mov dx,0
div cx ; ax=val/10, dx=val%10
or dx,dx
r ret
p cmp cx,2
jb r
mov ax,si
call i
je r
loop p
To run:
$ nasm -f elf code.S (yasm works too)
$ gcc -m32 -nostdlib code.o (alternatively: ld -m elf_i386 -o a.out code.o)
$ ./a.out
Ps: If the limit had been only up to 255, not 1000, I would have used my favourite obscure IA32 opcode: AAM, instead of DIV.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I got 134, under the condition that it must run warning-free even with E_ALL error reporting level and short tags disabled.
For the record, I also did Ruby in 79 and Python in 93...
(Though the Ruby one has trailing space and the Python one has extra delimiters.)
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I sent you a private message, but since you aren't reading it... might as well say it here for the benefit of others as well.
Do this:
[V] Disable HTML in this post
This lets phpBB understand that when you are posting < and >, you don't mean a HTML tag, and it won't try to sanitize them.
While you are at it, you might go to your profile page and set the HTML setting disabled by default, since it's very rare that you actually need it and since the inconvenience with posts containing < and > mingled is usually greater than is the inconvenience of having to uncheck the box when you do want to use HTML markup.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I tried Haskell first, but I couldn't figure out how to do AND conditions. Also, your code fails to print the result. EDIT: Rest of the post not applicable anymore.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I'll throw in this C++ entry. It sports an example of metaprogramming. In telling the compiler what kind of program we're designing, we're making the compiler carry out the necessary calculations. The resulting program simply prints the results and does no calculations whatsoever. Mind you, this is not very typical C++ programming style.
Note that some compilers may have trouble compiling this entry. For instance, it requires a template recursion depth of some 500. (Another topic is Microsoft's C++ compiler (CL version 12.00.8168), which fails to even understand the syntax.)
#include <iostream>
template<int p, int m> struct prime { enum {
// Handling two iterations at once to overcome compiler limitation
// with maximum template recursion depth
result = ((p%m) != 0) && ((p%(m-1)) != 0) && prime<p,m-2>::result
}; };
template<int p> struct prime<p,1> { enum { result = 1 }; };
template<int p> struct prime<p,0> { enum { result = 1 }; };
template<int guess, int value, int i> struct int_sqrt_floor {
enum { result = int_sqrt_floor<guess-(guess*guess-value)/(2*guess), value, i+1>::result
}; };
template<int guess, int value> struct int_sqrt_floor<guess,value,7> { enum { result = guess }; };
template<int value, int i> struct int_sqrt_floor<0,value,i> { enum { result = 0 }; };
template<int o> struct sieve { enum {
result = (o==1) || (o%7 && o!=3
&& !prime<o,int_sqrt_floor<o/2,o,1>::result+1>::result)
}; };
template<int k> struct sieveprint { sieveprint(std::ostream& o) {
(sieveprint<k-5>(o));
// loop unrolling to overcome compiler limitation
// of maximum template recursion depth
if(sieve<k-4>::result) o << k-4 << ' ';
if(sieve<k-3>::result) o << k-3 << ' ';
if(sieve<k-2>::result) o << k-2 << ' ';
if(sieve<k-1>::result) o << k-1 << ' ';
if(sieve<k>::result) o << k << ' ';
} };
template<> struct sieveprint<0> { sieveprint(std::ostream&) {} };
int main() { (sieveprint<1000>(std::cout)); }
Obviously, the goal of this entry is not to get the smallest filesize. I just posted it for fun.
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
After watching the submission, I think I would like to see the Sunsoft levels being solved. They're interesting. I gather there aren't a lot of people who have played through them. And it's not like ~10 minutes more is going to weigh a lot in a submission of this length…
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I'm stuck with Windows, so I used snes9x.exe dated Dec 30 2004, professing the version number 1.43. No SVN building for me.
EDIT: Seems that "SNES9x 1.43 v9+bugfix.exe" does a little better. Maybe this should be indicated in the submission, as requested in the SubmissionInstructions?
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Hmm... desyncs in level 2. I used snes9x 1.43.
Would it be too much to ask to indicate the emulator version in the submission, as requested in the SubmissionInstructions?
Editor, Experienced Forum User, Published Author, Active player
(296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Aglar wrote:
I'd really like to give this 10.0 for technical value but I can't, sorry - not your fault but those bastards at Capcom who can't make consistent games:)
That's not what "tech quality" means. You're not supposed to judge the game, but the play...