Add Endian.HC functions from minexew's SnailNet library

This commit is contained in:
Alec Murphy
2017-07-08 12:10:14 -04:00
parent 9eabaeab79
commit 26915252b0
3 changed files with 23 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
U16 htons(U16 h) {
return ((h >> 8) | (h << 8)) & 0xffff;
}
U16 ntohs(U16 h) {
return ((h >> 8) | (h << 8)) & 0xffff;
}
U32 htonl(U32 h) {
return ((h >> 24) | ((h & 0x00ff0000) >> 8) | ((h & 0x0000ff00) << 8) | (h << 24)) & 0xffffffff;
}
U32 ntohl(U32 h) {
return ((h >> 24) | ((h & 0x00ff0000) >> 8) | ((h & 0x0000ff00) << 8) | (h << 24)) & 0xffffffff;
}
+1 -1
View File
@@ -234,7 +234,7 @@ public I64 PNGWrite(U8 *filename,CDC *dc,I64 bits=4)
FileWrite(filename,png,size);
Free(png);
return size;
}
}
#help_index "Graphics/PNG Files;Graphics/Scrn"
public I64 PNGScrnCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
+7
View File
@@ -2,3 +2,10 @@
PNG support for TempleOS
![FilePNG](https://raw.githubusercontent.com/tramplersheikhs/filepng/master/example.png "FilePNG")
`#include "Endian"` (if needed)
`#include "FilePNG"`
`PNGScrnCapture;` and `PNGWrite("filename.png");` functions are present.