From 41db613f060357d1317d9b99211ca283602527d0 Mon Sep 17 00:00:00 2001 From: nino-porcino Date: Fri, 17 Dec 2021 09:12:39 +0100 Subject: [PATCH] fix screen2_puts() parameter order --- README.md | 2 +- demo/demo_amiga_hand.h | 8 ++++---- demo/demo_screen2.h | 8 ++++---- lib/tms_screen2.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6799b53..d4880eb 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ byte col = FB_BG(COLOR_DARK_RED,COLOR_LIGH_YELLOW); screen2_putc('A', 31, 23, col); // writes a string -screen2_puts(16, 12, col, "HELLO"); +screen2_puts("HELLO", 16, 12, col); // note: screen2_putc() and screen2_puts() are fast but they // can only print characters aligned within the 8x8 grid diff --git a/demo/demo_amiga_hand.h b/demo/demo_amiga_hand.h index 83f43e4..ce75025 100644 --- a/demo/demo_amiga_hand.h +++ b/demo/demo_amiga_hand.h @@ -158,12 +158,12 @@ void demo_amiga_hand() { tms_init_regs(SCREEN2_TABLE); screen2_init_bitmap(FG_BG(COLOR_BLACK,COLOR_WHITE)); - screen2_puts(0, 0, FG_BG(COLOR_BLACK,COLOR_WHITE), "*** P-LAB VIDEO CARD SYSTEM ***"); - screen2_puts(0, 2, FG_BG(COLOR_BLACK,COLOR_WHITE), "16K VRAM BYTES FREE"); - screen2_puts(0, 4, FG_BG(COLOR_BLACK,COLOR_WHITE), "READY."); + screen2_puts("*** P-LAB VIDEO CARD SYSTEM ***", 0, 0, FG_BG(COLOR_BLACK,COLOR_WHITE)); + screen2_puts("16K VRAM BYTES FREE" , 0, 2, FG_BG(COLOR_BLACK,COLOR_WHITE)); + screen2_puts("READY." , 0, 4, FG_BG(COLOR_BLACK,COLOR_WHITE)); for(word p=0;p<612;p+=4) { screen2_line(amiga_data[p],amiga_data[p+1],amiga_data[p+2],amiga_data[p+3]); } - screen2_puts(18, 12, FG_BG(COLOR_DARK_BLUE, COLOR_WHITE), "APPLE1"); + screen2_puts("APPLE1", 18, 12, FG_BG(COLOR_DARK_BLUE, COLOR_WHITE)); } diff --git a/demo/demo_screen2.h b/demo/demo_screen2.h index 194a8a0..b5aec3b 100644 --- a/demo/demo_screen2.h +++ b/demo/demo_screen2.h @@ -4,13 +4,13 @@ void demo_screen2() { byte text_color = FG_BG(COLOR_BLACK,COLOR_WHITE); screen2_init_bitmap(text_color); - screen2_puts(0, 0, text_color, "*** P-LAB VIDEO CARD SYSTEM ***"); - screen2_puts(0, 2, text_color, "16K VRAM BYTES FREE"); - screen2_puts(0, 4, text_color, "READY."); + screen2_puts("*** P-LAB VIDEO CARD SYSTEM ***", 0, 0, text_color); + screen2_puts("16K VRAM BYTES FREE" , 0, 2, text_color); + screen2_puts("READY." , 0, 4, text_color); // display all colors in the palette for(byte i=0;i<16;i++) { - screen2_puts(5,(byte)(6+i),(byte)(((15-i)<<4)+i)," SCREEN 2 "); + screen2_puts(" SCREEN 2 ",5,(byte)(6+i),(byte)(((15-i)<<4)+i)); } screen2_line(18, 45,232,187); diff --git a/lib/tms_screen2.h b/lib/tms_screen2.h index 0d0d417..c48fc08 100644 --- a/lib/tms_screen2.h +++ b/lib/tms_screen2.h @@ -48,7 +48,7 @@ void screen2_putc(byte ch, byte x, byte y, byte col) { tms_set_vram_write_addr(TMS_COLOR_TABLE + addr); for(byte i=0;i<8;i++) TMS_WRITE_DATA_PORT(col); } -void screen2_puts(byte x, byte y, byte col, char *s) { +void screen2_puts(char *s, byte x, byte y, byte col) { byte c; while(c=*s++) { screen2_putc(c, x++, y, col);