mame/src/lib/util/coreutil.h
Miodrag Milanovic ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00

45 lines
1.2 KiB
C

// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
coreutil.h
Miscellaneous utility code
***************************************************************************/
#pragma once
#ifndef __COREUTIL_H__
#define __COREUTIL_H__
#include "osdcomm.h"
/***************************************************************************
BINARY CODED DECIMAL HELPERS
***************************************************************************/
int bcd_adjust(int value);
uint32_t dec_2_bcd(uint32_t a);
uint32_t bcd_2_dec(uint32_t a);
/***************************************************************************
GREGORIAN CALENDAR HELPERS
***************************************************************************/
int gregorian_is_leap_year(int year);
int gregorian_days_in_month(int month, int year);
/***************************************************************************
MISC
***************************************************************************/
void rand_memory(void *memory, size_t length);
uint32_t core_crc32(uint32_t crc, const uint8_t *buf, uint32_t len);
#endif /* __COREUTIL_H__ */