Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1645:262300a0359b
Add helper functions dmReverse{Get,Put}Byte().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 30 May 2018 00:57:21 +0300 |
parents | 9d9a0e852b3d |
children | 948d6fda722d |
comparison
equal
deleted
inserted
replaced
1644:9d9a0e852b3d | 1645:262300a0359b |
---|---|
95 if (op->bank > nbanks) | 95 if (op->bank > nbanks) |
96 nbanks = op->bank; | 96 nbanks = op->bank; |
97 } | 97 } |
98 | 98 |
99 return nbanks + 1; | 99 return nbanks + 1; |
100 } | |
101 | |
102 | |
103 BOOL dmReverseGetByte(const Uint8 *buf, size_t *offs, Uint8 *data) | |
104 { | |
105 if (*offs > 0) | |
106 { | |
107 *data = buf[--(*offs)]; | |
108 return TRUE; | |
109 } | |
110 else | |
111 return FALSE; | |
112 } | |
113 | |
114 | |
115 BOOL dmReversePutByte(Uint8 *buf, size_t *offs, const Uint8 data) | |
116 { | |
117 if (*offs > 0) | |
118 { | |
119 buf[--(*offs)] = data; | |
120 return TRUE; | |
121 } | |
122 else | |
123 return FALSE; | |
100 } | 124 } |
101 | 125 |
102 | 126 |
103 int dmC64MemBlockAlloc(DMC64MemBlock *blk, const size_t size) | 127 int dmC64MemBlockAlloc(DMC64MemBlock *blk, const size_t size) |
104 { | 128 { |