|
|
| version 1.2, 2003/10/21 11:22:05 | version 1.6, 2005/02/09 20:11:36 |
|---|---|
| Line 13 | Line 13 |
| typedef struct { | typedef struct { |
| const char *str; | const OEMCHAR *str; |
| UINT16 reg; | UINT16 reg; |
| UINT16 mask; | UINT16 mask; |
| } FMSNDTBL; | } FMSNDTBL; |
| static FMSNDTBL fmsndtbl[] = { | static const FMSNDTBL fmsndtbl[] = { |
| {"Sound-Board I", 0, 0}, | {OEMTEXT("Sound-Board I"), 0, 0}, |
| {NULL, 0x0000, 0xffff}, | {NULL, 0x0000, 0xffff}, |
| {NULL, 0x0010, 0x3f07}, | {NULL, 0x0010, 0x3f07}, |
| {NULL, 0x0020, 0x07e6}, | {NULL, 0x0020, 0x07e6}, |
| Line 45 static FMSNDTBL fmsndtbl[] = { | Line 45 static FMSNDTBL fmsndtbl[] = { |
| {NULL, 0x01a0, 0x7777}, | {NULL, 0x01a0, 0x7777}, |
| {NULL, 0x01b0, 0x0077}, | {NULL, 0x01b0, 0x0077}, |
| {str_null, 0, 0}, | {str_null, 0, 0}, |
| {"Sound-Board II", 0, 0}, | {OEMTEXT("Sound-Board II"), 0, 0}, |
| {NULL, 0x0200, 0xffff}, | {NULL, 0x0200, 0xffff}, |
| {NULL, 0x0220, 0x07e6}, | {NULL, 0x0220, 0x07e6}, |
| {NULL, 0x0230, 0x7777}, | {NULL, 0x0230, 0x7777}, |
| Line 69 static FMSNDTBL fmsndtbl[] = { | Line 69 static FMSNDTBL fmsndtbl[] = { |
| {NULL, 0x02b0, 0x0077}}; | {NULL, 0x02b0, 0x0077}}; |
| static void viewsnd_paint(NP2VIEW_T *view, RECT *rc, HDC hdc) { | static void viewsnd_paint(NP2VIEW_T *view, RECT *rc, HDC hdc) { |
| int x; | int x; |
| LONG y; | LONG y; |
| DWORD pos; | UINT pos; |
| BYTE *p; | const UINT8 *p; |
| char str[16]; | OEMCHAR str[16]; |
| HFONT hfont; | HFONT hfont; |
| DWORD reg; | UINT reg; |
| WORD mask; | UINT16 mask; |
| hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, | hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, |
| SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, | SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, |
| DEFAULT_QUALITY, FIXED_PITCH, "£Í£Ó¥´¥·¥Ã¥¯"); | DEFAULT_QUALITY, FIXED_PITCH, np2viewfont); |
| SetTextColor(hdc, 0xffffff); | SetTextColor(hdc, 0xffffff); |
| SetBkColor(hdc, 0x400000); | SetBkColor(hdc, 0x400000); |
| hfont = (HFONT)SelectObject(hdc, hfont); | hfont = (HFONT)SelectObject(hdc, hfont); |
| Line 99 static void viewsnd_paint(NP2VIEW_T *vie | Line 97 static void viewsnd_paint(NP2VIEW_T *vie |
| view->buf1.type = ALLOCTYPE_SND; | view->buf1.type = ALLOCTYPE_SND; |
| CopyMemory(view->buf1.ptr, opn.reg, 0x400); | CopyMemory(view->buf1.ptr, opn.reg, 0x400); |
| CopyMemory(view->buf1.ptr, &psg1.reg, 0x10); | 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); | viewcmn_putcaption(view); |
| } | } |
| } | } |
| pos = view->pos; | pos = view->pos; |
| for (y=0; y<rc->bottom && pos<sizeof(fmsndtbl)/sizeof(FMSNDTBL); | for (y=0; (y<rc->bottom) && (pos<NELEMENTS(fmsndtbl)); y+=16, pos++) { |
| y+=16, pos++) { | |
| if (fmsndtbl[pos].str) { | if (fmsndtbl[pos].str) { |
| TextOut(hdc, 0, y, fmsndtbl[pos].str, strlen(fmsndtbl[pos].str)); | TextOut(hdc, 0, y, fmsndtbl[pos].str, |
| OEMSTRLEN(fmsndtbl[pos].str)); | |
| } | } |
| else { | else { |
| reg = fmsndtbl[pos].reg; | reg = fmsndtbl[pos].reg; |
| mask = fmsndtbl[pos].mask; | mask = fmsndtbl[pos].mask; |
| wsprintf(str, "%04x", reg & 0x1ff); | OEMSPRINTF(str, OEMTEXT("%04x"), reg & 0x1ff); |
| TextOut(hdc, 0, y, str, 4); | TextOut(hdc, 0, y, str, 4); |
| if (view->lock) { | if (view->lock) { |
| p = (BYTE *)view->buf1.ptr; | p = (UINT8 *)view->buf1.ptr; |
| p += reg; | p += reg; |
| } | } |
| else if (reg & 0x1ff) { | else if (reg & 0x1ff) { |
| p = opn.reg + reg; | p = opn.reg + reg; |
| } | } |
| else if (reg & 0x200) { | else if (reg & 0x200) { |
| p = (BYTE *)&psg2.reg; | p = (UINT8 *)&psg2.reg; |
| } | } |
| else { | else { |
| p = (BYTE *)&psg1.reg; | p = (UINT8 *)&psg1.reg; |
| } | } |
| for (x=0; x<16; x++) { | for (x=0; x<16; x++) { |
| if (mask & 1) { | if (mask & 1) { |
| Line 176 LRESULT CALLBACK viewsnd_proc(NP2VIEW_T | Line 174 LRESULT CALLBACK viewsnd_proc(NP2VIEW_T |
| void viewsnd_init(NP2VIEW_T *dst, NP2VIEW_T *src) { | void viewsnd_init(NP2VIEW_T *dst, NP2VIEW_T *src) { |
| dst->type = VIEWMODE_SND; | dst->type = VIEWMODE_SND; |
| dst->maxline = sizeof(fmsndtbl)/sizeof(FMSNDTBL); | dst->maxline = NELEMENTS(fmsndtbl); |
| dst->mul = 1; | dst->mul = 1; |
| dst->pos = 0; | dst->pos = 0; |
| } | } |