1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-02 12:33:07 +00:00

Tweak values and add setmakr/getmark to PLVM

This commit is contained in:
David Schmenk 2024-12-15 17:57:22 -08:00
parent 2310fba421
commit 44e4e835e5
2 changed files with 38 additions and 3 deletions

View File

@ -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

View File

@ -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);
}