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