Skip to content

Commit

Permalink
import xnp2-20120302
Browse files Browse the repository at this point in the history
  • Loading branch information
nonakap committed Jun 16, 2012
1 parent dc795a8 commit 7ec90b6
Show file tree
Hide file tree
Showing 240 changed files with 16,576 additions and 8,439 deletions.
10 changes: 5 additions & 5 deletions bios/bios0c.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void bios0x0c(void) {
UINT16 dseg;
REG8 flag;
UINT8 data;
UINT8 stat;
UINT8 status;
REG16 pos;
REG16 cnt;

Expand All @@ -22,11 +22,11 @@ void bios0x0c(void) {

flag = MEMR_READ8(dseg, doff + R_FLAG);
data = iocore_inp8(0x30); // データ引き取り
stat = iocore_inp8(0x32) & 0xfc; // ステータス
stat |= (iocore_inp8(0x33) & 3);
status = iocore_inp8(0x32) & 0xfc; // ステータス
status |= (iocore_inp8(0x33) & 3);

#if 0
if (stat & 0x38) {
if (status & 0x38) {
iocore_out8(0x32, flag | 0x10);
}
#endif
Expand Down Expand Up @@ -62,7 +62,7 @@ void bios0x0c(void) {
}
// データ投棄
pos = MEMR_READ16(dseg, doff + R_PUTP);
MEMR_WRITE16(dseg, pos, (UINT16)((data << 8) | stat));
MEMR_WRITE16(dseg, pos, (UINT16)((data << 8) | status));

// 次のポインタをストア
pos = (UINT16)(pos + 2);
Expand Down
16 changes: 8 additions & 8 deletions bios/bios12.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

void bios0x12(void) {

UINT8 stat;
UINT8 status;
UINT8 result;
UINT8 *p;
UINT8 drv;
Expand All @@ -22,16 +22,16 @@ void bios0x12(void) {
iocore_out8(0x00, 0x20);
}

stat = iocore_inp8(baseport);
status = iocore_inp8(baseport);
while(1) {
if (!(stat & FDCSTAT_CB)) {
if ((stat & (FDCSTAT_RQM | FDCSTAT_DIO)) != FDCSTAT_RQM) {
if (!(status & FDCSTAT_CB)) {
if ((status & (FDCSTAT_RQM | FDCSTAT_DIO)) != FDCSTAT_RQM) {
break;
}
iocore_out8(baseport+2, 0x08);
stat = iocore_inp8(baseport);
status = iocore_inp8(baseport);
}
if ((stat & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
if ((status & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
!= (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB)) {
break;
}
Expand All @@ -52,8 +52,8 @@ void bios0x12(void) {
}
while(1) {
*p++ = result;
stat = iocore_inp8(baseport);
if ((stat & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
status = iocore_inp8(baseport);
if ((status & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
!= (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB)) {
break;
}
Expand Down
16 changes: 8 additions & 8 deletions bios/bios13.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

void bios0x13(void) {

UINT8 stat;
UINT8 status;
UINT8 result;
UINT8 *p;
UINT8 drv;
Expand All @@ -22,16 +22,16 @@ void bios0x13(void) {
iocore_out8(0x00, 0x20);
}

stat = iocore_inp8(baseport);
status = iocore_inp8(baseport);
while(1) {
if (!(stat & FDCSTAT_CB)) {
if ((stat & (FDCSTAT_RQM | FDCSTAT_DIO)) != FDCSTAT_RQM) {
if (!(status & FDCSTAT_CB)) {
if ((status & (FDCSTAT_RQM | FDCSTAT_DIO)) != FDCSTAT_RQM) {
break;
}
iocore_out8(baseport+2, 0x08);
stat = iocore_inp8(baseport);
status = iocore_inp8(baseport);
}
if ((stat & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
if ((status & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
!= (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB)) {
break;
}
Expand All @@ -52,8 +52,8 @@ void bios0x13(void) {
p = mem + MEMX_DISK_RESULT + (drv * 8);
while(1) {
*p++ = result;
stat = iocore_inp8(baseport);
if ((stat & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
status = iocore_inp8(baseport);
if ((status & (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB))
!= (FDCSTAT_RQM | FDCSTAT_DIO | FDCSTAT_CB)) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion bios/bios18.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ void bios0x18(void) {
} tmp;
int i;

#if 1
#if 0
TRACEOUT(("int18 AX=%.4x %.4x:%.4x", CPU_AX,
MEMR_READ16(CPU_SS, CPU_SP+2),
MEMR_READ16(CPU_SS, CPU_SP)));
Expand Down
2 changes: 1 addition & 1 deletion bios/bios1b.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static void b0patch(void) {
cnt = 0;
last = 0;
while(size--) {
c = MEMR_READ8(ES_BASE, addr++);
c = MEMR_READ8(CPU_ES, addr++);
cl = 0;
do {
REG8 now = c & 0x80;
Expand Down
1 change: 1 addition & 0 deletions bios/bios1f.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static REG8 bios0x1f_90(void) {
l = min(l, srclimit - srcaddr);
l = min(l, dstlimit - dstaddr);
if (!l) {
CPU_A20EN(FALSE);
goto p90_err2;
}
MEML_READS(srcbase + srcaddr, work, l);
Expand Down
14 changes: 7 additions & 7 deletions cbus/board14.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@

UINT board14_pitcount(void) {

SINT32 clock;
SINT32 clk;

clock = nevent_getremain(NEVENT_MUSICGEN);
if (clock >= 0) {
clock /= pccore.multiple;
clock /= 8;
clk = nevent_getremain(NEVENT_MUSICGEN);
if (clk >= 0) {
clk /= pccore.multiple;
clk /= 8;
if (!(pccore.cpumode & CPUMODE_8MHZ)) {
clock = clock * 13 / 16;
clk = clk * 13 / 16;
}
return(clock);
return(clk);
}
return(0);
}
Expand Down
4 changes: 0 additions & 4 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,3 @@ enum {
#define FASTCALL
#endif

#if !defined(GCC_ATTR_REGPARM)
#define GCC_ATTR_REGPARM
#endif

4 changes: 2 additions & 2 deletions fdd/fdd_mtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ void fddmtr_initialize(void) {
FillMemory(fddmtr.head, sizeof(fddmtr.head), 42);
}

void fddmtr_callback(UINT time) {
void fddmtr_callback(UINT nowtime) {

if ((fddmtr.curevent) && (time >= fddmtr.nextevent)) {
if ((fddmtr.curevent) && (nowtime >= fddmtr.nextevent)) {
fddmtr_event();
}
}
Expand Down
16 changes: 8 additions & 8 deletions fdd/sxsicd.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static BRESULT opencue(SXSIDEV sxsi, const OEMCHAR *fname) {

_CDTRK trk[99];
OEMCHAR path[MAX_PATH];
UINT index;
UINT idx;
UINT8 curtrk;
UINT curtype;
TEXTFILEH tfh;
Expand All @@ -308,7 +308,7 @@ static BRESULT opencue(SXSIDEV sxsi, const OEMCHAR *fname) {

ZeroMemory(trk, sizeof(trk));
path[0] = '\0';
index = 0;
idx = 0;
curtrk = 1;
curtype = 0x14;
tfh = textfile_open(fname, 0x800);
Expand All @@ -332,16 +332,16 @@ static BRESULT opencue(SXSIDEV sxsi, const OEMCHAR *fname) {
}
}
else if ((argc >= 3) && (!milstr_cmp(argv[0], str_index))) {
if (index < NELEMENTS(trk)) {
trk[index].type = curtype;
trk[index].track = curtrk;
trk[index].pos = getpos(argv[2]);
index++;
if (idx < NELEMENTS(trk)) {
trk[idx].type = curtype;
trk[idx].track = curtrk;
trk[idx].pos = getpos(argv[2]);
idx++;
}
}
}
textfile_close(tfh);
return(openimg(sxsi, path, trk, index));
return(openimg(sxsi, path, trk, idx));
}

BRESULT sxsicd_open(SXSIDEV sxsi, const OEMCHAR *fname) {
Expand Down
42 changes: 38 additions & 4 deletions font/font.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @file font.c
* @brief CGROM and font loader
*
* @author $Author: yui $
* @date $Date: 2011/02/23 10:11:44 $
*/

#include "compiler.h"
#include "strres.h"
#include "dosio.h"
Expand All @@ -6,23 +14,33 @@
#include "fontdata.h"
#include "fontmake.h"


#ifndef FONTMEMORYBIND
UINT8 __font[0x84000];
#endif

static const OEMCHAR fonttmpname[] = OEMTEXT("font.tmp");


/**
* Initializes CGROM
*/
void font_initialize(void) {

ZeroMemory(fontrom, sizeof(fontrom));
font_setchargraph(FALSE);
}

/**
* Builds charactor graphics
* @param[in] epson If this parameter is FALSE, patched NEC charactor
*/
void font_setchargraph(BOOL epson) {

UINT8 *p;
UINT8 *q;
UINT i;
UINT j;
UINT32 dbit;

ZeroMemory(fontrom, sizeof(fontrom));
p = fontrom + 0x81000;
q = fontrom + 0x82000;
for (i=0; i<256; i++) {
Expand All @@ -41,8 +59,18 @@ void font_initialize(void) {
q += 2;
}
}

if (!epson) {
*(UINT16 *)(fontrom + 0x81000 + (0xf2 * 16)) = 0;
fontrom[0x82000 + (0xf2 * 8)] = 0;
}
}

/**
* Retrieves the font type of the specified file.
* @param[in] fname The name of the font file
* @return font type
*/
static UINT8 fonttypecheck(const OEMCHAR *fname) {

const OEMCHAR *p;
Expand Down Expand Up @@ -75,6 +103,13 @@ const OEMCHAR *p;
return(FONTTYPE_NONE);
}

/**
* Loads font files
* @param[in] filename The name of the font file
* @param[in] force If this parameter is TRUE, load file always
* If this parameter is FALSE, load when font is not ready
* @return font type
*/
UINT8 font_load(const OEMCHAR *filename, BOOL force) {

UINT i;
Expand Down Expand Up @@ -154,4 +189,3 @@ const UINT8 *p;
}
return(type);
}

9 changes: 8 additions & 1 deletion font/font.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/**
* @file font.h
* @brief CGROM and font loader
*
* @author $Author: yui $
* @date $Date: 2011/02/23 10:11:44 $
*/

#define FONTMEMORYBIND // 520KB‚­‚ç‚¢ƒƒ‚ƒŠíœ(‚§‚¡


#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -14,6 +20,7 @@ extern UINT8 __font[0x84000];
#endif

void font_initialize(void);
void font_setchargraph(BOOL epson);
UINT8 font_load(const OEMCHAR *filename, BOOL force);

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions generic/hostdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,12 +1259,12 @@ void hostdrv_reset(void) {
void hostdrv_mount(const void *arg1, long arg2) {

if ((np2cfg.hdrvroot[0] == '\0') || (hostdrv.stat.is_mount)) {
np2sysp_outstr("ng", 0);
np2sysp_outstr(OEMTEXT("ng"), 0);
return;
}
hostdrv.stat.is_mount = TRUE;
fetch_if4dos();
np2sysp_outstr("ok", 0);
np2sysp_outstr(OEMTEXT("ok"), 0);
(void)arg1;
(void)arg2;
}
Expand Down
4 changes: 2 additions & 2 deletions generic/hostdrvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ static BOOL hddseadir(void *vpItem, void *vpArg) {
return(FALSE);
}

LISTARRAY hostdrvs_getpathlist(const OEMCHAR *realpath) {
LISTARRAY hostdrvs_getpathlist(const OEMCHAR *path) {

FLISTH flh;
FLINFO fli;
LISTARRAY ret;
char fcbname[11];
HDRVLST hdd;

flh = file_list1st(realpath, &fli);
flh = file_list1st(path, &fli);
if (flh == FLISTH_INVALID) {
goto hdgpl_err1;
}
Expand Down
2 changes: 2 additions & 0 deletions generic/keydisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ static void setfmhdl(UINT8 items, UINT base) {
}
}

#if defined(SUPPORT_PX)
static void setfmhdlex(const OPN_T *pOpn, UINT nItems, UINT nBase) {

while(nItems--) {
Expand All @@ -552,6 +553,7 @@ static void setfmhdlex(const OPN_T *pOpn, UINT nItems, UINT nBase) {
}
}
}
#endif // defined(SUPPORT_PX)

static void setpsghdl(UINT8 items) {

Expand Down
Loading

0 comments on commit 7ec90b6

Please sign in to comment.