That was what I meant. I checked the readme in the 3.3 binary, butI did not find any credit for 7zip.Nach wrote:Read the readme next time.kilivipin wrote: Oh.. Thanks.
I just didn't see any credits in the nsrt 3.3 binary.
JMA Compression
Moderator: ZSNES Mods
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Igor Pavlov is clearly thanked in the readme.kilivipin wrote:That was what I meant. I checked the readme in the 3.3 binary, butI did not find any credit for 7zip.Nach wrote:Read the readme next time.kilivipin wrote: Oh.. Thanks.
I just didn't see any credits in the nsrt 3.3 binary.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
SHIT!Nach wrote:Igor Pavlov is clearly thanked in the readme.kilivipin wrote:That was what I meant. I checked the readme in the 3.3 binary, butI did not find any credit for 7zip.Nach wrote:Read the readme next time.kilivipin wrote: Oh.. Thanks.
I just didn't see any credits in the nsrt 3.3 binary.
I was looking for a credit to 7zip. Ah well...
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Probably not. I've been following his forum for ages, and he's never done a single thing anyone has suggested.denzilla wrote:Will Igor implement JMA compression/decompression into future versions of 7zip? I'll prolly stick to zip until something other that NSRT is able to manipulate the file format.
Thanks. But I really can't take a lot of credit, so much of JMA was done by others.denzilla wrote: Good work nonetheless, NACH. You're a helluva coder!
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
Get your ass in gear and join the dev channel, then.Syvalion wrote:I actually feel guilty for enjoying ZSNES for all these years, to the extent that I am taking steps to someday cotribute to the project. Hopefully soon.
Don't worry, it's only painful the first time.
And the second... or maybe 3 times.
More like 10, actually.
Come on, we'll just eat your brains with gravel.
皆黙って俺について来い!!
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)
-
- Dark Wind
- Posts: 1271
- Joined: Thu Jul 29, 2004 8:58 pm
- Location: Texas
- Contact:
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
I can tell you what I know on porting asm into c; it's quite different than simply 'connecting' C to ASM.Noxious Ninja wrote:Hm, I might have to stop by. Can you teach me l33t C ABI stuff and how to connect C code to ASM code?
皆黙って俺について来い!!
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)
-
- Trooper
- Posts: 535
- Joined: Wed Jul 28, 2004 3:26 am
Do you actually know enough asm to look at the code and be able to write the equivalent in C or do you have to ask what it does before you can write the C equivelant?grinvader wrote:I can tell you what I know on porting asm into c; it's quite different than simply 'connecting' C to ASM.Noxious Ninja wrote:Hm, I might have to stop by. Can you teach me l33t C ABI stuff and how to connect C code to ASM code?
[code]<Guo_Si> Hey, you know what sucks?
<TheXPhial> vaccuums
<Guo_Si> Hey, you know what sucks in a metaphorical sense?
<TheXPhial> black holes
<Guo_Si> Hey, you know what just isn't cool?
<TheXPhial> lava?[/code]
<TheXPhial> vaccuums
<Guo_Si> Hey, you know what sucks in a metaphorical sense?
<TheXPhial> black holes
<Guo_Si> Hey, you know what just isn't cool?
<TheXPhial> lava?[/code]
-
- Dark Wind
- Posts: 1271
- Joined: Thu Jul 29, 2004 8:58 pm
- Location: Texas
- Contact:
Oh, I know. I mean, if I take an ASM function and write a C equivalent, how do I call that function, pass arguments, collect return values, that stuff.grinvader wrote:I can tell you what I know on porting asm into c; it's quite different than simply 'connecting' C to ASM.Noxious Ninja wrote:Hm, I might have to stop by. Can you teach me l33t C ABI stuff and how to connect C code to ASM code?
To a certain extent. I found a decent x86 assembler reference, and that helped. Unfortunately, the images in it seem to be broken, but it's good for looking up instructions.Megabyte wrote:Do you actually know enough asm to look at the code and be able to write the equivalent in C or do you have to ask what it does before you can write the C equivelant?grinvader wrote:I can tell you what I know on porting asm into c; it's quite different than simply 'connecting' C to ASM.Noxious Ninja wrote:Hm, I might have to stop by. Can you teach me l33t C ABI stuff and how to connect C code to ASM code?
http://faydoc.tripod.com/cpu/index.htm
There's still NASM syntax things that that doesn't explain, but I'm able to understand a few blockes of code in the GUI routines now.
[u][url=http://bash.org/?577451]#577451[/url][/u]
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
Do I sound like a total retard or something ?Megabyte wrote:Do you actually know enough asm to look at the code and be able to write the equivalent in C or do you have to ask what it does before you can write the C equivelant?
ASM isn't hard to understand, it's hard to maintain. ASM intructions are quite explicit.
The porting problems come with registers and program structure.
ASM is unstructured, like BASIC. Lots of conditionnal jumps and tests everywhere. A bit of reflexion gives the best C fit.
Then registers and memory locations, those are quite bothersome, but once you know how to handle them, porting is almost as easy as pie, just time-consuming.
Extremely easyNoxious Ninja wrote:Oh, I know. I mean, if I take an ASM function and write a C equivalent, how do I:grinvader wrote:I can tell you what I know on porting asm into c; it's quite different than simply 'connecting' C to ASM.Noxious Ninja wrote:Hm, I might have to stop by. Can you teach me l33t C ABI stuff and how to connect C code to ASM code?
call that function
Depends on where they are. Memory locations are easy to pass, but registers... not more than one.pass arguments
Same as above, and note that most asm funcs don't have a return value. They just modify the registers needed, and return to the caller. So most C ports are void func() {<stuff>}collect return values
皆黙って俺について来い!!
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)
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Well if you stop by the channel, we usually discuss programming when we're around. How to link C with asm and call correctly and port and stuff is a perfectly normal topic of discussion.
We even had a major argument about signed values today. So come on in, the water could wash away everything but the toughness in you.
We even had a major argument about signed values today. So come on in, the water could wash away everything but the toughness in you.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- Trooper
- Posts: 535
- Joined: Wed Jul 28, 2004 3:26 am
I didn't mean to imply that. I know nothing about asm and have always heard it is difficult to work with, which is why I asked.grinvader wrote:Do I sound like a total retard or something ?Megabyte wrote:Do you actually know enough asm to look at the code and be able to write the equivalent in C or do you have to ask what it does before you can write the C equivelant?
[code]<Guo_Si> Hey, you know what sucks?
<TheXPhial> vaccuums
<Guo_Si> Hey, you know what sucks in a metaphorical sense?
<TheXPhial> black holes
<Guo_Si> Hey, you know what just isn't cool?
<TheXPhial> lava?[/code]
<TheXPhial> vaccuums
<Guo_Si> Hey, you know what sucks in a metaphorical sense?
<TheXPhial> black holes
<Guo_Si> Hey, you know what just isn't cool?
<TheXPhial> lava?[/code]
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Learning what you need to learn in asm to get by is actually easier than any language other than BASIC.Megabyte wrote:I didn't mean to imply that. I know nothing about asm and have always heard it is difficult to work with, which is why I asked.grinvader wrote:Do I sound like a total retard or something ?Megabyte wrote:Do you actually know enough asm to look at the code and be able to write the equivalent in C or do you have to ask what it does before you can write the C equivelant?
The great thing about assembly is, you can never have a complex line.
Let's take a nice example:
C complexity:
Code: Select all
*(*ram+size) -= (buffer > size >> 2*money) ? ((buffer << 1)+(unsigned long long)&myfunc*2<<16) : &myfunc+*money;
Asm complexity:
Code: Select all
add dword[eax+ebx*4],esi
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
To add to Nach's post:
Usually you end up compiling several lines of asm code on one line of C code, which is why asm has a lot of simple lines.
Example: (I love that one, it's one of my most impressive ports)
ASM:
C:
Usually you end up compiling several lines of asm code on one line of C code, which is why asm has a lot of simple lines.
Example: (I love that one, it's one of my most impressive ports)
ASM:
Code: Select all
NEWSYM CapturePicture
pushad
mov esi,[vidbuffer]
add esi,288*2+16*2
mov edi,PrevPicture
mov edx,56
.next
push esi
push edx
mov dx,1111011111011110b
cmp byte[newengen],0
je .noneweng2
cmp byte[nggposng],5
jne .noneweng2
mov dx,0111101111011110b
.noneweng2
mov ecx,64
.loop
mov ax,[esi]
mov bx,[esi+4]
and ax,dx
and bx,dx
shr ax,1
shr bx,1
add ax,bx
push ax
mov ax,[esi+288*2]
mov bx,[esi+4+288*2]
and ax,dx
and bx,dx
shr ax,1
shr bx,1
add bx,ax
pop ax
and ax,dx
and bx,dx
shr ax,1
shr bx,1
add ax,bx
mov [edi],ax
add esi,8
add edi,2
dec ecx
jnz .loop
pop edx
pop esi
add esi,288*2*4
dec edx
jnz near .next
cmp byte[newengen],0
je .noneweng
cmp byte[nggposng],5
jne .noneweng
mov edx,PrevPicture
mov ecx,64*56
.loop2
mov ax,[edx]
mov bx,ax
and ax,0111111111100000b
and bx,0000000000011111b
shl ax,1
or bx,ax
mov [edx],bx
add edx,2
dec ecx
jnz .loop2
.noneweng
popad
ret
Code: Select all
void CapturePicture()
{
unsigned short work1, work2, filter;
unsigned int i, j, offset, pppos=0;
if ((newengen & 0xFF) && ((nggposng[0] & 0xFF) == 5))
{
filter = 0x7BDE; // 0111 1011 1101 1110
}
else
{
filter = 0xF7DE; // 1111 0111 1101 1110
}
for (j=0 ; j<56 ; j++)
{
offset = 288+16+j*288*4;
for (i=0 ; i<64 ; i++)
{
work1 = ((vidbuffer[offset] & filter)>>1) + ((vidbuffer[offset+2] & filter)>>1);
work2 = ((vidbuffer[offset+288] & filter)>>1) + ((vidbuffer[offset+288+2] & filter)>>1);
PrevPicture[pppos] = ((work1 & filter)>>1) + ((work2 & filter)>>1);
offset += 4;
pppos++;
}
}
if ((newengen & 0xFF) && ((nggposng[0] & 0xFF) == 5))
{
for (pppos=0 ; pppos<64*56 ; pppos++)
{
PrevPicture[pppos] = ((PrevPicture[pppos] & 0x7FE0)<<1)|(PrevPicture[pppos] & 0x001F);
} // 0111 1111 1110 0000 and 0000 0000 0001 1111
}
}
皆黙って俺について来い!!
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)
-
- Dark Wind
- Posts: 1271
- Joined: Thu Jul 29, 2004 8:58 pm
- Location: Texas
- Contact:
Just trying to get a few things clear here...
I have written programs in MIPS assembly language before, and unuccessfully tried to do some Z80 programs (lost interest). From what I remember hearing, x86 is a bit tougher than MIPS because of limited amounts of registers right? MIPS compatable processors had something like 32 general purpose registers of which most of them were almost always usable. Does the x86 have some 32bit registers and some 16bit?
Also, how much of a difference does the fact that it is a CISC CPU instead of a RISC CPU make? Is the instruction set much larger? One thing I liked about assembly is that it was very easy to see exactly what was happening to the processor at any given moment, even if it did make the program harder to read as a whole.
I have written programs in MIPS assembly language before, and unuccessfully tried to do some Z80 programs (lost interest). From what I remember hearing, x86 is a bit tougher than MIPS because of limited amounts of registers right? MIPS compatable processors had something like 32 general purpose registers of which most of them were almost always usable. Does the x86 have some 32bit registers and some 16bit?
Also, how much of a difference does the fact that it is a CISC CPU instead of a RISC CPU make? Is the instruction set much larger? One thing I liked about assembly is that it was very easy to see exactly what was happening to the processor at any given moment, even if it did make the program harder to read as a whole.
~Bent
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
I used a flowchart for stateloader, because it was called 4 times with different parameters each time in asm. Preparing in such cases saves a lot of time.Noxious Ninja wrote:Heh. That's a fairly complex piece of code there.grinvader wrote:Example: (I love that one, it's one of my most impressive ports)
Can you do all that in your head, or do you have to get out some paper and trace the execution?
But for 1-way functions, I usually convert them on-the-fly. Reading ahead of opcodes gets easier and easier as time goes.
You end up 'seeing' C in opcodes. If, For, Switch... and so on. This func features a double imbricated for using a register that gets pushed during the small loop so that it can be used in storing/manipulating values.
By analysing the C, you should be able to see what the asm does.
皆黙って俺について来い!!
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)
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
When writing a complex function, yes the register limit is a problem.Bent wrote:x86 is a bit tougher than MIPS because of limited amounts of registers right?
The 16 bit registers are part of the 32 bit ones. Meaning you can access a 32 bit reg half way if you want.Bent wrote: MIPS compatable processors had something like 32 general purpose registers of which most of them were almost always usable. Does the x86 have some 32bit registers and some 16bit?
I don't know the full instruction set of MIPS and x86, but I think x86 has a larger set.Bent wrote: Also, how much of a difference does the fact that it is a CISC CPU instead of a RISC CPU make? Is the instruction set much larger?
To be honest though, I only use a dozen opcodes or so on a regular bases anyway.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding