⬆️ ⬇️

My first Sharp PC3000 reader

I have always loved to read. Starting from kindergarten. Then at school I read almost the entire library. When I went to work, in the dashing nineties, I bought a bunch of books on the markets. It was a hard time. Many left for Germany for permanent residence. My friend also left. Then a few years later, in the late nineties, he sent a package in which, in addition to unprecedented overseas sweets, there were 3 Sharp PC3000 computers.



Just such:







As a result, 2 of them were launched, and the third was left for parts. In fact, it was the usual IBM PC XT on an 8088 processor with 1 mb of memory, a graphic display with 4 brightness levels, COM, LPT, Dock ports, two PCMCIA slots in one of which I found a 512 kb memory card on a CR2032 battery.

')





My joy knew no bounds!



But after sitting, and turning this thing in his hands, it was not clear why it could be used. In this palmtop, applications were pre-installed mainly for business — a calendar, a notebook, a file manager. Com and LPT connectors were proprietary. Miniature, similar to their full-fledged counterparts, but without pins, and knife, like PCI or PCIe. The Internet at that time was issued for coupons was in its infancy so that it was possible to connect only at night and not for long, because the connection was constantly breaking. As a result, pinout pinouts were found, knife adapters were etched, and a null modem cable was made to communicate with the big brother. But in the end, the built-in utility could not be connected. The LapLink application that I found on the Internet and could not get it out of the palmtop in any way was the wrong version. The search continued and as a result I found a distribution kit with utilities.



It would seem that the problem is solved, download the program and use it at your pleasure. I suffered a week. Went through all sorts of programs, mostly toys. But due to deviations from the classic IBM PC format, many applications either did not work or worked incorrectly. Or they did not have enough memory on the card. Therefore, I abandoned it until better times.



After a while I got a job at the distillery as a duty mechanic at the Instrument and Instrument Engineering Institute. There was enough work during the day shift, but there was nothing to do at night because the equipment was new and practically did not break. I didn’t buy books anymore, since disks on discs were sold with a bunch of all kinds of literature in DOS txt format. And, having bought one such disk, it was possible to read it for several years. Then the idea to use my Micro PC came to me.



The whole feature of the memory implementation was that the embedded applications were launched from the ROM disk and they were adapted for its use. The launch of the system and configs lay on the built-in RAM disk with a capacity of 76 kb, the non-volatility of which was supported by the battery. There was also a 1mb RAM disk, the non-volatility of which was supported by the main battery. In the end, I decided to write an ultra-small application. And it seems to have started in assembler, but the lack of debugging tools was killing. Well, remember, perhaps, tasm ... As a result, I launched Turbo C 2.0 on BB and began to sculpt. The very first download to Sharp showed that nothing works. If everything worked perfectly on the BB, the application did not display anything on the palmtop. I had to go to extreme measures and cut the Turbo C to a minimum to shove it in the palmtop. As a result, I still wrote a reading room and enjoyed reading my favorite books during working hours for several years. And the screen in the Sharp PC3000 turned out to be the most convenient for reading, because it was made according to the old classical technology without illumination. The 80x25 mode was the most optimal and the letters on the screen were the same in size as in the books. Palmtop worked on three AA batteries. But the presence of the circuit allowed me to install the batteries and connect a low-current charge circuit through the stabilizer. Batteries and rechargeable batteries he ate well, so the batteries were used only to store information in the RAM disk. Yes, and normal batteries at that time it was difficult to find, so the reader is always operated, always connected to the network. Well, or for a short time from the batteries for transfer to another place.



Program source
#include <dir.h> #include <bios.h> #include <dos.h> #include <fcntl.h> #include <io.h> #include <stat.h> #include <alloc.h> #include <conio.h> #include <stdio.h> #include <stat.h> #include <stdlib.h> #include <stdarg.h> #include <graphics.h> #include <process.h> unsigned char qui,c,membl[2000],fname[20],memtxt[128],Statusin,me; unsigned int h,pos=0,ads,seg,t,t1,t2,memseg,memoffset,membuff,tx,rx,startbuff,buffoff=0,buffbeg,xcor,ycor,buttons,tb; int *memblock,xpos,ypos; long membu,memtext,lenght; unsigned long textposit; int memcoord,fontadr; int GraphDriver,txtfile; int GraphMode; double AspectRatio; int MaxX, MaxY; int MaxColors; int ErrorCode; struct palettetype palette; /*struct ffblk ffblk;*/ unsigned char filelist[192][15]; unsigned char i,x,xp,yp,xl,p,zc; char *driv,*diskname; unsigned int key,drive; int z,filepos,dr,pgs; void main() { void loadfont(); void gettextadr(); void Help(); void Search(); void zprintf(); void Initialize(); void book(); void Oscill(); void Quit(); void cls(); void prtmen(); void files(); void drivesel(); char *buf; clrscr(); drive=getdisk(); if (drive==0) diskname="A"; if (drive==1) diskname="B"; if (drive==2) diskname="C"; if (drive==3) diskname="D"; if (drive==4) diskname="E"; files(); loadfont(); printf("National font loaded\n\n"); filepos=0; clrscr(); while (qui!='q') { while (key!=0x1c0d) { prtmen(); gotoxy(1,25); sprintf(buf,"%-3s ", filelist[drive]); driv=buf; while (bioskey(1)==0) ; key=bioskey(0); if (key==0x5000) { /* down*/ filepos=filepos+1; } if (key==0x4800) { /* up*/ filepos=filepos-1; } if (key==0x4d00) { /* right*/ filepos=filepos+22; } if (key==0x4b00) { /* left*/ filepos=filepos-22; } if (key==0x3B00) { clrscr(); printf("\n National Book Reader v2.0\n\n"); printf(" View only russian and english TXT files\n\n"); printf(" LEFT,RIGHT,UP,DOWN - select file or drive.\n\n"); printf(" ENTER - view file.\n\n"); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n (C) 2000 MSW Computing"); getch(); clrscr(); } if (filepos<0) filepos=0; if (filepos>=i) filepos=i-1; if (key==0x11b) break; } if (key==0x11b) break; key=0; if (filepos<5) { drive=filepos; clrscr(); drivesel(); files(); } if (filepos>4) { clrscr(); strcpy(fname,filelist[filepos]); book(); } } clrscr(); exit(0); } void prtmen() { unsigned long pages,fl; unsigned int pgs,result; FILE *stream; zc=0; for (xp=0;xp<=4;xp++) { xl=xp*15; for (yp=1;yp<23;yp++) { if (filepos==zc) { gotoxy(xl+1,yp); cprintf(">%s",filelist[zc]); zc=zc+1; gotoxy(1,25); if (zc-1<5){ cprintf("Select drive: %-2s ",filelist[zc-1]); } else { strcpy(fname,filelist[filepos]); if ((stream=fopen(fname,"r"))==NULL) { restorecrtmode(); fprintf(stderr,"Can't open txt file"); exit(1); } result=fseek(stream,0L,SEEK_END); fl=ftell(stream); result=fseek(stream,0L,SEEK_SET); pgs=fl/1920; fclose(stream); cprintf("%-1s:\\%-12s Size: %-10lu ",diskname,filelist[zc-1],fl); gotoxy (60,25); cprintf ("%10u pages",pgs); } } else { gotoxy(xl+1,yp); cprintf(" %s",filelist[zc]); zc=zc+1; } if (zc==i) break; } if (zc==i) break; } } void files(void) { struct ffblk ffblk; char nam=" "; unsigned long siz=0; FILE *street; textmode(BW80); z=findfirst("*.*",&ffblk,0); strcpy(filelist[0],"A:\\"); strcpy(filelist[1],"B:\\"); strcpy(filelist[2],"C:\\"); strcpy(filelist[3],"D:\\"); strcpy(filelist[4],"E:\\"); for (i=5;i<110;i++) { if (z==-1) break; nam=" "; p=sprintf(nam,"%s",ffblk.ff_name); strcpy(filelist[i],nam); filelist[i][13]=0xa; z=findnext(&ffblk); } } void drivesel(void) { dr=setdisk(drive); if (dr==0) { gotoxy(1,25); cprintf("Not ready %s",filelist[filepos]); delay(2000); setdisk(2); } } void book(void) { unsigned int key,i; unsigned char status,a; Initialize(); Oscill(); restorecrtmode(); } void Oscill(void) { unsigned char bitq,c,s,asdf,pps,result,resoa; unsigned int key,h,i,x,y,sda,scl,qsel=0,ksearch,xc,yc,zc,zx,fil,er,keypressed=0; unsigned long posit=0,prev[3000],lastz,last; unsigned long fl,pageset,pagesel,pconst=1920; FILE *stream; int pp,ppc,fn,z,dec,sig; struct stat buf; pp=0; prev[pp]=0; if ((stream=fopen(fname,"r"))==NULL) { restorecrtmode(); fprintf(stderr,"Can't open txt file"); exit(1); } result=fseek(stream,0L,SEEK_END); fl=ftell(stream); result=fseek(stream,0L,SEEK_SET); pgs=fl/1920; while (!feof(stream)) { cls(); bitq=0; ypos=0; xpos=0; lastz=ftell(stream); for (h=0;h<24;h++) { ypos=h; last=ftell(stream); for (pps=0;pps<80;pps++) { keypressed=0; result=fgetc(stream); if (result==0xa) break; if (result == 0xFF) { sprintf(memtxt,"End of file. Press [ESC] for quit or [ARROW LEFT] to Page UP\n"); fseek(stream,last,SEEK_SET); xpos=0; ypos=24; zprintf(); while (bioskey(1)==0) ; key=bioskey(0); if (key==0x5000) { /* down*/ keypressed=1; } if (key==0x4800) { /* up*/ keypressed=2; } if (key==0x4d00) { /* right*/ keypressed=3; } if (key==0x4b00) { /* left*/ keypressed=4; } if (key==0x11b) { /*quit*/ keypressed=5; } bitq=1; if (keypressed==5|keypressed==4) break; /*sym='q';*/ } /*end if EOF*/ if (keypressed==5|keypressed==4) break; if (result<32) { memtxt[pps]='.'; } else memtxt[pps]=result; } /*end line*/ if (keypressed==5|keypressed==4) break; memtxt[pps]=0x0a; zprintf(); /*end page*/ posit=ftell(stream); ppc=posit/1920; sprintf(memtxt," File: %s Page: %u Pages: %u (C) 1999 MSW \n ",fname,ppc,pgs); xpos=0; ypos=24; zprintf(); sprintf(memtxt," "); xpos=0; } while (bitq!=1) { while (bioskey(1)==0) ; key=bioskey(0); if (key==0x3C00) { int pagesel; pagesel=ppc; xpos=0; ypos=24; sprintf(memtxt,"Select page: \n"); zprintf(); while (qsel==0) { while (bioskey(1)==0) ; ksearch=bioskey(0); xpos=14; ypos=24; sprintf(memtxt,"%d \n",pagesel); zprintf(); if (ksearch==0x4800) { pagesel=pagesel+1; } if (ksearch==0x5000) { pagesel=pagesel-1; } if (pagesel>pgs) pagesel=pgs; if (pagesel<1) pagesel=0; if (ksearch==0x1c0d) break; } if (pagesel==0) { pageset=0; } else { pageset = pagesel * pconst; } result=fseek(stream,pageset,SEEK_SET); bitq=1; } if (key==0x3B00) { bitq=1; key=0; Help(); bioskey(0); fseek(stream,lastz,SEEK_SET); keypressed=0; } if (key==0x5000) { /* down*/ keypressed=1; } if (key==0x4800) { /* up*/ keypressed=2; } if (key==0x4d00) { /* right*/ keypressed=3; } if (key==0x4b00) { /* left*/ keypressed=4; } if (key==0x11b) { /*quit*/ keypressed=5; } if (keypressed==5) break; if (keypressed==4) { bitq=1; } if (keypressed==3) { pp=pp+1; prev[pp]=posit; bitq=1; } } if (keypressed==4) { pp=pp-1; if (pp<=0) pp=0; fseek(stream,prev[pp],SEEK_SET); } if (keypressed==5) break; } fclose(stream); } void Search(void) { } void Help(void) { xpos=0; ypos=0; cls(); sprintf(memtxt," National Book Reader v2.0\n"); zprintf(); xpos=0; ypos=2; sprintf(memtxt," LEFT - page down\n"); zprintf(); xpos=0; ypos=4; sprintf(memtxt," RIGHT - page up\n"); zprintf(); xpos=0; ypos=6; sprintf(memtxt," ESC - exit\n"); zprintf(); xpos=0; ypos=8; sprintf(memtxt," F1 - this screen\n"); zprintf(); xpos=0; ypos=10; sprintf(memtxt," F2 - go to page\n"); zprintf(); sprintf(memtxt," UP - increment value\n"); xpos=0; ypos=12; zprintf(); sprintf(memtxt," DOWN - decrement value\n"); xpos=0; ypos=14; zprintf(); sprintf(memtxt," ENTER - select page\n"); xpos=0; ypos=16; zprintf(); xpos=0; ypos=24; sprintf(memtxt," (C) 2000 MSW Home Computing\n"); zprintf(); } void Quit(void) { textcolor(WHITE); textbackground(BLACK); restorecrtmode(); exit(0); } void Initialize(void) { int xasp, yasp, fontst,errorcode; GraphDriver = DETECT; /*errorcode = registerbgidriver(CGA_driver); if(errorcode < 0) { printf("ЋЎЄ :%s\n",grapherrormessage(errorcode)); printf("„«  ў  ¦¬Ґ «Ў Є« ў\n"); getch(); exit(1); } */ initgraph( &GraphDriver, CGAHI, "" ); settextstyle(DEFAULT_FONT,HORIZ_DIR,USER_CHAR_SIZE); ErrorCode = graphresult(); if( ErrorCode != grOk ){ printf(" Graphics System Error\n"); exit( 1 ); } getpalette( &palette ); MaxColors = getmaxcolor() + 1; MaxX = getmaxx(); MaxY = getmaxy(); getaspectratio( &xasp, &yasp ); AspectRatio = (double)xasp / (double)yasp; } void zprintf(void) { unsigned int i,g,z; unsigned char l,w; z=0; c=memtxt[z]; while (c!=0xA) { c=memtxt[z]; if (c>=0x20) { gettextadr(); fontadr=(c-0x20)*8; for (i=0;i<7;i++) { g=fontadr+i; l=membl[g]; pokeb(0xB800,memcoord,l); i=i++; g=fontadr+i; l=membl[g]; pokeb(0xB800,memcoord+8192,l); memcoord=memcoord+80; } xpos=xpos+1; } z=z++; } } void gettextadr(void) { memcoord=xpos+(ypos*320); } void cls(void) { unsigned int cl; for (cl=0;cl<16384;cl++) pokeb (0xb800,cl,0); } void loadfont(void) { unsigned int fil,i; char c; fil = _open("book.fnt",O_RDONLY); if (fil==-1) { printf("File BOOK.FNT not found\n"); abort(); } if ((_read(fil,membl,1792))==-1) { printf("Can't load national font file"); perror(""); } /*fseek(fil,0,SEEK_SET); for (i=0;i<1792;i++) { fseek(fil,i,SEEK_SET); membl[i]=fgetc(fil); } fclose(fil); */ _close(fil); } 




→ Source code and program you can get here



  1. Photo taken from here

Source: https://habr.com/ru/post/444256/



All Articles