Shut up leilei.OMG NOT OPTIMIZED FOR YOUR CRAP COMPUTER
How other people should write their software
-
- Veteran
- Posts: 637
- Joined: Sat Apr 21, 2007 8:05 pm
Both? Then some weird shit is going on. I don't have any weird slowdowns in VBA-M, only slowdowns that actually happen in the game.
BTW, leilei, you officially FAIL at reading what mudlord said.
*States bias*
I am a mod at VBA-M's forums, and my personal opinion on this topic is both mudlord and byuu are a little right and a little wrong.
BTW, leilei, you officially FAIL at reading what mudlord said.
*States bias*
I am a mod at VBA-M's forums, and my personal opinion on this topic is both mudlord and byuu are a little right and a little wrong.
You failed to read, yet again, or you are a troll. Or both.Then where's the problem?
The problem is: code optimization WITHOUT hacks should matter. Byuu, on the other hand, thinks code clarity comes first before optimization. As such, we both have major unreconcilable differences due to the two different approaches, EVEN though they have nothing to do with accuracy.
And the whole point of this thread was a fight between us two over exactly that.
-
- Locksmith of Hyrule
- Posts: 3634
- Joined: Sun Aug 08, 2004 7:49 am
- Location: 255.255.255.255
- Contact:
so whatbyuu wrote:everyone should be free to develop however they want, and nobody has the right to tell others what they should be doing with their unpaid time. This goes for past poorly-made comments I've made, as well.
if I made a bug report for <insert software here> I'm violating people's rights because I'm telling them what to do with their unpaid time? also it should go ignored because that's how they choose to develop?
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
NSRT here.
Wrote up another one of my ten page rants on this subject here:
http://byuu.cinnamonpirate.com/articles/optimization
Mostly so that I don't have to keep discussing it with people in the future ;)
I don't even know how to respond to your question.
http://byuu.cinnamonpirate.com/articles/optimization
Mostly so that I don't have to keep discussing it with people in the future ;)
I really have no idea how you went from what I said to talking about reporting bugs and violating rights ...so what
if I made a bug report for <insert software here> I'm violating people's rights because I'm telling them what to do with their unpaid time? also it should go ignored because that's how they choose to develop?
I don't even know how to respond to your question.
FWIW, I think it also depends on the type of program it is. I imagine there's zero reason to optimize the living shit out of a simple calculator, but one that can go well beyond what simple calculator can provide. At the same time, if it can deal with too many different variables and whatnot, then you'd want to focus on making the code readable.
That was probably a piss poor example, but I hope I got what I meant across.
That was probably a piss poor example, but I hope I got what I meant across.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Non essential stuff doesn't have to make stuff more confusing, or even get in the way at all. They are not necessarily mutually exclusive.byuu wrote: The SPC7110 code I have may not be lightning fast like in ZSNES, but it serves an important purpose: unlike with the register text document, it's possible to understand what each register fully does. And there's no non-essential stuff getting in the way of the raw implementation.
bsnes:
Code: Select all
case 0x4800: {
uint16 counter = (r4809 + (r480a << 8));
counter--;
r4809 = counter;
r480a = counter >> 8;
return codec.output[(decomp_offset++) & 0xffff];
}
Code: Select all
void SPC7110_4800()
{
WRITE_WORD16_LE(SPCCompressionRegs+9, READ_WORD16_LE(SPCCompressionRegs+9)-1);
if (decompression_state.table_current)
{
SPCCompressionRegs[0] = read_decompress();
}
}
Code: Select all
case 0x4806: {
r4806 = data;
unsigned table = (r4801 + (r4802 << 8) + (r4803 << 16));
unsigned index = (r4804 << 2);
unsigned length = (r4809 + (r480a << 8));
unsigned addr = datarom_addr(table + index);
unsigned mode = (memory::cartrom.read(addr + 0));
unsigned offset = (memory::cartrom.read(addr + 1) << 16)
+ (memory::cartrom.read(addr + 2) << 8)
+ (memory::cartrom.read(addr + 3) << 0);
//this can technically be 65536, but it has never been observed higher than 32768 ...
//really need a way to determine both compressed and decompressed lengths, though.
static const unsigned max_length = 32768;
offset = datarom_addr(offset);
for(unsigned i = 0; i < max_length; i++) codec.buffer[i] = memory::cartrom.read(offset + i);
#if 0
printf("decompression: 4805=$%0.2x,4806=$%0.2x,4807=$%0.2x,4808=$%0.2x,480b=$%0.2x\n",
r4805, r4806, r4807, r4808, r480b);
printf("table=$%0.6x,index=%3d,length=%5d,mode=%d,offset=$%0.6x\n",
table, r4804, length, mode, offset);
#endif
switch(mode) {
case 0: codec.decomp_mode0(max_length); break;
case 1: codec.decomp_mode1(max_length); break;
case 2: codec.decomp_mode2(max_length); break;
}
decomp_offset = (r4805 + (r4806 << 8)) << mode;
r480c = 0x80;
} break;
Code: Select all
void SPC7110_4806w()
{
if (decompression_state.graphics_buffer)
{
init_decompression(READ_WORD24_LE(SPCCompressionRegs+1), SPCCompressionRegs[4], READ_WORD16_LE(SPCCompressionRegs+5));
}
SPCCompressionRegs[0xC] = 0x80;
}
Last edited by Nach on Mon Jul 28, 2008 11:28 am, edited 2 times in total.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
I'm about half done with it. I just got side tracked optimizing the SPC7110 code, and will finish it when I'm done with SPC7110. I just take priority with ZSNES over VBA-M, sorry.mudlord wrote: You could persuade Nach to get UPS support in. All my reminders to him have fallen on death ears, since he seemed very interested to implement it.![]()
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- Locksmith of Hyrule
- Posts: 3634
- Joined: Sun Aug 08, 2004 7:49 am
- Location: 255.255.255.255
- Contact:
Eh, don't worry about it. Last night I was on edge and I was feeling sleep deprived, and I was being a smartass. I apologize.byuu wrote:I really have no idea how you went from what I said to talking about reporting bugs and violating rights ...so what
if I made a bug report for <insert software here> I'm violating people's rights because I'm telling them what to do with their unpaid time? also it should go ignored because that's how they choose to develop?
I don't even know how to respond to your question.
still, isn't a proper bug report telling the devs to fix the bug(s) in the software?

<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
NSRT here.
-
- Veteran
- Posts: 637
- Joined: Sat Apr 21, 2007 8:05 pm
Hi,
1) While independent model works best for SNES (because thats how it really works), there are machines where enslavement model is the way to go simply because thats how they work (the master has knowledge of a slave) and you gain many of the benefits which you mentioned for the independent model in your article.
2) Although not strictly code clarity vs. optimization thing, but you must very clearly state that bsnes isn't meant to play games (at least not right now, maybe few years later). Face the truth, about 99% of the people who try your emulator try it to play a game and when they can't (due to speed reasons) they come and blame you here. If you do a simple google search, you'll find that nearly on every forum there will be someone who will sugggest bsnes to play games.
Again, these are just my own opinions. For those who want both speed and accuracy they'll have to wait for ASNES
.
stay safe,
AamirM
Once again a nice article. Always good to read your stuff. But I think there are a few a subtle and important points which you didn't explain very clearly.byuu wrote:Wrote up another one of my ten page rants on this subject here:
http://byuu.cinnamonpirate.com/articles/optimization
Mostly so that I don't have to keep discussing it with people in the future![]()
1) While independent model works best for SNES (because thats how it really works), there are machines where enslavement model is the way to go simply because thats how they work (the master has knowledge of a slave) and you gain many of the benefits which you mentioned for the independent model in your article.
2) Although not strictly code clarity vs. optimization thing, but you must very clearly state that bsnes isn't meant to play games (at least not right now, maybe few years later). Face the truth, about 99% of the people who try your emulator try it to play a game and when they can't (due to speed reasons) they come and blame you here. If you do a simple google search, you'll find that nearly on every forum there will be someone who will sugggest bsnes to play games.
Again, these are just my own opinions. For those who want both speed and accuracy they'll have to wait for ASNES

stay safe,
AamirM
Guess ill add my view too, but before i do:
i am a terrible programmer, at this very moment i am probably unable to write hello world in basic BUT i can often understand what byuu's code its trying to do.
This proves that byuu's approach does work for the readability part.
i also have a friend who uses his "functions" to create readability, his code is also completely understandable just by reading the functions names.
Now here is my idea on the whole thing, all 3 points are equally as important:
1: Code should be readable for other parties, however it doesnt matter if this is done like byuu or with functions or with comments.
2: Code should be written for the future and not the today (current target should be x64, SSSE3E, unlimited cores), while coding keep backwards compatibility in mind(x86,mmx(multithreading is only slightly slower on a single core, so no special care need be taken))
3: the code should be as optimised as possible, although its written with fast computers in mind, it should work on the slowest handheld device.
Now accuracy of emulation has nothing to do with the above 3 priorities, thats a completely different thing altogether, the above 3 priorities are overal for any code from OS to Drivers to Calculators.
that being said, i have only ever met/heard about 1 person who does all 3
i am a terrible programmer, at this very moment i am probably unable to write hello world in basic BUT i can often understand what byuu's code its trying to do.
This proves that byuu's approach does work for the readability part.
i also have a friend who uses his "functions" to create readability, his code is also completely understandable just by reading the functions names.
Now here is my idea on the whole thing, all 3 points are equally as important:
1: Code should be readable for other parties, however it doesnt matter if this is done like byuu or with functions or with comments.
2: Code should be written for the future and not the today (current target should be x64, SSSE3E, unlimited cores), while coding keep backwards compatibility in mind(x86,mmx(multithreading is only slightly slower on a single core, so no special care need be taken))
3: the code should be as optimised as possible, although its written with fast computers in mind, it should work on the slowest handheld device.
Now accuracy of emulation has nothing to do with the above 3 priorities, thats a completely different thing altogether, the above 3 priorities are overal for any code from OS to Drivers to Calculators.
that being said, i have only ever met/heard about 1 person who does all 3
Unfortunately I don't know enough about other systems to really comment on that, so I'll take your word for it. But FWIW, the SMP really was the ideal processor for enslavement. I can't imagine a setup better designed for that.While independent model works best for SNES (because thats how it really works), there are machines where enslavement model is the way to go simply because thats how they work
I wasn't aware that only 1% of the population had processors less than three years old. Now, I would buy 80-90% of people find it to be too slow, sure. But even that is probably an exaggeration, unless you're talking about the just-added SPC7110 support.Face the truth, about 99% of the people who try your emulator try it to play a game and when they can't (due to speed reasons) they come and blame you here.
Mostly so that I don't have to keep discussing it with people in the future![]()
....So, in my involuntary absence (for mental health reasons, go ahead and laugh), I return to a already fucked up life (and now worse), AND yet I see a rant, debating the merits of code clarity over raw optimization for speed on less than brand new processors?
Enough of that. I might as well post on my blog why I care about optimization, even on top end PCs and my personal beliefs on the matter as such.
Anywayz, nice rant. Makes sense


EDIT:
No problemsI just take priority with ZSNES over VBA-M, sorry.

Hi,mudlord wrote:Can't wait to see what you do.For those who want both speed and accuracy they'll have to wait for ASNES![]()
Though, I like BSNES too.
Hah, I doubt I'll do any better. I am sure ZSNES will fill up the space for a fast and accurate emu soon. I like bsnes too but I've never been able to run it full speed on my PC

stay safe,
AamirM
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
I wonder...AamirM wrote:I am sure ZSNES will fill up the space for a fast and accurate emu soon.
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)