Start Implenting the YMF262 HAL layer
This commit is contained in:
parent
49fd6664cc
commit
92b9f02577
|
|
@ -29,7 +29,10 @@ project(${CMAKE_PROJECT_NAME})
|
||||||
message("Build type: " ${CMAKE_BUILD_TYPE})
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
||||||
|
|
||||||
# Enable CMake support for ASM and C languages
|
# Enable CMake support for ASM and C languages
|
||||||
enable_language(C ASM)
|
enable_language(C CXX ASM)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
# Create an executable object type
|
# Create an executable object type
|
||||||
add_executable(${CMAKE_PROJECT_NAME})
|
add_executable(${CMAKE_PROJECT_NAME})
|
||||||
|
|
@ -45,7 +48,7 @@ target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
# Add sources to executable
|
# Add sources to executable
|
||||||
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
# Add user sources here
|
# Add user sources here
|
||||||
"Lib/YMF262-HAL/Src/YMF262-HAL.c"
|
"Lib/YMF262-HAL/Src/YMF262-HAL.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add include paths
|
# Add include paths
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#ifndef YMF262_HAL
|
#ifndef YMF262_HAL
|
||||||
#define YMF262_HAL
|
#define YMF262_HAL
|
||||||
|
|
||||||
|
class YMF262_HAL;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
#include "YMF262-HAL.h"
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
#include "YMF262-HAL.hpp"
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
class YMF262_HAL{
|
||||||
|
private:
|
||||||
|
uint_32_t _t_icw_ticks;
|
||||||
|
uint_32_t _t_as_ticks;
|
||||||
|
uint_32_t _t_ah_ticks;
|
||||||
|
uint_32_t _t_csw_ticks;
|
||||||
|
uint_32_t _t_csr_ticks;
|
||||||
|
uint_32_t _t_ww_ticks;
|
||||||
|
uint_32_t _t_wds_ticks;
|
||||||
|
uint_32_t _t_wdh_ticks;
|
||||||
|
uint_32_t _t_rw_ticks;
|
||||||
|
uint_32_t _t_acc_ticks;
|
||||||
|
uint_32_t _t_rdh__ticks;
|
||||||
|
uint_32_t _t_recovery_ticks;
|
||||||
|
|
||||||
|
YMF262_HAL(uint_32_t opl_clock, uint_32_t cpu_clock){
|
||||||
|
_t_icw_ticks = (400 * cpu_clock) / opl_clock;
|
||||||
|
_t_recovery_ticks = (32 * cpu_clock) / opl_clock;
|
||||||
|
double ticks_per_ns = (double)cpu_clock / 1.0e9;
|
||||||
|
_t_as_ticks = (uint32_t)(10 * ticks_per_ns);
|
||||||
|
_t_ah_ticks = (uint32_t)(10 * ticks_per_ns);
|
||||||
|
_t_csw_ticks = (uint32_t)(100 * ticks_per_ns);
|
||||||
|
_t_ww_ticks = (uint32_t)(100 * ticks_per_ns);
|
||||||
|
_t_wds_ticks = (uint32_t)(10 * ticks_per_ns);
|
||||||
|
_t_wdh_ticks = (uint32_t)(20 * ticks_per_ns);
|
||||||
|
_t_csr_ticks = (uint32_t)(150 * ticks_per_ns);
|
||||||
|
_t_rw_ticks = (uint32_t)(150 * ticks_per_ns);
|
||||||
|
_t_acc_ticks = (uint32_t)(150 * ticks_per_ns);
|
||||||
|
_t_rdh__ticks = (uint32_t)(10 * ticks_per_ns);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue