--- np2/win9x/debuguty/viewsnd.cpp 2005/02/04 05:32:25 1.4 +++ np2/win9x/debuguty/viewsnd.cpp 2005/03/20 13:12:49 1.8 @@ -2,6 +2,7 @@ #include "strres.h" #include "resource.h" #include "np2.h" +#include "oemtext.h" #include "viewer.h" #include "viewcmn.h" #include "viewmenu.h" @@ -13,13 +14,13 @@ typedef struct { -const char *str; +const TCHAR *str; UINT16 reg; UINT16 mask; } FMSNDTBL; -static FMSNDTBL fmsndtbl[] = { - {"Sound-Board I", 0, 0}, +static const FMSNDTBL fmsndtbl[] = { + {_T("Sound-Board I"), 0, 0}, {NULL, 0x0000, 0xffff}, {NULL, 0x0010, 0x3f07}, {NULL, 0x0020, 0x07e6}, @@ -32,7 +33,7 @@ static FMSNDTBL fmsndtbl[] = { {NULL, 0x0090, 0x7777}, {NULL, 0x00a0, 0x7777}, {NULL, 0x00b0, 0x0077}, - {str_null, 0, 0}, + {tchar_null, 0, 0}, {NULL, 0x0100, 0xffff}, {NULL, 0x0110, 0x0001}, {NULL, 0x0130, 0x7777}, @@ -44,8 +45,8 @@ static FMSNDTBL fmsndtbl[] = { {NULL, 0x0190, 0x7777}, {NULL, 0x01a0, 0x7777}, {NULL, 0x01b0, 0x0077}, - {str_null, 0, 0}, - {"Sound-Board II", 0, 0}, + {tchar_null, 0, 0}, + {_T("Sound-Board II"), 0, 0}, {NULL, 0x0200, 0xffff}, {NULL, 0x0220, 0x07e6}, {NULL, 0x0230, 0x7777}, @@ -57,7 +58,7 @@ static FMSNDTBL fmsndtbl[] = { {NULL, 0x0290, 0x7777}, {NULL, 0x02a0, 0x7777}, {NULL, 0x02b0, 0x0077}, - {str_null, 0, 0}, + {tchar_null, 0, 0}, {NULL, 0x0230, 0x7777}, {NULL, 0x0240, 0x7777}, {NULL, 0x0250, 0x7777}, @@ -69,18 +70,16 @@ static FMSNDTBL fmsndtbl[] = { {NULL, 0x02b0, 0x0077}}; - - static void viewsnd_paint(NP2VIEW_T *view, RECT *rc, HDC hdc) { int x; LONG y; - DWORD pos; - BYTE *p; - char str[16]; + UINT pos; +const UINT8 *p; + TCHAR str[16]; HFONT hfont; - DWORD reg; - WORD mask; + UINT reg; + UINT16 mask; hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, @@ -99,37 +98,37 @@ static void viewsnd_paint(NP2VIEW_T *vie view->buf1.type = ALLOCTYPE_SND; CopyMemory(view->buf1.ptr, opn.reg, 0x400); CopyMemory(view->buf1.ptr, &psg1.reg, 0x10); - CopyMemory(((BYTE *)view->buf1.ptr) + 0x200, &psg2.reg, 0x10); + CopyMemory(((UINT8 *)view->buf1.ptr) + 0x200, &psg2.reg, 0x10); } viewcmn_putcaption(view); } } pos = view->pos; - for (y=0; ybottom && posbottom) && (poslock) { - p = (BYTE *)view->buf1.ptr; + p = (UINT8 *)view->buf1.ptr; p += reg; } else if (reg & 0x1ff) { p = opn.reg + reg; } else if (reg & 0x200) { - p = (BYTE *)&psg2.reg; + p = (UINT8 *)&psg2.reg; } else { - p = (BYTE *)&psg1.reg; + p = (UINT8 *)&psg1.reg; } for (x=0; x<16; x++) { if (mask & 1) { @@ -176,7 +175,7 @@ LRESULT CALLBACK viewsnd_proc(NP2VIEW_T void viewsnd_init(NP2VIEW_T *dst, NP2VIEW_T *src) { dst->type = VIEWMODE_SND; - dst->maxline = sizeof(fmsndtbl)/sizeof(FMSNDTBL); + dst->maxline = NELEMENTS(fmsndtbl); dst->mul = 1; dst->pos = 0; }