2424
2525#include "pico/stdlib.h"
2626#include "pico/multicore.h"
27+ #include "pico/binary_info.h"
2728
2829#include "hardware/pio.h"
2930#include "hardware/clocks.h"
104105#define TMS_PIO pio1
105106#define TMS_IRQ PIO1_IRQ_0
106107
107-
108+ bi_decl (bi_1pin_with_name (GPIO_GROMCL , "GROM Clock" ));
109+ bi_decl (bi_1pin_with_name (GPIO_CPUCL , "CPU Clock" ));
110+ bi_decl (bi_pin_mask_with_names (GPIO_CD_MASK , "CPU Data (CD7 - CD0)" ));
111+ bi_decl (bi_1pin_with_name (GPIO_CSR , "Read" ));
112+ bi_decl (bi_1pin_with_name (GPIO_CSW , "Write" ));
113+ bi_decl (bi_1pin_with_name (GPIO_MODE , "Mode" ));
114+ bi_decl (bi_1pin_with_name (GPIO_INT , "Interrupt" ));
108115
109116
110117/* file globals */
@@ -299,9 +306,9 @@ static void __time_critical_func(tmsScanline)(uint16_t y, VgaParams* params, uin
299306 pixels [x ] = bg ;
300307 }
301308
302- /* convert from palette to bgr12 */
309+ /* convert from palette to bgr12 */
303310 int tmsX = 0 ;
304- if (tmsScanlineBuffer [ 0 ] & 0xf0 )
311+ if (tms9918 -> mode == TMS_MODE_TEXT80 )
305312 {
306313 for (int x = hBorder ; x < hBorder + TMS9918_PIXELS_X * 2 ; x += 2 , ++ tmsX )
307314 {
@@ -368,7 +375,7 @@ void tmsPioInit()
368375 pio_sm_config writeConfig = tmsWrite_program_get_default_config (tmsWriteProgram );
369376 sm_config_set_in_pins (& writeConfig , GPIO_CD7 );
370377 sm_config_set_in_shift (& writeConfig , false, true, 16 ); // L shift, autopush @ 16 bits
371- sm_config_set_clkdiv (& writeConfig , 4 .0f );
378+ sm_config_set_clkdiv (& writeConfig , 1 .0f );
372379
373380 pio_sm_init (TMS_PIO , tmsWriteSm , tmsWriteProgram , & writeConfig );
374381 pio_sm_set_enabled (TMS_PIO , tmsWriteSm , true);
@@ -387,7 +394,7 @@ void tmsPioInit()
387394 sm_config_set_out_pins (& readConfig , GPIO_CD7 , 8 );
388395 sm_config_set_in_shift (& readConfig , false, false, 32 ); // L shift
389396 sm_config_set_out_shift (& readConfig , true, false, 32 ); // R shift
390- sm_config_set_clkdiv (& readConfig , 4 .0f );
397+ sm_config_set_clkdiv (& readConfig , 1 .0f );
391398
392399 pio_sm_init (TMS_PIO , tmsReadSm , tmsReadProgram , & readConfig );
393400 pio_sm_set_enabled (TMS_PIO , tmsReadSm , true);
0 commit comments