Here's the dswifi librbary ported to ASM code. I've been busy on that project for the past five weeks, and just finished the port yesterday, it's still untested, still lacks some basic subfunctions (like memcopy), and I've probably screwed up a lot of things and the code is probably still totally bugged.
Anyways, during porting, I've naturally had to 'review' every single line of code in the original HLL versions, and came across a bunch of bugs & oddities in the original code. For details, check the ASM file, and search for comments with tags "BUGGED", "BLAH", and "uh":
View attachment 67769 - dswifi ASM port (new ASM code, with comments on HLL bugs)
View attachment 67770 - dswifi HLL code (just for reference: the original HLL code, merged into a single txt file)
EDIT: Hmmm, above links have no permission to view the attachment(?) alternately try thes links (should be working, unless that "temp hash" expires at some point; or unless it should work only with my own IP):
http://gbatemp.net/attachments/dswifi01-txt.67769/?temp_hash=1582d05735d506a4e68e6c28013f9808 - ASM
http://gbatemp.net/attachments/dswifi00-txt.67770/?temp_hash=1582d05735d506a4e68e6c28013f9808 - HLL
(if somebody knows how to use the forums "ATTACH" feature please PM me, just using the attachment number enclosed in ATTACH and /ATTACH doesn't seem to work out)
Tag BUGGED indicates real bugs (unless I've totally misunderstood the code). For example, checksum calculation looks wrong in some cases (carry-out handling, or checksum-zero handling), the checksumming should work in most cases, but it might produce transmission errors at 1:65535 chance (possibly passing okay if retransmissions are done with different headers & different checksums). Some other bugs include cropping the transfer length to the bigger of two values (instead of the smaller value).
Tag BLAH (no offense) indicates useless/unused functions & variables. Some if of it is subjective though (the "extern" definitions are (only) useless when merging the whole source code into a single file; and some of the unused variables might have some purpose for debug/status stuff).
Tag uh indicates stuff that's unclear to me. Some of it might be bugged, or it might be actually working and intended as-is (but would be nice to get some comments/confirmations that explain how/why it's working).
The function names are 99% same as in the original code, so it should be easy to naviagate between the comments in the ASM file and the original code in the HLL files. Main difference is that I've prefixed some functions names by "arm7_" or "arm9_", just remove that prefixes to get the original name.
PS. what I am actually up to is trying to make some wifi uploader that works more reliable than dslink, and preferably also smaller; my current binary is 32Kbytes, and it could be compressed to around 16Kbytes, but it's still too big for DSi cartridge exploits with only have 8Kbytes of save memory, but maybe I can throw away some components: DNS shouldn't be needed for local networks, and Stephen suggested that one could also use non-TCP transmissions, and, not sure if one needs DHCP and IP addresses at all... or could one also use the DS(i)'s MAC address directly from within local networks?
Anyways, during porting, I've naturally had to 'review' every single line of code in the original HLL versions, and came across a bunch of bugs & oddities in the original code. For details, check the ASM file, and search for comments with tags "BUGGED", "BLAH", and "uh":
View attachment 67769 - dswifi ASM port (new ASM code, with comments on HLL bugs)
View attachment 67770 - dswifi HLL code (just for reference: the original HLL code, merged into a single txt file)
EDIT: Hmmm, above links have no permission to view the attachment(?) alternately try thes links (should be working, unless that "temp hash" expires at some point; or unless it should work only with my own IP):
http://gbatemp.net/attachments/dswifi01-txt.67769/?temp_hash=1582d05735d506a4e68e6c28013f9808 - ASM
http://gbatemp.net/attachments/dswifi00-txt.67770/?temp_hash=1582d05735d506a4e68e6c28013f9808 - HLL
(if somebody knows how to use the forums "ATTACH" feature please PM me, just using the attachment number enclosed in ATTACH and /ATTACH doesn't seem to work out)
Tag BUGGED indicates real bugs (unless I've totally misunderstood the code). For example, checksum calculation looks wrong in some cases (carry-out handling, or checksum-zero handling), the checksumming should work in most cases, but it might produce transmission errors at 1:65535 chance (possibly passing okay if retransmissions are done with different headers & different checksums). Some other bugs include cropping the transfer length to the bigger of two values (instead of the smaller value).
Tag BLAH (no offense) indicates useless/unused functions & variables. Some if of it is subjective though (the "extern" definitions are (only) useless when merging the whole source code into a single file; and some of the unused variables might have some purpose for debug/status stuff).
Tag uh indicates stuff that's unclear to me. Some of it might be bugged, or it might be actually working and intended as-is (but would be nice to get some comments/confirmations that explain how/why it's working).
The function names are 99% same as in the original code, so it should be easy to naviagate between the comments in the ASM file and the original code in the HLL files. Main difference is that I've prefixed some functions names by "arm7_" or "arm9_", just remove that prefixes to get the original name.
PS. what I am actually up to is trying to make some wifi uploader that works more reliable than dslink, and preferably also smaller; my current binary is 32Kbytes, and it could be compressed to around 16Kbytes, but it's still too big for DSi cartridge exploits with only have 8Kbytes of save memory, but maybe I can throw away some components: DNS shouldn't be needed for local networks, and Stephen suggested that one could also use non-TCP transmissions, and, not sure if one needs DHCP and IP addresses at all... or could one also use the DS(i)'s MAC address directly from within local networks?
Last edited by nocash123,