LoginSignup
0
0

More than 5 years have passed since last update.

MSX POSITサンプル

Last updated at Posted at 2018-07-13

画面左上の座標はBASICのLOCATEは(0,0)だがPOSITは(1,1)のようだ。

posit.c
/*
z88dk / WebMSX
zcc +msx -lndos -create-app posit.c
bload"cas:",r
*/

#include <stdio.h>

int cls()
{
#asm
        xor     a
        call    $00c3           ; CLS
#endasm
}

int posit(int xy)
{
#asm
        call    $00c6           ; POSIT
#endasm
}

int posit2(char x, char y)
{
#asm
        ld      ix, 0
        add     ix, sp
        ld      l, (ix+2)       ; y
        ld      h, (ix+4)       ; x
        call    $00c6           ; POSIT
#endasm
}

#define locate(x,y) posit((((x)+1)<<8)|((y)+1))

void main()
{
        cls();
        locate(1, 0);
        puts("locate");
        posit(0x0403);
        puts("posit");
        posit2(6, 5);
        puts("posit2");
}

WMSX Screen.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0