Browse Source

More fixes

Per Mårtensson 9 months ago
parent
commit
a6b13800b2
1 changed files with 65 additions and 48 deletions
  1. 65 48
      hw/monroe_oc8820_r3.00.asm

+ 65 - 48
hw/monroe_oc8820_r3.00.asm

@@ -75,7 +75,7 @@ displaymsg:
 	out (0d4h),a		;0050 clear io,Hi-res color
 	out (0d8h),a		;0052 clear io,Hi-res start
 	ld hl,0005ah		;0054
-	jp otirloop 		;0057 do OTIR loop on following data 00562h
+	jp screenclearentry 		;0057 do OTIR loop on following data 00562h
 	defb 0b5h		;005a io port CRT register select
 	defb 004h		;005b count 4
 	defb 0cfh		;005c
@@ -135,11 +135,12 @@ displaymsg:
 	defb 000h		;0089 io port reset
 	defb 000h		;008a count 0 terminator
 	;code continues
-	ld ix,00092h		;008b continuation addr
+	ld ix,initcontinue		;008b continuation addr 00092h
 	jp setupclearscreen		;008f setup display and clear screen  00505h
 	;code continues
+initcontinue:
 	ld a,080h		;0092
-	out (0d4h),a		;0094 out 0d4h,80h Hi-res color
+	out (0d4h),a		;0094 out 0d4h,80h Hi-res color enable copy
 	ld de,displaymem		;0096 point to display upper left corner 03000h
 	ld hl,msgtesting		;0099 point to message 0009fh
 	jp displaymsg	;009c go display message at HL 00011h
@@ -254,8 +255,9 @@ memcmp:
 	jp setupcrt			;013c 0058ch
 memcheckdisplay:
 	ld de,displaymem		;013f  03000h
-	ld hl,00148h		;0142
+	ld hl,callservicemsg2	;0142 00148h	
 	jp displaymsg		;0145  00011h
+callservicemsg2:
 	defb 017h		;0148 count 23
 	defb 045h		;0149 Error #2 :Call service.
 	defb 072h		;014a
@@ -296,11 +298,13 @@ floppystart2:
 	ld bc,0005ah		;0174
 	ldir		;0177
 	call setupclearscreen2		;0179 00503h
+readydiskloop:
 	call readydisk		;017c 003d9h
 	call 0061ch		;017f
 	ld a,0ffh		;0182
-	jr c,$+3		;0184
+	jr c,skipinvert		;0184 $+3
 	cpl			;0186
+skipinvert:
 	ld (0ff93h),a		;0187
 	ld hl,00404h		;018a
 	ld (0ff91h),hl		;018d
@@ -335,7 +339,7 @@ floppystart2:
 	in a,(0b0h)		;01d2 Floppy status
 	add a,a			;01d4
 	jr c,$+8		;01d5
-	call 0057dh		;01d7
+	call delayloop		;01d7 0057dh
 	call loadingdisk	;01da 00262h
 	inc c			;01dd
 	ld a,b			;01de
@@ -389,13 +393,14 @@ floppystart2:
 	defb 06eh		;022f
 	defb 065h		;0230
 	defb 02eh		;0231
-	call 0057dh		;0232
-	call 0057dh		;0235
-	call 0057dh		;0238
-	jp 0017ch		;023b
-	ld ix,00245h		;023e
-	jp 0058ch		;0242
-	call 0056bh		;0245
+	call delayloop 		;0232 0057dh
+	call delayloop		;0235 0057dh
+	call delayloop		;0238 0057dh
+	jp readydiskloop		;023b 0017ch
+	ld ix,returnsetupcrt1		;023e 00245h
+	jp setupcrt		;0242 0058ch
+returnsetupcrt1:
+	call screenclearnetry2		;0245 0056bh
 	rst 10h			;0248
 	defb 017h		;0249 count 23
 	defb 045h		;024a Error #0: Call service.
@@ -562,7 +567,7 @@ loadingdisk:
 	ld a,031h		;034f
 	push ix		;0351
 	push af			;0353
-	call 0056bh		;0354
+	call screenclearnetry2		;0354 0056bh
 	push de			;0357
 	rst 10h			;0358
 	defb 028h		;0359 count 40
@@ -617,8 +622,8 @@ loadingdisk:
 	ld (hl),b			;038e
 	xor a			;038f
 	out (0c8h),a		;0390 Map and system control
-	call 0057dh		;0392
-	call 0057dh		;0395
+	call delayloop		;0392 0057dh
+	call delayloop		;0395 0057dh
 	call setupclearscreen2		;0398 00503h
 	call readydisk		;039b 003d9h
 	exx			;039e
@@ -693,7 +698,7 @@ readydisk:
 	defb 073h		;03f8
 	defb 06bh		;03f9
 	defb 020h		;03fa
-	call 0057dh		;03fb
+	call delayloop		;03fb 0057dh
 	ret			;03fe
 	ld b,00ah		;03ff
 	ld hl,00000h		;0401
@@ -749,7 +754,7 @@ readydisk:
 	pop bc			;0453
 	pop hl			;0454
 	ld a,01dh		;0455
-	call 004b6h		;0457
+	call setfloppystatus	;0457 004b6h	
 	and 098h		;045a
 	jr nz,$+42		;045c
 	call 004c1h		;045e
@@ -758,7 +763,7 @@ readydisk:
 	ld a,082h		;0466
 	jr z,$+4		;0468
 	ld a,08ah		;046a
-	call 004b6h		;046c
+	call setfloppystatus		;046c 004b6h
 	and 09ch		;046f
 	jr nz,$+21		;0471
 	inc h			;0473setupclearscreen
@@ -799,11 +804,12 @@ readydisk:
 	cp 010h		;04a7
 	jp nc,00788h		;04a9
 	ld a,001h		;04ac
-	call 004b6h		;04ae
+	call setfloppystatus	;04ae 004b6h	
 	and 004h		;04b1
 	ret nz			;04b3
 	scf			;04b4
 	ret			;04b5
+setfloppystatus:
 	out (0b0h),a		;04b6 Floppy status
 	in a,(0b4h)		;04b8
 	bit 4,a		;04ba
@@ -852,14 +858,16 @@ setupclearscreen:
 	xor a			;0505 start A=0
 	ld bc,00eb9h		;0506 C=B9 B=14
 	ld hl,0054fh		;0509
+setupclearloop:
 	out (0b8h),a		;050c CRT register select
 	inc a				;050e A++
 	outi				;050f C)=(HL++) and B--
-	jr nz,$-5			;0511 loop until B==0 (14 bytes to write)
+	jr nz,setupclearloop 			;0511 loop until B==0 (14 bytes to write) $-5
 	ld de,03002h		;0513
 	ld hl,displaymem		;0516 03000h
 	ld bc,00ffeh		;0519
 ;RST 08 jump in here HL=300C DE=300E BC=4E IX=032F
+clear300c:
 	ld a,004h			;051c Select display memory
 	out (0c8h),a		;051e Output to screen out C8,04 Map and system control
 	xor a				;0520 
@@ -880,9 +888,10 @@ cleartopline:
 	inc de				;0531
 	ld bc,0004eh		;0532 80-2
 	push ix				;0535 save old IX
-	ld ix,0053dh		;0537 exit addr
-	jr $-31				;053b clear line 300C 80char
+	ld ix,clearlineend		;0537 exit addr 0053dh
+	jr clear300c				;053b clear line 300C 80char $-31
 	;clear line returns here
+clearlineend:
 	pop ix				;053d restore old IX
 	pop de				;053f restore old DE
 	ret					;0540
@@ -920,18 +929,19 @@ printcharloop:
 	pop hl			;055d
 	jr $+4				;055e
 ;
-
+screenclearloop:
 	otir				;0560 out B bytes from (HL) to (C)
 ;
-	otirloop:
+	screenclearentry:
 	ld c,(hl)			;0562 get register
 	inc hl				;0563 bump
 	ld b,(hl)			;0564 get count
 	inc hl				;0565 bump
 	ld a,b				;0566 evaluate count
 	and a				;0567
-	jr nz,$-8			;0568 if count not 0 loop
+	jr nz,screenclearloop			;0568 if count not 0 loop $-8
 	jp (hl)				;056a
+screenclearnetry2:
 	ld de,03100h		;056b
 	ld a,00fh			;056e
 	out (0b8h),a		;0570 CRT register select
@@ -943,6 +953,7 @@ printcharloop:
 	ld de,030a0h		;0579
 	ret					;057c
 ;
+delayloop:
 	ld hl,04600h		;057d
 	dec hl				;0580
 	ex (sp),hl			;0581
@@ -1049,7 +1060,7 @@ setupcrt:
 	djnz $-6		;062c
 	scf			;062e
 	ret			;062f
-	call 00723h		;0630
+	call reading		;0630 00723h
 	ret c			;0633
 	in a,(0ffh)		;0634
 	rra			;0636
@@ -1062,7 +1073,7 @@ setupcrt:
 	jr z,$+5		;0643
 	ld hl,007cah		;0645
 	call 0076bh		;0648
-	call 00723h		;064b
+	call reading		;064b 00723h
 	ret c			;064e
 	ld de,0ff8dh		;064f
 	ld bc,00004h		;0652
@@ -1082,16 +1093,16 @@ setupcrt:
 	inc hl			;066d
 	ld (hl),000h		;066e
 	djnz $-3		;0670
-	call 00723h		;0672
+	call reading		;0672 00723h
 	ret c			;0675
-	call 0074bh		;0676
-	call 00738h		;0679
+	call moveoutreseta		;0676 0074bh
+	call reading2 		;0679 00738h
 	and 002h		;067c
 	ret z			;067e
 	scf			;067f
 	ret			;0680
 	push bc			;0681
-	call 0056bh		;0682
+	call screenclearnetry2		;0682 0056bh
 	rst 10h			;0685
 	defb 028h		;0686 sount 40
 	defb 045h		;0687 Error 1: Disk system error, Call Service
@@ -1134,9 +1145,9 @@ setupcrt:
 	defb 069h		;06ac
 	defb 063h		;06ad
 	defb 065h		;06ae
-	call 0057dh		;06af
-	call 0057dh		;06b2
-	call 0057dh		;06b5
+	call delayloop		;06af 0057dh
+	call delayloop		;06b2 0057dh
+	call delayloop		;06b5 0057dh
 	call setupclearscreen2		;06b8 00503h
 	call readydisk		;06bb 003d9h
 	pop bc			;06be
@@ -1166,14 +1177,14 @@ setupcrt:
 	and 044h		;06ed
 	jr nz,$-4		;06ef
 	out (07bh),a		;06f1 ????
-	call 00738h		;06f3
+	call reading2		;06f3 00738h
 	and 002h		;06f6
 	call nz,006ffh		;06f8
 	pop hl			;06fb
 	pop bc			;06fc
 	inc bc			;06fd
 	ret			;06fe
-	call 00723h		;06ff
+	call reading		;06ff 00723h
 	ret c			;0702
 	ld a,003h		;0703
 	call 0074dh		;0705
@@ -1184,12 +1195,13 @@ setupcrt:
 	jr nz,$-4		;0712
 	ini		;0714
 	jr nz,$-8		;0716
-	call 00738h		;0718
+	call reading2		;0718 00738h
 	ld a,(0ff89h)		;071b
 	sub 098h		;071e
 	ret z			;0720
 	scf			;0721
 	ret			;0722
+reading:
 	in a,(079h)		;0723
 	and 080h		;0725
 	scf			;0727
@@ -1203,6 +1215,7 @@ setupcrt:
 	djnz $-5		;0734
 	scf			;0736
 	ret			;0737
+reading2:
 	in a,(079h)		;0738
 	and 044h		;073a
 	jr nz,$-4		;073c
@@ -1214,15 +1227,18 @@ setupcrt:
 	in a,(078h)		;0747
 	ld a,b			;0749
 	ret			;074a
+moveoutreseta:
 	ld a,000h		;074b
-	call 00760h		;074d
+moveout:
+	call stepout		;074d 00760h
 	ld a,(0ff84h)		;0750
-	call 00760h		;0753
+	call stepout		;0753 00760h
 	ld a,000h		;0756
 	ld b,004h		;0758
-	call 00760h		;075a
+	call stepout		;075a 00760h
 	djnz $-3		;075d
 	ret			;075f
+stepout:
 	push af			;0760
 	in a,(079h)		;0761
 	and 041h		;0763
@@ -1231,7 +1247,7 @@ setupcrt:
 	out (078h),a		;0768 Step out
 	ret			;076a
 	ld a,00ch		;076b
-	call 0074dh		;076d
+	call moveout		;076d 0074dh
 	ld bc,00878h		;0770
 	in a,(079h)		;0773
 	cp 007h		;0775
@@ -1240,20 +1256,21 @@ setupcrt:
 	jr nz,$-8		;077b
 	jr $-69		;077d
 	ld a,0e4h		;077f
-	call 00794h		;0781
+	call steproutine		;0781 00794h
 	ret z			;0784
 	jp 00681h		;0785
-	call 00723h		;0788
+	call reading		;0788 00723h
 	ret c			;078b
 	ld a,001h		;078c
-	call 00794h		;078e
+	call steproutine		;078e 00794h
 	ret z			;0791
 	jr $+11		;0792
-	call 0074dh		;0794
-	call 00738h		;0797
+steproutine:
+	call moveout		;0794 0074dh
+	call reading2	;0797 00738h	
 	and 002h		;079a
 	ret			;079c
-	call 0056bh		;079d
+	call screenclearnetry2		;079d 0056bh
 	rst 10h			;07a0
 	defb 027h		;07a1 count 39
 	defb 045h		;07a2 Error 3: Disk Malfunction, Call Service