@@ -71,7 +71,7 @@ void play_adlib(void);
7171extern " C" int OPL_Pico_Init (unsigned int );
7272extern " C" unsigned int OPL_Pico_PortRead (opl_port_t );
7373#include " cmd_buffers.h"
74- cms_buffer_t opl_buffer = { {0 }, 0 , 0 };
74+ cms_buffer_t opl_cmd_buffer = { {0 }, 0 , 0 };
7575#endif
7676
7777#ifdef CDROM
@@ -664,13 +664,13 @@ __force_inline void handle_iow(void) {
664664 // Fast write
665665 pio_sm_put (pio0, IOW_PIO_SM, IO_END);
666666 // pio_sm_put(pio0, IOW_PIO_SM, IO_WAIT);
667- opl_buffer .cmds [opl_buffer .head ].addr = (uint16_t )(iow_read & 0xFF );
667+ opl_cmd_buffer .cmds [opl_cmd_buffer .head ].addr = (uint16_t )(iow_read & 0xFF );
668668 // Fast write - return early as we've already written 0x0u to the PIO
669669 return ;
670670 break ;
671671 case 0x9 :
672672 pio_sm_put (pio0, IOW_PIO_SM, IO_WAIT);
673- opl_buffer .cmds [opl_buffer .head ++].data = (uint8_t )(iow_read & 0xFF );
673+ opl_cmd_buffer .cmds [opl_cmd_buffer .head ++].data = (uint8_t )(iow_read & 0xFF );
674674 break ;
675675 // DSP ports
676676 default :
@@ -694,15 +694,15 @@ __force_inline void handle_iow(void) {
694694 if ((port & 1 ) == 0 ) {
695695 // Fast write
696696 pio_sm_put (pio0, IOW_PIO_SM, IO_END);
697- opl_buffer .cmds [opl_buffer .head ].addr = (uint16_t )(iow_read & 0xFF );
697+ opl_cmd_buffer .cmds [opl_cmd_buffer .head ].addr = (uint16_t )(iow_read & 0xFF );
698698 // Fast write - return early as we've already written 0x0u to the PIO
699699 return ;
700700 } else {
701701 pio_sm_put (pio0, IOW_PIO_SM, IO_WAIT);
702702 if (settings.SB .oplSpeedSensitive ) {
703703 busy_wait_us (1 ); // busy wait for speed sensitive games
704704 }
705- opl_buffer .cmds [opl_buffer .head ++].data = (uint8_t )(iow_read & 0xFF );
705+ opl_cmd_buffer .cmds [opl_cmd_buffer .head ++].data = (uint8_t )(iow_read & 0xFF );
706706 }
707707 } else // if follows down below
708708#endif // SOUND_OPL
@@ -841,7 +841,7 @@ __force_inline void handle_ior(void) {
841841 switch (port - settings.SB .basePort ) {
842842 case 0x8 :
843843 // wait for OPL buffer to process
844- while (opl_buffer .tail != opl_buffer .head ) {
844+ while (opl_cmd_buffer .tail != opl_cmd_buffer .head ) {
845845 tight_loop_contents ();
846846 }
847847 pio_sm_put (pio0, IOR_PIO_SM, IOR_SET_VALUE | OPL_Pico_PortRead (OPL_REGISTER_PORT));
@@ -867,7 +867,7 @@ __force_inline void handle_ior(void) {
867867 // Tell PIO to wait for data
868868 pio_sm_put (pio0, IOR_PIO_SM, IO_WAIT);
869869 // wait for OPL buffer to process
870- while (opl_buffer .tail != opl_buffer .head ) {
870+ while (opl_cmd_buffer .tail != opl_cmd_buffer .head ) {
871871 tight_loop_contents ();
872872 }
873873 pio_sm_put (pio0, IOR_PIO_SM, IOR_SET_VALUE | OPL_Pico_PortRead (OPL_REGISTER_PORT));
@@ -988,6 +988,7 @@ __force_inline bool ior_has_data() {
988988#include " hardware/structs/xip_ctrl.h"
989989int main ()
990990{
991+ busy_wait_ms (250 );
991992#ifdef ASYNC_UART
992993 stdio_async_uart_init_full (UART_ID, BAUD_RATE, UART_TX_PIN, UART_RX_PIN);
993994#else
@@ -1041,31 +1042,6 @@ int main()
10411042 BOARD_TYPE = PICOGUS_2;
10421043 }
10431044 gpio_set_mask (LED_PIN);
1044- printf (" Waiting for board to stabilize... " );
1045- busy_wait_ms (250 );
1046- // Overclock!
1047- printf (" Overclocking... " );
1048- vreg_set_voltage (VREG_VOLTAGE_1_25);
1049- // vreg_set_voltage(VREG_VOLTAGE_1_15);
1050- busy_wait_ms (250 );
1051- set_sys_clock_khz (rp2_clock, true );
1052- busy_wait_ms (250 );
1053- gpio_xor_mask (LED_PIN);
1054- #ifdef ASYNC_UART
1055- uart_init (UART_ID, 0 );
1056- #else
1057- stdio_init_all ();
1058- #endif
1059- puts (" Done. Continuing!" );
1060-
1061- // Set clk_peri to use the XOSC
1062- // clock_configure(clk_peri,
1063- // 0,
1064- // CLOCKS_CLK_PERI_CTRL_AUXSRC_VALUE_XOSC_CLKSRC,
1065- // 12 * MHZ,
1066- // 12 * MHZ);
1067- // clock_configure(clk_peri, 0, CLOCKS_CLK_PERI_CTRL_AUXSRC_VALUE_CLK_SYS,
1068- // 12 * MHZ, 12 * MHZ);
10691045
10701046 if (BOARD_TYPE == PICOGUS_2) {
10711047 // Create new interface to M62429 digital volume control
0 commit comments