Refactor some math functions into a shared file for rgbasm and rgblink

Fixes #769

Fixes #770
This commit is contained in:
Rangi
2021-02-28 16:50:47 -05:00
committed by Eldred Habert
parent 0774f5eb9d
commit ac2cefdd87
7 changed files with 151 additions and 177 deletions

20
include/opmath.h Normal file
View File

@@ -0,0 +1,20 @@
/*
* This file is part of RGBDS.
*
* Copyright (c) 1997-2021, RGBDS contributors.
*
* SPDX-License-Identifier: MIT
*/
#ifndef RGBDS_OP_MATH_H
#define RGBDS_OP_MATH_H
#include <stdint.h>
int32_t op_divide(int32_t dividend, int32_t divisor);
int32_t op_modulo(int32_t dividend, int32_t divisor);
int32_t op_exponent(int32_t base, uint32_t power);
int32_t op_shift_left(int32_t value, int32_t amount);
int32_t op_shift_right(int32_t value, int32_t amount);
#endif /* RGBDS_OP_MATH_H */