mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-15 23:31:46 +00:00
Fixed putint(), adde putinj(), updated fprint() in module stdiox
This commit is contained in:
parent
3796ceffd7
commit
9486a8c242
@ -25,6 +25,10 @@ void putbin();
|
||||
* Args: b - Number to print */
|
||||
void putdec();
|
||||
|
||||
/* Print Byte Zero Filled Modulo 100 *
|
||||
* Args: b - Number to print */
|
||||
void putdeh();
|
||||
|
||||
/* Print Byte as Left Justified Decimal *
|
||||
* Args: b - Number to print */
|
||||
void putdel();
|
||||
@ -33,6 +37,10 @@ void putdel();
|
||||
* Args: b - Number to print */
|
||||
void putder();
|
||||
|
||||
/* Print Byte as Zero Filled Decimal Number *
|
||||
* Args: b - Number to print */
|
||||
void putdez();
|
||||
|
||||
/* Print Destination String */
|
||||
void putdst();
|
||||
|
||||
|
@ -65,19 +65,19 @@ putln("memdst(&more);");
|
||||
memdst(&more);
|
||||
|
||||
rcmp = memcmp(2, &most);
|
||||
printf(rcmp,"memcmp(2, &most)=$%h:");
|
||||
printf(rcmp,"memcmp(2, &most)=$%x:");
|
||||
if (!rcmp) puts(&pass); else puts(&fail);
|
||||
|
||||
rcmp = memcmp(4, &most);
|
||||
printf(rcmp,"memcmp(4, &most)=$%h:");
|
||||
printf(rcmp,"memcmp(4, &most)=$%x:");
|
||||
if (rcmp :-) putln(&pass); else putln(&fail);
|
||||
|
||||
rcmp = memcmp(4, &more);
|
||||
printf("memcmp(4, &more)=$%h:");
|
||||
printf("memcmp(4, &more)=$%x:");
|
||||
if (!rcmp) puts(&pass); else puts(&fail);
|
||||
|
||||
rcmp = memcmp(4, &less);
|
||||
printf("memcmp(4, &less)=$%h:");
|
||||
printf("memcmp(4, &less)=$%x:");
|
||||
if (rcmp > 0) putln(&pass); else putln(&fail);
|
||||
newlin();
|
||||
|
||||
|
@ -67,7 +67,7 @@ while (!meof(mp)) {
|
||||
prbyte(msb); prbyte(lsb);
|
||||
i, c = mgets(mp, &s);
|
||||
printf(i, " %r");
|
||||
printf(c, " %h: ");
|
||||
printf(c, " %x: ");
|
||||
puts(&s);
|
||||
if (c <> $0A) newlin();
|
||||
}
|
||||
@ -134,12 +134,12 @@ puts(&s); strdst(&upcase); if (strcmp(&s)) fail(); else pass();
|
||||
puts("Reading from file using mgets(): ");
|
||||
i,c = mgets(op, &s); putln(&s);
|
||||
printf(i, " Characters read: %d"); if (strlen(&locase)+1 == i) pass(); else fail();
|
||||
printf(c, " Last char read: %h"); if (c == 13) pass(); else fail();
|
||||
printf(c, " Last char read: %x"); if (c == 13) pass(); else fail();
|
||||
|
||||
puts("Reading from file using mgets(): ");
|
||||
i,c = mgets(op, &s); putln(&s);
|
||||
printf(i, " Characters read: %d"); if (strlen(&digits) == i) pass(); else fail();
|
||||
printf(c, " Last char read: %h"); if (c) fail(); else pass();
|
||||
printf(c, " Last char read: %x"); if (c) fail(); else pass();
|
||||
|
||||
puts("Checking for End of File: ");
|
||||
e = meof(op); putdec(e); if (e) pass(); else fail();
|
||||
|
121
test/testiox.c02
121
test/testiox.c02
@ -3,76 +3,151 @@
|
||||
***********************************************/
|
||||
|
||||
//Specify System Header using -H option
|
||||
#include <screen.h02>
|
||||
#include <stddef.h02>
|
||||
#include <stdlib.h02>
|
||||
#include <intlib.h02>
|
||||
#include <stdio.h02>
|
||||
#include <stdiox.h02>
|
||||
|
||||
|
||||
char i, j;
|
||||
const char s = "STRING";
|
||||
char w,nlm,akm;
|
||||
|
||||
void pause() {if (anykey() == #ESCKEY) goto exit;}
|
||||
|
||||
main:
|
||||
|
||||
if (getsiz() > 40) {
|
||||
nlm = 15; akm = 255;
|
||||
} else {
|
||||
nlm = 7; akm = 127;
|
||||
}
|
||||
|
||||
getcpr("PRESS A KEY TO BEGIN");
|
||||
|
||||
i = 0;
|
||||
|
||||
putln("PRTDEC()");
|
||||
//goto doprtf;
|
||||
|
||||
putln("PUTDEC()");
|
||||
do {
|
||||
putdec(i);
|
||||
putc(':');
|
||||
i++;
|
||||
if (!i&7) newlin();
|
||||
if (!i&127) anykey();
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
putln("PRTDEL()");
|
||||
putln("PUTDEL()");
|
||||
do {
|
||||
putdel(i);
|
||||
putc(':');
|
||||
i++;
|
||||
if (!i&7) newlin();
|
||||
if (!i&127) anykey();
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
putln("PRTDER()");
|
||||
putln("PUTDER()");
|
||||
do {
|
||||
putder(i);
|
||||
putc(':');
|
||||
i++;
|
||||
if (!i&7) newlin();
|
||||
if (!i&127) anykey();
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
putln("PRTHEX()");
|
||||
putln("PUTDEZ()");
|
||||
do {
|
||||
putdez(i); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
putln("PUTDEH()");
|
||||
do {
|
||||
putdeh(i); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
|
||||
putln("PUTHEX()");
|
||||
do {
|
||||
puthex(i);
|
||||
putc(':');
|
||||
i++;
|
||||
if (!i&7) newlin();
|
||||
if (!i&127) anykey();
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
putln("PRTWRD()");
|
||||
putln("PUTNYB()");
|
||||
do {
|
||||
j = i ^ $FF;
|
||||
putwrd(?,i,j);
|
||||
putnyb(i);
|
||||
putc(':');
|
||||
i++;
|
||||
if (!i&3) newlin();
|
||||
if (!i&63) anykey();
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
tstint:
|
||||
nlm>>; akm>>;
|
||||
|
||||
putln("PUTINT()");
|
||||
do {
|
||||
if (!i&15) putln("%C %H .%R %L. %D%%");
|
||||
if (i<32) printf(i, " %h %r %l %d%%%n");
|
||||
else printf(i," %c %h %r %l %d%%%n");
|
||||
i++; if (!i&15) anykey();
|
||||
putint(.,0,i); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
do {
|
||||
j = i ^ $FF;
|
||||
putint(.,i,j); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
dopinr: putln("PUTINR()");
|
||||
do {
|
||||
putinr(.,0,i); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
do {
|
||||
j = i ^ $FF;
|
||||
putinr(.,i,j); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
putln("PUTWRD(), PUTSQB()");
|
||||
do {
|
||||
j = i ^ $FF;
|
||||
putwrd(.,i,j); putc(',');
|
||||
putsqb(.,i,j); putc(':');
|
||||
i++;
|
||||
if (!i&nlm) newlin();
|
||||
if (!i&akm) pause();
|
||||
} while (i);
|
||||
|
||||
doprtf:
|
||||
do {
|
||||
if (!i&15) putln("%C %X %Y .%R %L. %Z %h %D%%");
|
||||
if (i<32) printf(i, " %x %y %r %l %z %h %d%%%n");
|
||||
else printf(i," %c %x %y %r %l %z %h %d%%%n");
|
||||
i++; if (!i& 15) pause();
|
||||
} while (i<128);
|
||||
|
||||
putln("%W.. '%S'");
|
||||
doprts:
|
||||
putln("%W.. %Q. '%S' ...%J %I");
|
||||
setdst(&s);
|
||||
printf("%w '%s'%n");
|
||||
printf("%w %q '%s' %j %i%n");
|
||||
|
||||
done:
|
||||
goto exit;
|
||||
|
@ -184,7 +184,7 @@ void chksiz(aa,yy,xx) {
|
||||
puts("\tChecking Stack Size\t");
|
||||
puts("stksiz()\t");
|
||||
zz, dsthi, dstlo = stksiz();
|
||||
printf(zz, "Sts=$%h Size=$%w:");
|
||||
printf(zz, "Sts=$%x Size=$%w:");
|
||||
if (zz == aa and dsthi == yy and dstlo == xx ) pass();
|
||||
else {fail(); goto exit;}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ void chksiz(aa,yy,xx) {
|
||||
puts("\tChecking Stack Size\t");
|
||||
puts("stksiz()\t");
|
||||
zz, dsthi, dstlo = stksiz();
|
||||
printf(zz, "Sts=$%h Size=$%w:");
|
||||
printf(zz, "Sts=$%x Size=$%w:");
|
||||
if (zz == aa and dsthi == yy and dstlo == xx ) pass();
|
||||
else {fail(); goto exit;}
|
||||
}
|
||||
|
@ -35,9 +35,9 @@ puts("failln();"); failln();
|
||||
newlin();
|
||||
|
||||
//Test trufls()
|
||||
printf(trufls($00),"trufls($00)=$%h\n");
|
||||
printf(trufls($01),"trufls($01)=$%h\n");
|
||||
printf(trufls($FF),"trufls($FF)=$%h\n");
|
||||
printf(trufls($00),"trufls($00)=$%x\n");
|
||||
printf(trufls($01),"trufls($01)=$%x\n");
|
||||
printf(trufls($FF),"trufls($FF)=$%x\n");
|
||||
newlin();
|
||||
|
||||
//Test psorfl()
|
||||
|
@ -32,8 +32,8 @@ void passed() { putln("PASSED");}
|
||||
|
||||
void paddrs(aa) {
|
||||
if (aa) newlin(); else puts(", ");
|
||||
printf(setdst(xgetpa()),"PA=$%h%w, ");
|
||||
printf(setdst(xgetla()),"LA=$%h%w ");
|
||||
printf(setdst(xgetpa()),"PA=$%x%w, ");
|
||||
printf(setdst(xgetla()),"LA=$%x%w ");
|
||||
}
|
||||
|
||||
void perror() {
|
||||
@ -50,13 +50,13 @@ void tstlpl(sbank,spage,sbank) {
|
||||
putc('.');
|
||||
while() {
|
||||
while() {
|
||||
//printf(setdst(ibank,ipage,ibyte),"%n ORIGINAL: $%h%w");
|
||||
//printf(setdst(ibank,ipage,ibyte),"%n ORIGINAL: $%x%w");
|
||||
pbank,ppage,pbyte = xclcpa(ibank,ipage,ibyte);
|
||||
//printf(setdst()," PHYSICAL: $%h%w");
|
||||
//printf(setdst()," PHYSICAL: $%x%w");
|
||||
lbank,lpage,lbyte = xclcla(pbank,ppage,pbyte);
|
||||
//printf(setdst(),", LOGICAL: $%h%w");
|
||||
//printf(setdst(),", LOGICAL: $%x%w");
|
||||
if (lbank<>ibank or lpage<>ipage or ibyte<>lbyte)
|
||||
perror(setdst(ibank,ipage,ibyte),"%nERROR IN BANK $%h ADDRESS $%w");
|
||||
perror(setdst(ibank,ipage,ibyte),"%nERROR IN BANK $%x ADDRESS $%w");
|
||||
if (getkey()==#ESCKEY) goto exit;
|
||||
ibyte=ibyte+$10; if (!ibyte) break;
|
||||
} ipage++; if (!ipage) break;
|
||||
@ -70,12 +70,12 @@ void tstgsl(ibank,ipage,ibank) {
|
||||
putc('.');
|
||||
while() {
|
||||
while() {
|
||||
//printf(setdst(ibank,ipage,ibyte),"%n SET: $%h%w");
|
||||
//printf(setdst(ibank,ipage,ibyte),"%n SET: $%x%w");
|
||||
xsetla(ibank,ipage,ibyte);
|
||||
lbank,lpage,lbyte = xgetla();
|
||||
//printf(setdst(),", GOT: $%h%w");
|
||||
//printf(setdst(),", GOT: $%x%w");
|
||||
if (lbank<>ibank or lpage<>ipage or ibyte<>lbyte)
|
||||
perror(setdst(ibank,ipage,ibyte),"%nERROR IN BANK $%h ADDRESS $%w");
|
||||
perror(setdst(ibank,ipage,ibyte),"%nERROR IN BANK $%x ADDRESS $%w");
|
||||
if (getkey()==#ESCKEY) goto exit;
|
||||
ibyte=ibyte+$10; if (!ibyte) break;
|
||||
} ipage++; if (!ipage) break;
|
||||
@ -92,11 +92,11 @@ void tstipa(ibank,ipage,ibank) {
|
||||
//clrscr();
|
||||
while() {
|
||||
pbank,ppage,pbyte = xgetpa(ibank,ipage,ibyte);
|
||||
//printf(setdst(),"$%h%w:");
|
||||
//printf(setdst(),"$%x%w:");
|
||||
lbank,lpage,lbyte = xgetla(); //Get Logical Address
|
||||
//printf(setdst(),"$%h%w ");
|
||||
//printf(setdst(),"$%x%w ");
|
||||
if (lbank<>ibank or lpage<>ipage or ibyte<>lbyte)
|
||||
perror(setdst(ibank,ipage,ibyte),"%nERROR IN BANK $%h ADDRESS $%w");
|
||||
perror(setdst(ibank,ipage,ibyte),"%nERROR IN BANK $%x ADDRESS $%w");
|
||||
xincpa(); //Increment Physical Address
|
||||
ibyte++; if (!ibyte) break;
|
||||
} ipage++; if (!ipage) break;
|
||||
@ -108,14 +108,14 @@ void tstipa(ibank,ipage,ibank) {
|
||||
/* Test xgetc() and xputc() */
|
||||
void tstgpc(sbank,spage,sbyte) {
|
||||
while() {
|
||||
//printf(setdst(),"$%h%w");
|
||||
//printf(setdst(),"$%x%w");
|
||||
putc('.');
|
||||
ibank=sbank; ipage=spage; ibyte=sbyte;
|
||||
xsetla(ibank,ipage,ibyte);
|
||||
i=0; do { xputc(i); i++; } while (i);
|
||||
xsetla(ibank,ipage,ibyte);
|
||||
i=0; do {
|
||||
if (xgetc()<>i) perror(setdst(xgetpa()),"%nERROR IN BANK $%h ADDRESS $%w");
|
||||
if (xgetc()<>i) perror(setdst(xgetpa()),"%nERROR IN BANK $%x ADDRESS $%w");
|
||||
i++;
|
||||
} while (i);
|
||||
sbank++;spage++;sbyte++;
|
||||
@ -126,7 +126,7 @@ void tstgpc(sbank,spage,sbyte) {
|
||||
/* Test xgeti() and xputi() */
|
||||
void tstgpi(sbank,spage,sbyte) {
|
||||
while() {
|
||||
//*printf(setdst(),"$%h%w");
|
||||
//*printf(setdst(),"$%x%w");
|
||||
putc('.');
|
||||
ibank=sbank; ipage=spage; ibyte=sbyte;
|
||||
//Write 256 Integers
|
||||
@ -142,7 +142,7 @@ void tstgpi(sbank,spage,sbyte) {
|
||||
mpage=i;mbyte=i^$FF;
|
||||
intger = xgeti();
|
||||
if (<intger<>mbyte or >intger<>mpage)
|
||||
perror(setdst(xgetpa()),"%nERROR IN BANK $%h ADDRESS $%w");
|
||||
perror(setdst(xgetpa()),"%nERROR IN BANK $%x ADDRESS $%w");
|
||||
i++;
|
||||
} while (i);
|
||||
//Set Next Start Address
|
||||
@ -154,7 +154,7 @@ void tstgpi(sbank,spage,sbyte) {
|
||||
/* Test xgetl() and xputl() */
|
||||
void tstgpl(sbank,spage,sbyte) {
|
||||
while() {
|
||||
//*printf(setdst(),"$%h%w");
|
||||
//*printf(setdst(),"$%x%w");
|
||||
putc('.');
|
||||
ibank=sbank; ipage=spage; ibyte=sbyte;
|
||||
//Write 256 Integers
|
||||
@ -170,7 +170,7 @@ void tstgpl(sbank,spage,sbyte) {
|
||||
mbyte=i; mpage=i^$FF; mbank = -i;
|
||||
intger = xgeti();
|
||||
if (<intger<>mbyte or >intger<>mpage)
|
||||
perror(setdst(xgetpa()),"%nERROR IN BANK $%h ADDRESS $%w");
|
||||
perror(setdst(xgetpa()),"%nERROR IN BANK $%x ADDRESS $%w");
|
||||
i++;
|
||||
} while (i);
|
||||
//Set Next Start Address
|
||||
@ -198,12 +198,12 @@ void tstxrw(sbank,spage,epage) {
|
||||
//Read 256,1-255 bytes of Array
|
||||
ipage=spage; xsetla(ibank,0,ipage);
|
||||
do {
|
||||
//printf(ipage,"%n%h:");
|
||||
//printf(ipage,"%n%x:");
|
||||
//inline $ff;
|
||||
//paddrs(#TRUE);
|
||||
xread(ipage,&r);
|
||||
i=0; do {
|
||||
//printf(r[i],"%h."); printf(w[i],"%h,");
|
||||
//printf(r[i],"%x."); printf(w[i],"%x,");
|
||||
if (r[i]<>w[i]) perror(i,"ERROR IN INDEX %d");
|
||||
i++;
|
||||
} while(i<>ipage);
|
||||
|
@ -43,8 +43,8 @@ void prtspr() {
|
||||
printf(setdst(spattr.addr),"ADR=$%w, ");
|
||||
printf(setdst(spattr.horz),"HRZ=%i, ");
|
||||
printf(setdst(spattr.vert),"VRT=%i, ");
|
||||
printf(spattr.ctrl,"CTL=$%h, ");
|
||||
printf(spattr.size,"SIZ=$%h%n");
|
||||
printf(spattr.ctrl,"CTL=$%x, ");
|
||||
printf(spattr.size,"SIZ=$%x%n");
|
||||
}
|
||||
|
||||
main:
|
||||
|
@ -64,8 +64,8 @@ void prtspr() {
|
||||
printf(setdst(spattr.addr),"ADR=$%w, ");
|
||||
printf(setdst(spattr.horz),"HRZ=%i, ");
|
||||
printf(setdst(spattr.vert),"VRT=%i, ");
|
||||
printf(spattr.ctrl,"CTL=$%h, ");
|
||||
printf(spattr.size,"SIZ=$%h%n");
|
||||
printf(spattr.ctrl,"CTL=$%x, ");
|
||||
printf(spattr.size,"SIZ=$%x%n");
|
||||
}
|
||||
|
||||
void xerror() {
|
||||
|
@ -99,8 +99,8 @@ void prtrgb(aa,yy,xx) {
|
||||
}
|
||||
|
||||
void prtscl() {
|
||||
printf(hscale, "HSCALE=%h, ");
|
||||
printf(vscale, "VSCALE=%h%n");
|
||||
printf(hscale, "HSCALE=%x, ");
|
||||
printf(vscale, "VSCALE=%x%n");
|
||||
}
|
||||
|
||||
/*Print Sprite Attributes */
|
||||
@ -108,15 +108,15 @@ void prtspr() {
|
||||
printf(setdst(spattr.addr),"ADR=$%w, ");
|
||||
printf(setdst(spattr.horz),"HRZ=%i, ");
|
||||
printf(setdst(spattr.vert),"VRT=%i, ");
|
||||
printf(spattr.ctrl,"CTL=$%h, ");
|
||||
printf(spattr.size,"SIZ=$%h%n");
|
||||
printf(spattr.ctrl,"CTL=$%x, ");
|
||||
printf(spattr.size,"SIZ=$%x%n");
|
||||
}
|
||||
|
||||
void prttmp() {
|
||||
printf(temp0, "TEMP0=$%h%n");
|
||||
printf(temp1, "TEMP1=$%h%n");
|
||||
printf(temp2, "TEMP2=$%h%n");
|
||||
printf(temp3, "TEMP3=$%h%n");
|
||||
printf(temp0, "TEMP0=$%x%n");
|
||||
printf(temp1, "TEMP1=$%x%n");
|
||||
printf(temp2, "TEMP2=$%x%n");
|
||||
printf(temp3, "TEMP3=$%x%n");
|
||||
}
|
||||
|
||||
void prtvid() {
|
||||
@ -168,7 +168,7 @@ main:
|
||||
setbdr(i);
|
||||
index = getbdr();
|
||||
if (index<>i) xerror();
|
||||
//printf(index, "BORDER=%h%n");
|
||||
//printf(index, "BORDER=%x%n");
|
||||
i++;
|
||||
} while(i);
|
||||
passed();
|
||||
@ -187,7 +187,7 @@ main:
|
||||
|
||||
//putln("SAVING START AND STOP REGISTERS");
|
||||
setadr($1F, &$0004); getmem(5, &hrzvrt);
|
||||
//for (i=0;i<5;i++) printf(hrzvrt[i], "%h "); newlin();
|
||||
//for (i=0;i<5;i++) printf(hrzvrt[i], "%x "); newlin();
|
||||
|
||||
puts("TESTING GETHSR() AND SETHSR()");
|
||||
sethsr(&$024C);
|
||||
@ -309,18 +309,18 @@ main:
|
||||
|
||||
printf("TESTING GETMSZ() AND SETMSZ()");
|
||||
for (i=0;i<2;i++) {for (j=0;j<4;j++) {for (k=0;k<4;k++) {
|
||||
//printf(j,"%nJ=%h, "); printf(k,"K=%h");
|
||||
//printf(j,"%nJ=%x, "); printf(k,"K=%x");
|
||||
setmsz(i,j,k); w, h = getmsz(i);
|
||||
//printf(w," WIDTH=%h, "); printf(h,"HEIGHT=%h");
|
||||
//printf(w," WIDTH=%x, "); printf(h,"HEIGHT=%x");
|
||||
if (w<>j or h<>k) xerror();
|
||||
}}}
|
||||
passed();
|
||||
|
||||
printf("TESTING GETTSZ() AND SETTSZ()");
|
||||
for (i=0;i<2;i++) {for (j=0;j<2;j++) {for (k=0;k<2;k++) {
|
||||
//printf(j,"%nJ=%h, "); printf(k,"K=%h");
|
||||
//printf(j,"%nJ=%x, "); printf(k,"K=%x");
|
||||
settsz(i,j,k); w, h = gettsz(i);
|
||||
//printf(w," WIDTH=%h, "); printf(h,"HEIGHT=%h");
|
||||
//printf(w," WIDTH=%x, "); printf(h,"HEIGHT=%x");
|
||||
if (w<>j or h<>k) xerror();
|
||||
}}}
|
||||
passed();
|
||||
@ -328,12 +328,12 @@ main:
|
||||
printf("TESTING MAPSIZ() AND TILSIZ()");
|
||||
for (i=0; i<@msizel; i++) {
|
||||
msize = mapsiz(i);
|
||||
//printf(i,"%nMAP SIZE %h = "); setdst(msize); printf("$%w PIXELS");
|
||||
//printf(i,"%nMAP SIZE %x = "); setdst(msize); printf("$%w PIXELS");
|
||||
if (<msize<>msizel[i] or >msize<>msizeh[i]) xerror();
|
||||
}
|
||||
for (i=0; i<@tsizel; i++) {
|
||||
tsize = tilsiz(i);
|
||||
//printf(i,"%nTILE SIZE %h = "); printf(tsize, "$%h PIXELS");
|
||||
//printf(i,"%nTILE SIZE %x = "); printf(tsize, "$%x PIXELS");
|
||||
if (tsize<>tsizel[i]) xerror();
|
||||
}
|
||||
passed();
|
||||
@ -445,7 +445,7 @@ main:
|
||||
//printf(i,"%nSPRITE %r ");
|
||||
setspg(i,1,$80); //Set Bit 7 of Register 1 (Mode)
|
||||
setspd(i,spaddr);
|
||||
//printf(getspg(i,1),"REG=$%h"); printf(getspg(i,0),"%h ");
|
||||
//printf(getspg(i,1),"REG=$%x"); printf(getspg(i,0),"%x ");
|
||||
if (!getspg(i,1)&$80) xerror(); //Check Bit 7 of Register 1
|
||||
addr = getspd(i);
|
||||
//printf(setdst(addr),"ADDRESS=$%w");
|
||||
@ -466,7 +466,7 @@ main:
|
||||
setspb(i,j);
|
||||
spmode = getspb(i);
|
||||
//printf(spmode,"MODE=%d ");
|
||||
//printf(getspg(i,1),"REG=$%h ");
|
||||
//printf(getspg(i,1),"REG=$%x ");
|
||||
if (spmode<>j) xerror();
|
||||
}
|
||||
if (getspg(i,1)<>k) xerror(); //Check Bits 0-6 of Register
|
||||
@ -506,9 +506,9 @@ main:
|
||||
for (j=1; j:+; j--) { //1 to 0
|
||||
k = j-1; //#FALSE then #TRUE
|
||||
setspf(i,k);
|
||||
//printf(getspn(i),"REG=$%h ");
|
||||
//printf(getspn(i),"REG=$%x ");
|
||||
n = getspf(i);
|
||||
//prtflg(n,"HFLIP=$%h (%s) ");
|
||||
//prtflg(n,"HFLIP=$%x (%s) ");
|
||||
if (n<>k) xerror();
|
||||
}
|
||||
if (getspn(i)<>$ff) xerror();
|
||||
@ -522,9 +522,9 @@ main:
|
||||
for (j=1; j:+; j--) { //1 to 0
|
||||
k = j-1; //#FALSE then #TRUE
|
||||
setspv(i,k);
|
||||
//printf(getspn(i),"REG=$%h ");
|
||||
//printf(getspn(i),"REG=$%x ");
|
||||
n = getspv(i);
|
||||
//prtflg(n,"HFLIP=$%h (%s) ");
|
||||
//prtflg(n,"HFLIP=$%x (%s) ");
|
||||
if (n<>k) xerror();
|
||||
}
|
||||
if (getspn(i)<>$ff) xerror();
|
||||
@ -537,7 +537,7 @@ main:
|
||||
setspn(i,$ff); //Set All Bits in Control Register
|
||||
for (j=0; j<4; j++) {
|
||||
setspz(i,j);
|
||||
//printf(getspn(i),"REG=$%h ");
|
||||
//printf(getspn(i),"REG=$%x ");
|
||||
n = getspz(i);
|
||||
//printf(n,"ZDEPTH=%d ");
|
||||
if (n<>j) xerror();
|
||||
@ -552,7 +552,7 @@ main:
|
||||
setspn(i,$ff); //Set All Bits in Control Register
|
||||
for (j=0; j<16; j++) {
|
||||
setspm(i,j);
|
||||
//printf(getspn(i),"%h:");
|
||||
//printf(getspn(i),"%x:");
|
||||
n = getspm(i);
|
||||
//printf(n,"%g ");
|
||||
if (n<>j) xerror();
|
||||
@ -567,7 +567,7 @@ main:
|
||||
setsps(i,$ff); //Set All Bits in Control Register
|
||||
for (j=0; j<16; j++) {
|
||||
setspp(i,j);
|
||||
//printf(getsps(i),"%h:");
|
||||
//printf(getsps(i),"%x:");
|
||||
n = getspp(i);
|
||||
//printf(n,"%g ");
|
||||
if (n<>j) xerror();
|
||||
@ -582,7 +582,7 @@ main:
|
||||
setsps(i,$ff); //Set All Bits in Control Register
|
||||
for (j=0; j<4; j++) {
|
||||
setsph(i,j);
|
||||
//printf(getsps(i),"[$%h] ");
|
||||
//printf(getsps(i),"[$%x] ");
|
||||
n = getsph(i);
|
||||
//printf(n,"%d ");
|
||||
if (n<>j) xerror();
|
||||
@ -597,7 +597,7 @@ main:
|
||||
setsps(i,$ff); //Set All Bits in Control Register
|
||||
for (j=0; j<4; j++) {
|
||||
setspw(i,j);
|
||||
//printf(getsps(i),"[$%h] ");
|
||||
//printf(getsps(i),"[$%x] ");
|
||||
n = getspw(i);
|
||||
//printf(n,"%d ");
|
||||
if (n<>j) xerror();
|
||||
|
@ -53,7 +53,7 @@ void prtmsk(aa,yy) {
|
||||
|
||||
//Print Three Values Enclosed in Parentheses
|
||||
void prtprn(aa,yy,xx) {
|
||||
printf(aa,"($%h"); printf(yy,",$%h"); printf(xx,",$%h)");
|
||||
printf(aa,"($%x"); printf(yy,",$%x"); printf(xx,",$%x)");
|
||||
}
|
||||
|
||||
main:
|
||||
@ -74,7 +74,7 @@ main:
|
||||
if (mono) puts(" MONOCHROME"); else puts(" COLOR");
|
||||
if (field) puts(", ODD"); else puts(", EVEN"); putln(" FIELD");
|
||||
|
||||
bcpidx = getbdr(); printf(bcpidx, " BORDER PALETTE INDEX: $%h");
|
||||
bcpidx = getbdr(); printf(bcpidx, " BORDER PALETTE INDEX: $%x");
|
||||
bcolor = getclr(bcpidx); puts(setdst(bcolor)); printf(", COLOR=$%w ");
|
||||
prtprn(clrrgb(bcolor)); newlin();
|
||||
|
||||
@ -89,9 +89,9 @@ main:
|
||||
|
||||
putln("PALETTE COLORS");
|
||||
|
||||
putrps(5); i=0 ;do {printf(i," %h "); i=i+16; } while(i) ; newlin();
|
||||
putrps(5); i=0 ;do {printf(i," %x "); i=i+16; } while(i) ; newlin();
|
||||
for (i=0;i<16;i++) {
|
||||
printf(i," %h ");
|
||||
printf(i," %x ");
|
||||
j=0; do {
|
||||
k = i + j; setdst(getclr(k)); printf(k,"%q ");
|
||||
j = j + 16;
|
||||
@ -137,7 +137,7 @@ main:
|
||||
setdst(gethsc(layer)); printf(" HORIZONTAL SCROLL: $%i");
|
||||
setdst(getvsc(layer)); printf(", VERTICAL SCROLL: $%i%n");
|
||||
|
||||
printf(getbpo(layer)); printf(" BITMAP PALETTE OFFSET: $%h%n");
|
||||
printf(getbpo(layer)); printf(" BITMAP PALETTE OFFSET: $%x%n");
|
||||
|
||||
newlin();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user