home *** CD-ROM | disk | FTP | other *** search
-
-
- .z80
-
- public texta,offsa,paddre;
-
- ListOutput equ 05h
-
- external mode
-
- bdos equ 0005h
-
- external sb1x1,sb1x2,sb1x3,sb1x4,sb1x5,sb1x6,sb1x7,sb1x8
-
- public SaveWi,LoadWi
-
- external memstart,prep,SWvxy,LWvxy;
-
- external linv,lover
-
- external xinv,xover
-
- external mydma
-
- external olddma,scbpb
-
- external PFIlett;
-
- external flip,flop,skox,skoy,ekox,ekoy;
-
- public GFtext;
-
- external mfdm,pfrep,SWFxy,cfdm,ofdm,LWFxy,zeil0a;
-
- public injn
-
- external prbitm,crtab,convta,prtab,nextli;
-
- public SaveFW,LoadFW,scrdump;
-
- texta: ds 2
-
- offsa: ds 2
-
- paddre: ds 2
-
- rhl: ds 2
-
- ret: ds 2
-
-
-
- SaveWi:
-
- ld (rde),de
- ld (rhl),hl
- pop hl
- ld (ret),hl
- ld h,d
- ld l,e
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (skox),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (skoy),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekox),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekoy),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (memstart),de
- ld de,(rde)
- ld hl,(rhl)
-
-
-
-
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call prep
- ld bc,(skoy)
- ld (flop),bc
- ld b,c
- ld de,(ekoy)
- ld c,e
- jp test1
- schl1: ld de,(skox) ;flip -> de
- ld (flip),de
- ld hl,(ekox) ;ekox -> hl
- jp test2
- schl2: ld hl,(ekox)
- call SWvxy
- ld iy,08d
- add iy,de
- ld (flip),iy ;flip udaten
- push iy
- pop de
- test2: ld a,h
- cp d
- jp m,weit
- jp nz,schl2
- ld a,l
- cp e
- jp m,weit
- jp schl2
- weit: inc b
- ld ix,(flop)
- inc ix
- ld (flop),ix ;und zurueckspeichern
- test1: ld a,c
- cp b
- jp m,wt1
- jp schl1
- wt1: pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rhl),hl
- ld hl,(ret)
- push hl
- ld hl,(rhl)
- ret
-
-
-
- LoadWi: ld (rde),de
- ld (rhl),hl
- pop hl
- ld (ret),hl
- ld h,d
- ld l,e
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (skox),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (skoy),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekox),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekoy),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (memstart),de
- inc hl
- push af
- ld a,(hl)
- ld (xinv),a
- inc hl
- ld a,(hl)
- ld (xover),a
- pop af
- ld de,(rde)
- ld hl,(rhl)
-
-
-
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call prep
- ld bc,(skoy)
- ld (flop),bc
- ld b,c
- ld de,(ekoy)
- ld c,e
- jp test5
- schl5: ld de,(skox) ;flip -> de
- ld (flip),de
- ld hl,(ekox) ;ekox -> hl
- jp test6
- schl6: ld hl,(ekox)
- call LWvxy
- ld iy,08d
- add iy,de
- ld (flip),iy ;flip udaten
- push iy
- pop de
- test6: ld a,h
- cp d
- jp m,weit3
- jp nz,schl6
- ld a,l
- cp e
- jp m,weit3
- jp schl6
- weit3: inc b
- ld ix,(flop) ;und zurueckspeichern
- inc ix
- ld (flop),ix
- test5: ld a,c
- cp b
- jp m,wt3
- jp schl5
- wt3: pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rhl),hl
- ld hl,(ret)
- push hl
- ld hl,(rhl)
- ret
-
-
-
- SaveFW: push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,scbpb
- ld c,49d
- call bdos
- ld (olddma),hl
- ld de,mydma
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rde),de
- ld (rhl),hl
- pop hl ;ret-addr
- ld (ret),hl
- ld h,d
- ld l,e
- ld e,(hl) ;xstart addr.
- inc hl ;high byte
- ld d,(hl) ;
- ld (skox),de
- inc hl ;addr+1
- ld e,(hl) ;
- inc hl
- ld d,(hl)
- ld (skoy),de
-
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekox),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekoy),de
-
-
- push af
- inc hl
- ld a,(hl)
- ld (sb1x1),a
- inc hl
- ld a,(hl)
- ld (sb1x2),a
- inc hl
- ld a,(hl)
- ld (sb1x3),a
- inc hl
- ld a,(hl)
- ld (sb1x4),a
- inc hl
- ld a,(hl)
- ld (sb1x5),a
- inc hl
- ld a,(hl)
- ld (sb1x6),a
- inc hl
- ld a,(hl)
- ld (sb1x7),a
- inc hl
- ld a,(hl)
- ld (sb1x8),a
- pop af
-
- ld hl,(rhl)
- ld de,(rde)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call mfdm
- call pfrep
- ld bc,(skoy)
- ld (flop),bc
- ld b,c
- ld de,(ekoy)
- ld c,e
- jp test3
- schl3: ld de,(skox) ;flip -> de
- ld (flip),de
- ld hl,(ekox) ;ekox -> hl
- jp test4
- schl4: ld hl,(ekox)
- call SWFxy
- ld iy,08d
- add iy,de
- ld (flip),iy ;flip udaten
- push iy
- pop de
- test4: ld a,h
- cp d
- jp m,weit1
- jp nz,schl4
- ld a,l
- cp e
- jp m,weit1
- jp schl4
- weit1: inc b
- ld ix,(flop) ;alten wert laden
- inc ix ;um 1 erhoehen
- ld (flop),ix ;und zurueckspeichern
- test3: ld a,c
- cp b
- jp m,weit2
- jp schl3
- weit2: call cfdm
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rhl),hl
- ld hl,(ret)
- push hl
- ld hl,(rhl)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,(olddma)
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ret
-
-
-
- LoadFW: push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,scbpb
- ld c,49d
- call bdos
- ld (olddma),hl
- ld de,mydma
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rde),de
- ld (rhl),hl
- pop hl ;ret-addr
- ld (ret),hl
- ld l,e
- ld h,d
- ld e,(hl) ;xstart addr.
- inc hl ;high byte
- ld d,(hl) ;
- ld (skox),de
- inc hl ;addr+1
- ld e,(hl) ;
- inc hl
- ld d,(hl) ;
- ld (skoy),de
-
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekox),de
- inc hl
- ld e,(hl)
- inc hl
- ld d,(hl)
- ld (ekoy),de
-
- push af
- inc hl
- ld a,(hl)
- ld (sb1x1),a
- inc hl
- ld a,(hl)
- ld (sb1x2),a
- inc hl
- ld a,(hl)
- ld (sb1x3),a
- inc hl
- ld a,(hl)
- ld (sb1x4),a
- inc hl
- ld a,(hl)
- ld (sb1x5),a
- inc hl
- ld a,(hl)
- ld (sb1x6),a
- inc hl
- ld a,(hl)
- ld (sb1x7),a
- inc hl
- ld a,(hl)
- ld (sb1x8),a
- inc hl
- ld a,(hl)
- ld (linv),a
- inc hl
- ld a,(hl)
- ld (lover),a
- pop af
-
- ld hl,(rhl)
- ld de,(rde)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call ofdm
- call pfrep
- ld bc,(skoy)
- ld (flop),bc
- ld b,c
- ld de,(ekoy)
- ld c,e
- jp test7
- schl7: ld de,(skox) ;flip -> de
- ld (flip),de
- ld hl,(ekox) ;ekox -> hl
- jp test8
- schl8: ld hl,(ekox)
- call LWFxy
- ld iy,08d
- add iy,de
- ld (flip),iy ;flip udaten
- push iy
- pop de
- test8: ld a,h
- cp d
- jp m,weit4
- jp nz,schl8
- ld a,l
- cp e
- jp m,weit4
- jp schl8
- weit4: inc b
- ld ix,(flop) ;und zurueckspeichern
- inc ix
- ld (flop),ix
- test7: ld a,c
- cp b
- jp m,wt4
- jp schl7
- wt4: call cfdm
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rhl),hl
- ld hl,(ret)
- push hl
- ld hl,(rhl)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,(olddma)
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ret
-
-
- GFtext: push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,scbpb
- ld c,49d
- call bdos
- ld (olddma),hl
- ld de,mydma
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rbc),bc
- pop bc
- ld (ret),bc
- ld (rhl),hl ;saven
-
- ld h,d
- ld l,e
-
- ld c,(hl) ;inv -> bc
- inc hl
- ld b,(hl) ;
- ld (injn),bc ;
- inc hl ;addr +1
- ld c,(hl) ;
- inc hl
- ld b,(hl) ;
- ld (zeichs),bc ;offset
- inc hl
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (zeile),bc
- inc hl
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (spalte),bc
- inc hl
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (mytex),bc ;array-addr
- ld bc,(rbc)
- ld hl,(rhl)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,(zeile) ;zeile in e
- ld b,e ;zeile in b
- ;** if schleife
- ld a,b ;zeile in akku
- cp 0h ;zeile < 0
- jp m,endg ;zeile < 0 -> endg
- cp 25d ;zeile >25 ?
- jp m,wg1 ;zeile < 25 -> wg1
- jp z,wg1 ;zeile=25 -> wg1
- jp endg ;sonst zeile . 25 -> endg
- wg1: ld a,c ;spalte in akku
- cp 0h ;spalte < 0 ?
- jp m,endg ;-> endg
- cp 79d ;spalte > 79 ?
- jp m,wg2 ;spalte < 79 -> wg2
- jp z,wg2 ;spalte = 79 -> wg2
- jp endg ;sonst: spalte . 79 -> endg
- wg2: ld de,01h ;
- ld (ind1),de ;ind1 <- 1
- ld hl,(mytex) ;addr v string
- ld e,(hl) ;string[0] -> endg
- ld d,00h ;endg -> de
- ld (ind2),de ;laenge str -> ind2
- ld bc,(ind1) ;
- ld b,c ;ind1 (8 bit !) -> b
- ld c,e ;ind2 (8 bit 1) -> c
- ;while ind1 < ind2 do
- ; schleife
- jp tg1
- scg1: push bc ;ind1,ind2 retten
- ;texta:=zeile * 640 +spalte
- ;zeile *640 multgiplik. nach Rodnay Zacks
- ld bc,640d
- ld (mpd),bc
- ld hl,(zeile) ;
- ld a,h
- ; ld a,(zeile+1) ;mpr-oben
- ld c,a
- ld a,l
- ; ld a,(zeile+0) mpr - unten
- ld b,16d ;zaehler
- ld de,(mpd) ;640d -> de
- ld hl,0h
- multg: srl c ;mpr-oben nach rechts schieben
- rra ;mpr unten rotier. rechts
- jr nc,nogadd ;teste uebertr
- add hl,de ;mpd zu ergebnis addieren
- nogadd: ex de,hl ;vertausche de,hl
- add hl,hl ;verdoppelung schiebe mpd -> links
- ex de,hl
- djnz multg ;hl -> ergebnis
- ld bc,(spalte)
- add hl,bc ;zeile*640+spalte -> hl
- ld (texta),hl ;
- pop bc ;ind1,ind2 holen
- ld de,(mytex) ;add v.string
- ld h,0h ;
- ld l,b ;ind1 -> hl
- add hl,de ;addr(mystr[ind1]) -> hl
- ld a,(hl) ;mystr[ind1] -> a
- ;ascii v. mystr[ind1] -> a
- ;= ORD(mystr[ind1]) -> a
- ;a*16 -> 4 bit nach links verschieben
- ld d,0h ;
- ld e,a ;in 16 bit register
- sla e ;*2 7. bit -> carry
- rl d ;carry in d schieben
- sla e ;*4
- rl d
- sla e ;*8
- rl d
- sla e ;*16
- rl d ;*16 -> de
- ;ord (mystr[ind1])*16 -> de
- ld hl,4096d
- add hl,de
- ;+4096d
- ;ORD(mystr[ind1])*16+4096 -> hl
- ld de,0000h ;0000h da keine basisaddr in file -> de
- add hl,de ;addr(charro)+ORD(mystr[ind1])*16+4096 -> hl
- push bc ;saven der register
- push de
- push hl
- push af
- ; ld bc,hl ;bisher offsa (bei 00) in bc retten
- ld b,h
- ld c,l
- ld de,(zeichs) ;offset d. zeichensatzes in de
- sla e ;zeichoffset *2 ,da words in tabelle !
- ld hl,ztabl ;startaddresse zeichens.offsettabelle
- add hl,de ;ergibt addresse der stelle in tabelle
- ; ld de,(hl) ;inhalt der tabelle = offset nach de
- ld e,(hl)
- inc hl ;addr+1 fuer high byte
- ld d,(hl)
- ; ld hl,bc ;bisher offsa in hl
- ld h,b
- ld l,c
- add hl,de ;mit neuen (0000,1024,2048,..7186) addieren
- ld (offsa),hl ;in offsa speichern
-
- ;ld de,4096d
- ;add hl,de
- ;ld (offsa),hl
-
- pop af ;laden der registerwerte
- pop hl
- pop de
- pop bc
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call PFIlett
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- inc b ;ind1 +1
- push bc ;ind1 ,ind2 retten
- ld bc,(spalte) ;spalte -> c
- ld de,(zeile) ;zeile -. e
- ld b,e ;zeile -> b
- ld a,c ;spakte -> a
- cp 79d
- jp nz,wg3
- inc b ;zeile +1
- ld a,b ;zeile +1 -> a
- jp tg2
- scg2: sbc a,25d
- tg2: cp 24d
- jp z,wg4
- jp m,wg4
- jp scg2
- wg4: ld h,0d
- ld l,a
- ld (zeile),hl ;zeile -> neu
- wg3: inc c ;spalte +1 -> akku
- ld a,c
- jp tg3
- scg3: sbc a,79d
- tg3: cp 78d
- jp m,wg5
- jp z,wg5
- jp scg3
- wg5: ld h,0h
- ld l,a
- ld (spalte),hl
- pop bc ;ind1 , ind2 holen
- tg1: ld a,b ;ind1 - ind2 ?
- cp c
- jp m,scg1
- jp z,scg1
- endg: pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rbc),bc
- ld bc,(ret)
- push bc
- ld bc,(rbc)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,(olddma)
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ret
-
-
-
- mytex: ds 2
-
- zeile: ds 2
-
- spalte: ds 2
-
- ind1: ds 2
-
- ind2: ds 2
-
- mpd: ds 2
-
- rbc: ds 2
-
-
- scrdump:ld (rbc),bc
- pop bc
- ld (ret),bc
- ld (prmode),de
- ld bc,(rbc)
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call zeil0a ;zerstoert alles
- ld bc,(prmode)
- ld a,c ;prmode -> akku
- ld (mode),a
- ld bc,0h
- ld (zeile),bc ;0 -> zeile
- ld a,c ;zeile -> akku
- jp tst4
- schx4: ld de,0h
- ld (spalte),de
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call prbitm
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld b,e ;spalte (8 bit) -> b
- jp tst5
- schx5: push bc ;zeile,spalte retten
- ;multiplikation nach rodnay zacks
- ld de,640d
- ld h,0h
- ld l,c ;zeile -> hl
- ld (mpr),hl
- muly16: ld a,(mpr+1)
- ld c,a
- ld a,(mpr)
- ld b,16d
- ld hl,00h
- multy: srl c
- rra
- jr nc,noyadd
- add hl,de
- noyadd: ex de,hl
- add hl,hl
- ex de,hl
- djnz multy
- pop bc ;zeile,spalte laden
- ld d,0h
- ld e,b ;spalte -> de
- add hl,de
- ;zeile*640+spalte -> hl
- ld (paddre),hl
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call crtab
- call convta
- call prtab
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- inc b ;spalte + 1
- tst5: ld a,b
- cp 79d
- jp m,schx5
- jp z,schx5
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call nextli
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- inc c ;zeile + 1
- tst4: ld a,c
- cp 25d
- jp m,schx4
- jp z,schx4
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rbc),bc
- ld bc,(ret)
- push bc
- ld bc,(rbc)
- ret
-
- prmode: ds 2
-
- mpr: ds 2
-
- zeichs: ds 2
-
- ztabl: dw 0000d ;0
-
- dw 1024d ;2
-
- dw 2048d ;4
-
- dw 3072d ;6
-
- dw 4096d
-
- dw 5120d
-
- dw 6144d
-
- dw 7168d
-
- injn: ds 2
-
- rde: ds 2
-
- end
-
-
-
-
-