home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdio.h>
-
- int rest,count,knum,lnum,num;
-
- main(argc,argv)
-
- int argc,argv[];
-
- { char cmd[4];
- char c;
- int fd;
-
- getarg (1, cmd, 3,argc,argv);
-
- if (((cmd[0] == '/')&&(cmd[1] == '/'))||(cmd[0] == '?'))
-
- {
-
- if ((fd = fopen ("GRC128.HLP","r")) != NULL)
-
- { while ((c = fgetc(fd)) != EOF)
-
- putchar(c);
-
- fclose(fd); }
-
- else
- { printf(" ** file GRC128.HLP missing ");
- printf("on default drive(s) ! ** \n "); }
-
-
-
- #asm
-
- .z80
-
- push bc
- push de
- push hl
- push af
- push ix
- push iy
- ld hl,(0006d)
- ld bc,10d
- add hl,bc
- inc hl
- inc hl
- inc hl
- ld bc,0005d ;offset zu remove flag
- sbc hl,bc
- ld a,0ffh
- ld (hl),a
- pop iy
- pop ix
- pop af
- pop hl
- pop de
- pop bc
- .8080
- #endasm
- printf("\n");
- }
- else
-
- if ((cmd[0] == 'O')&&(cmd[1] == 'F')&&(cmd[2] == 'F'))
-
- {
-
-
- #asm
- .z80
-
- start: push bc
- push de
- push hl
- push af
- push ix
- push iy
- ld hl,0000h
- ld (num),hl
- ld hl,(0006d)
- loop: ld bc,10d
- add hl,bc
- ld a,(hl)
- cp "R"
- jp nz,no
- inc hl
- ld a,(hl)
- cp "S"
- jp nz,no
- inc hl
- ld a,(hl)
- cp "X"
- jp nz,no
- inc hl
- ld a,(hl)
- cp "I"
- jp nz,no
- ld de,(num)
- inc de
- ld (num),de
- ld bc,0005d ;offset zu remove flag
- sbc hl,bc
- ld a,0ffh
- ld (hl),a
- ld bc,04d ;offset to next:
- sbc hl,bc
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld h,b
- ld l,c
- jp loop
- no: ld hl,(num)
- ld a,l
- ld hl,(0006d)
- ld bc,5888d
- jp test
- again: add hl,bc
- dec a
- test: cp 00h
- jp nz,again
- ld (knum),hl
- pop iy
- pop ix
- pop af
- pop hl
- pop de
- pop bc
- .8080
-
- #endasm
- printf("\n");
- printf(" ******** REMOVING The Graphic System-Extension ******** \n");
- printf(" ***** (c) Erich Koppensteiner ***** \n");
- printf(" *** Forstmeisterg. 8 *** \n");
- printf(" * 1140,Vienna AUSTRIA * \n");
- printf("\n");
- if (num > 1)
- knum=knum-768;
- #asm
- .z80
- push bc
- push de
- push hl
- push af
- push ix
- push iy
- ld hl,(knum)
- ld bc,255d
- sbc hl,bc
- ld b,h
- ld c,l
- ld a,b
- and 03h
- ld b,a
- ld (rest),bc
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- ld (lnum),hl
- pop iy
- pop ix
- pop af
- pop hl
- pop de
- pop bc
- .8080
- #endasm
-
- rest=rest/10;
- /* lnum=(knum-255)/1024; */
- printf(" [ TPA 0100 - %x ; %u,%u k ] \n ",knum,lnum,rest);
- }
-
-
- else
- if (((cmd[0] == 'O')&&(cmd[1] == 'N'))||(cmd[0] == NULL))
-
-
- {
- printf("\n");
- printf(" ******** LOADING The Graphic System-Extension ******** \n");
- printf(" ***** (c) Erich Koppensteiner ***** \n");
- printf(" *** Forstmeisterg. 8 *** \n");
- printf(" * 1140,Vienna AUSTRIA * \n");
- printf("\n");
- #asm
- .z80
- sstart: push bc
- push de
- push hl
- push af
- push ix
- push iy
- ld a,00h
- ld (count),a
- ld hl,(0006d)
- sloop: ld bc,10d
- add hl,bc
- ld a,(hl)
- cp "R"
- jp nz,sno
- inc hl
- ld a,(hl)
- cp "S"
- jp nz,sno
- inc hl
- ld a,(hl)
- cp "X"
- jp nz,sno
- inc hl
- ld a,(hl)
- cp "I"
- jp nz,sno
- ld a,(count)
- inc a
- ld (count),a
- ld bc,0005d ;offset zu remove flag
- sbc hl,bc
- ld bc,04d ;offset to next:
- sbc hl,bc
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld h,b
- ld l,c
- jp sloop
- sno: ld a,(count)
- cp 01h
- jp z,weiter
- push af
- jp hihi
- text: db " ** The Graphic System-Extension has already been loades previously ** $"
- uui: db " ** - not loading twice - ** $"
- hihi: ld c,09d
- ld de,text
- call 0005d
- ld c,09d
- ld de,uui
- call 0005d
- pop af
- ld hl,(0006d)
- ld bc,10d
- add hl,bc
- inc hl
- inc hl
- inc hl
- ld bc,0005d ;offset zu remove flag
- sbc hl,bc
- ld a,0ffh
- ld (hl),a
- weiter: ld hl,(count)
- ld a,l
- ld hl,(0006h)
- cp 01h
- jp z,fur
- ld bc,5120d
- add hl,bc
- fur: ld (count),hl
- pop iy
- pop ix
- pop af
- pop hl
- pop de
- pop bc
- .8080
-
- #endasm
-
- /* lnum=(count-255)/1024; */
-
- #asm
- .z80
- push bc
- push de
- push hl
- push af
- push ix
- push iy
- ld hl,(count)
- ld bc,255d
- sbc hl,bc
- ld b,h
- ld c,l
- ld a,b
- and 03h
- ld b,a
- ld (rest),bc
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- srl h
- rr l
- ld (lnum),hl
- pop iy
- pop ix
- pop af
- pop hl
- pop de
- pop bc
- .8080
- #endasm
- printf("\n");
- rest=rest/10;
- printf(" [ TPA 0100 - %x ; %u,%u k ] \n ",count,lnum,rest);
- }
- else
- { printf(" wrong usage ! ");
- printf("usage is: \"grc128\" ");
- printf("[\"on\"|\"off\"|\"//\"|\"?\"] \n");
- printf(" ");
-
- #asm
-
- .z80
-
- push bc
- push de
- push hl
- push af
- push ix
- push iy
- ld hl,(0006d)
- ld bc,10d
- add hl,bc
- inc hl
- inc hl
- inc hl
- ld bc,0005d ;offset zu remove flag
- sbc hl,bc
- ld a,0ffh
- ld (hl),a
- pop iy
- pop ix
- pop af
- pop hl
- pop de
- pop bc
-
- .8080
-
- #endasm
- }
-
- }
-
-
-
-