example/aica: fix aica_xm example
This commit is contained in:
parent
f72e3da6c1
commit
800e3fa254
3
base.mk
3
base.mk
@ -69,6 +69,9 @@ endef
|
||||
%.bin.o: %.bin
|
||||
$(BUILD_BINARY_O)
|
||||
|
||||
%.bin.h: %.bin
|
||||
$(BUILD_BINARY_H)
|
||||
|
||||
%.pcm.o: %.pcm
|
||||
$(BUILD_BINARY_O)
|
||||
|
||||
|
@ -8,11 +8,6 @@ extern void * _binary_start __asm("_binary_example_arm_channel_bin_start");
|
||||
extern void * _binary_size __asm("_binary_example_arm_channel_bin_size");
|
||||
|
||||
void wait()
|
||||
{
|
||||
while (ffst::aica_internal_write_buffer(system.FFST));
|
||||
}
|
||||
|
||||
void wait_read()
|
||||
{
|
||||
uint32_t ffst = system.FFST;
|
||||
while ( ffst::holly_cpu_if_block_internal_write_buffer(ffst)
|
||||
|
@ -4,15 +4,9 @@
|
||||
#include "systembus_bits.hpp"
|
||||
#include "aica/aica.hpp"
|
||||
|
||||
extern void * _binary_start __asm("_binary_example_arm_xm_bin_start");
|
||||
extern void * _binary_size __asm("_binary_example_arm_xm_bin_size");
|
||||
#include "example/arm/xm.bin.h"
|
||||
|
||||
void wait()
|
||||
{
|
||||
while (ffst::aica_internal_write_buffer(system.FFST));
|
||||
}
|
||||
|
||||
void wait_read()
|
||||
{
|
||||
uint32_t ffst = system.FFST;
|
||||
while ( ffst::holly_cpu_if_block_internal_write_buffer(ffst)
|
||||
@ -24,8 +18,9 @@ void wait_read()
|
||||
|
||||
void main()
|
||||
{
|
||||
const uint32_t * binary = reinterpret_cast<uint32_t *>(&_binary_start);
|
||||
const uint32_t binary_size = reinterpret_cast<uint32_t>(&_binary_size);
|
||||
serial::init(0);
|
||||
const uint32_t * binary = reinterpret_cast<uint32_t *>(&_binary_example_arm_xm_bin_start);
|
||||
const uint32_t binary_size = reinterpret_cast<uint32_t>(&_binary_example_arm_xm_bin_size);
|
||||
|
||||
wait(); aica_sound.common.vreg_armrst = aica::vreg_armrst::ARMRST(1);
|
||||
wait(); aica_sound.common.dmea0_mrwinh = aica::dmea0_mrwinh::MRWINH(0b0111);
|
||||
@ -41,25 +36,7 @@ void main()
|
||||
|
||||
wait(); aica_sound.common.afsel_mslc_mobuf = aica::afsel_mslc_mobuf::MSLC(0);
|
||||
serial::string("mrwinh: ");
|
||||
wait_read();
|
||||
wait();
|
||||
serial::integer<uint8_t>(aica_sound.common.MRWINH());
|
||||
while (1) {
|
||||
wait_read();
|
||||
serial::string("sgc: ");
|
||||
serial::integer<uint8_t>(aica_sound.common.SGC(), ' ');
|
||||
serial::string("; ca: ");
|
||||
serial::integer<uint8_t>(aica_sound.common.CA(), ' ');
|
||||
serial::string("; eg: ");
|
||||
serial::integer<uint8_t>(aica_sound.common.EG(), ' ');
|
||||
serial::string("; lp: ");
|
||||
serial::integer<uint8_t>(aica_sound.common.LP(), ' ');
|
||||
serial::character('\n');
|
||||
for (int i = 0; i < 10000000; i++) {
|
||||
asm volatile ("nop");
|
||||
}
|
||||
serial::integer<uint32_t>(aica_wave_memory[0], ' ');
|
||||
serial::integer<uint32_t>(aica_wave_memory[1], '\n');
|
||||
}
|
||||
|
||||
while (1);
|
||||
}
|
||||
|
15
example/arm/xm.bin.h
Normal file
15
example/arm/xm.bin.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint32_t _binary_example_arm_xm_bin_start __asm("_binary_example_arm_xm_bin_start");
|
||||
extern uint32_t _binary_example_arm_xm_bin_end __asm("_binary_example_arm_xm_bin_end");
|
||||
extern uint32_t _binary_example_arm_xm_bin_size __asm("_binary_example_arm_xm_bin_size");
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user