]> git.sur5r.net Git - cc65/blob - include/specialmath.h
Optimized mul20 & mul40 and extracted to new library.
[cc65] / include / specialmath.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                              specialmath.h                                */
4 /*                                                                           */
5 /*                 Optimized math routines for special usages                */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2019 Christian 'Irgendwer' Krueger                                    */
10 /*                                                                           */
11 /* This software is provided 'as-is', without any expressed or implied       */
12 /* warranty.  In no event will the authors be held liable for any damages    */
13 /* arising from the use of this software.                                    */
14 /*                                                                           */
15 /* Permission is granted to anyone to use this software for any purpose,     */
16 /* including commercial applications, and to alter it and redistribute it    */
17 /* freely, subject to the following restrictions:                            */
18 /*                                                                           */
19 /* 1. The origin of this software must not be misrepresented; you must not   */
20 /*    claim that you wrote the original software. If you use this software   */
21 /*    in a product, an acknowledgment in the product documentation would be  */
22 /*    appreciated but is not required.                                       */
23 /* 2. Altered source versions must be plainly marked as such, and must not   */
24 /*    be misrepresented as being the original software.                      */
25 /* 3. This notice may not be removed or altered from any source              */
26 /*    distribution.                                                          */
27 /*                                                                           */
28 /*****************************************************************************/
29
30 #ifndef _SPECIALMATH_H
31 #define _SPECIALMATH_H
32
33
34 /* Multiply an 8 bit unsigned value by 20 and return the 16 bit unsigned result */
35
36 unsigned int __fastcall__ mul20(unsigned char value);
37
38
39 /* Multiply an 8 bit unsigned value by 40 and return the 16 bit unsigned result */
40
41 unsigned int __fastcall__ mul40(unsigned char value);
42
43
44
45 /* End of specialmath.h */
46 #endif