diff --git a/src/dhgr.tk/utils/dhgrrgb.pla b/src/dhgr.tk/utils/dhgrrgb.pla index 5535543..6749c7c 100644 --- a/src/dhgr.tk/utils/dhgrrgb.pla +++ b/src/dhgr.tk/utils/dhgrrgb.pla @@ -62,7 +62,7 @@ var[12] ntscCycle byte[256] gamma = 0, 2, 0 // Gamma correction var brightness = 0 var contrast = 0 -var tint = 30 +var tint = 22 byte errDiv = 3 var rgbErr // Running color error array byte flags = 0 @@ -250,7 +250,7 @@ def rgbInit#0 puti(ntscChroma[i*3 + BLU]); putln next fin - // Make up for additional 1/4 chroma cycle in color match + // Make up for scaled chroma cycle color match for i = 0 to 11 ntscChroma[i] = (ntscChroma[i] * 4) / 3 next @@ -393,6 +393,7 @@ def rgbImportExport(rgbfile, dhgrfile)#0 if not (flags & RAW_INFILE) if not pnmVerifyHeader(refnum, rgbErr) fileio:close(refnum) + rgbExit return fin fin diff --git a/src/vmsrc/sysio.c b/src/vmsrc/sysio.c index 0aa474f..6d52a7a 100644 --- a/src/vmsrc/sysio.c +++ b/src/vmsrc/sysio.c @@ -364,6 +364,34 @@ void syswrite(M6502 *mpu) if (len < 0) *perr = errno; PUSH_ESTK(len); } +void sysgetmark(M6502 *mpu) +{ + int fd; + off_t pos; + + PULL_ESTK(fd); + pos = lseek(fd, 0, SEEK_CUR); + if (trace) printf("FILEIO:GETMARK %d %lld\r\n", fd, pos); + if (pos < 0) *perr = errno; + PUSH_ESTK(pos & 0xFFFF); + PUSH_ESTK(pos >> 16); +} +void syssetmark(M6502 *mpu) +{ + int fd; + unsigned int posl, posh; + off_t pos; + + PULL_ESTK(posh); + PULL_ESTK(posl); + PULL_ESTK(fd); + pos = posl | (posh << 16); + if (trace) printf("FILEIO:SETMARK %d %lld\r\n", fd, pos); + pos = lseek(fd, pos, SEEK_SET); + *perr = 0; + if (pos == -1) *perr = errno; + PUSH_ESTK(*perr); +} void syscreate(M6502 *mpu) { int fd; @@ -448,7 +476,7 @@ void export_sysio(void) { byte dci[16]; uword defaddr; - uword fileio = alloc_heap(36); + uword fileio = alloc_heap(40); uword conio = alloc_heap(26); // // CMDSYS IO functions @@ -569,4 +597,10 @@ void export_sysio(void) defaddr = add_natv(sysunimpl); // writeblock mem_6502[fileio + 34] = (byte)defaddr; mem_6502[fileio + 35] = (byte)(defaddr >> 8); + defaddr = add_natv(sysgetmark); // getmark + mem_6502[fileio + 36] = (byte)defaddr; + mem_6502[fileio + 37] = (byte)(defaddr >> 8); + defaddr = add_natv(syssetmark); // setmark + mem_6502[fileio + 38] = (byte)defaddr; + mem_6502[fileio + 39] = (byte)(defaddr >> 8); }