LoginSignup
2
0

More than 5 years have passed since last update.

MSX screen8サンプル

Last updated at Posted at 2018-07-18

参考
3章 MSX2の画面モード - テクハンwiki
Appendix A.1 BIOS 一覧 - テクハンwiki

pset.c
/*
z88dk / WebMSX
zcc +msx -lndos -create-app -bnpset pset.c
*/

int gttrig(char num)
{
#asm
    ld  a, l        ; num
    call    $00d8       ; GTTRIG
    ld  l, a
    ld  h, 0
#endasm
}

void nwrvrm(int addr, char data)
{
#asm
    ld  ix, 0
    add ix, sp
    ld  a, (ix+2)   ; data
    ld  l, (ix+4)   ; addr
    ld  h, (ix+5)
    call    $0177       ; NWRVRM
#endasm
}

void chgmdp(char mode)
{
#asm
    ld  a, l        ; mode
    ld  ix, $01b5   ; CHGMDP
    call    $015f       ; EXTROM
#endasm
}

void main()
{
    chgmdp(8);

    int addr = 0;
    for (int y = 0; y < 212; y++) {
        for (int x = 0; x < 256; x++) {
            nwrvrm(addr++, x);
        }
    }
    while (! gttrig(0)) ;
}

WMSX Screen.png

2
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
2
0