Browse Source

More work

Per Mårtensson 9 months ago
parent
commit
8a98220bd5
1 changed files with 84 additions and 77 deletions
  1. 84 77
      hw/monroe_oc8820_r3.00.asm

+ 84 - 77
hw/monroe_oc8820_r3.00.asm

@@ -64,12 +64,12 @@ displaymsg:
 	; init
 	init:
 	out (0c0h),a		;0046 clear io, floppy control
-	out (0c4h),a		;0048 Program map A base
-	out (0c5h),a		;004a Program map B base
-	out (0c6h),a		;004c DMA map A base
-	out (0c7h),a		;004e DMA map B base
-	out (0d4h),a		;0050 Hi-res color
-	out (0d8h),a		;0052 Hi-res start
+	out (0c4h),a		;0048 clear io,Program map A base
+	out (0c5h),a		;004a clear io,Program map B base
+	out (0c6h),a		;004c clear io,DMA map A base
+	out (0c7h),a		;004e clear io,DMA map B base
+	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
 	defb 0b5h		;005a io port CRT register select
@@ -104,7 +104,7 @@ displaymsg:
 	defb 0c1h		;0074
 ;
 	defb 0a5h		;0075 io port SIO A command
-	defb 002h		;0076count 2
+	defb 002h		;0076 count 2
 	defb 048h		;0077
 	defb 048h		;0078
 ;
@@ -148,95 +148,100 @@ displaymsg:
 	defb 06eh		;00a5	n
 	defb 067h		;00a6	g
 	defb 02eh		;00a7	.
-	ld a,005h		;00a8
+	ld a,005h			;00a8
 	out (0a3h),a		;00aa DART B command
-	ld a,068h		;00ac
+	ld a,068h			;00ac
 	out (0a3h),a		;00ae DART B command
-	ld a,0f0h		;00b0 ?????
+	ld a,0f0h			;00b0 ?????
 	out (0c8h),a		;00b2 Map and system control
 	ld ix,0c001h		;00b4
 	ld bc,000c5h		;00b8 
-	ld d,009h		;00bb
-	ld a,0a0h		;00bd
+	ld d,009h			;00bb
+	ld a,0a0h			;00bd
 	out (0c5h),a		;00bf Program map B base
 	ld (ix-001h),b		;00c1
-	dec b			;00c4
-	inc a			;00c5
+	dec b				;00c4
+	inc a				;00c5
 	out (0c5h),a		;00c6 Program map B base
 	ld (ix-001h),b		;00c8
-	dec a			;00cb
+	dec a				;00cb
 	out (0c5h),a		;00cc Program map B base
 	ld b,(ix-001h)		;00ce
-	inc b			;00d1
-	jr z,$+4		;00d2
-	ld d,011h		;00d4
-	ld b,d			;00d6
+	inc b				;00d1
+	jr z,$+4			;00d2
+	ld d,011h			;00d4
+	ld b,d				;00d6
 	ld hl,00122h		;00d7
 	ld de,00000h		;00da
-	outi		;00dd
-	jr z,$+84		;00df
-	exx			;00e1
-	ld b,055h		;00e2 memory check ?
-	ld e,000h		;00e4
+beginmemtest:
+	outi				;00dd
+	jr z,$+84			;00df
+	exx					;00e1
+	ld b,055h			;00e2 memory check ?
+	ld e,000h			;00e4
+memtestloop:
 	ld hl,0c000h		;00e6 graphic memory address
-	ld c,b			;00e9
+	ld c,b				;00e9
+memtestwriteloop:	
 	ld (hl),c			;00ea
-	rlc c		;00eb
-	inc l			;00ed
-	jr nz,$-4		;00ee
-	rlc c		;00f0
-	inc h			;00f2
-	jr nz,$-9		;00f3
-	ld h,0c0h		;00f5
-	ld c,b			;00f7
+	rlc c				;00eb
+	inc l				;00ed
+	jr nz,$-memtestwriteloop			;00ee -4
+	rlc c				;00f0
+	inc h				;00f2
+	jr nz,$-9memtestwriteloop			;00f3 -9
+	ld h,0c0h			;00f5
+	ld c,b				;00f7
+memtestreadloop:
 	ld a,(hl)			;00f8
-	xor c			;00f9
-	or e			;00fa
-	ld e,a			;00fb
-	rlc c		;00fc
-	inc l			;00fe
-	jr nz,$-7		;00ff
-	rlc c		;0101
-	inc h			;0103
-	jr nz,$-12		;0104
-	rlc b		;0106
-	jr nc,$-34		;0108
-	ld a,e			;010a
-	exx			;010b
-	and a			;010c
-	jr z,$+10		;010d
-	inc a			;010f
-	jr z,$+6		;0110
-	or d			;0112
-	ld d,a			;0113
-	jr $+3		;0114
-	inc e			;0116
-	ld a,b			;0117
-	cp 004h		;0118
-	jr nz,$-61		;011a
-	ld a,020h		;011c
+	xor c				;00f9
+	or e				;00fa
+	ld e,a				;00fb
+	rlc c				;00fc
+	inc l				;00fe
+	jr nz,$-memtestreadloop			;00ff -7
+	rlc c				;0101
+	inc h				;0103
+	jr nz,$-memtestreadloop			;0104 -12
+	rlc b				;0106
+	jr nc,$-memtestloop				;0108 -34
+	ld a,e				;010a
+	exx					;010b
+	and a				;010c
+	jr z,$+memfloppycon			;010d +10
+	inc a				;010f
+	jr z,$+memfloppycon			;0110 +6
+	or d				;0112
+	ld d,a				;0113
+	jr $+memfloppycon					;0114 +3
+	inc e				;0116
+memfloppycon:
+	ld a,b				;0117
+	cp 004h				;0118
+	jr nz,$-beginmemtest			;011a -61
+	ld a,020h			;011c
 	out (0c0h),a		;011e Floppy external control
-	jr $-67		;0120
-	and c			;0122
-	pop bc			;0123
-	pop hl			;0124
-	nop			;0125
-	jr nz,$+66		;0126
-	ld h,b			;0128
-	add a,b			;0129
-	and b			;012a
-	ret nz			;012b
-	ret po			;012c
+	jr $-beginmemtest			;0120 -67
+	and c				;0122
+	pop bc				;0123
+	pop hl				;0124
+	nop					;0125
+	jr nz,$+floppystart2			;0126 +66
+	ld h,b				;0128
+	add a,b				;0129
+	and b				;012a
+	ret nz				;012b
+	ret po				;012c
 	ld bc,04121h		;012d
-	ld h,c			;0130
-	add a,c			;0131
-	nop			;0132
-	xor a			;0133
-	or d			;0134
-	or e			;0135
-	jr z,$+43		;0136; 
+	ld h,c				;0130
+	add a,c				;0131
+	nop					;0132
+	xor a				;0133
+	or d				;0134
+	or e				;0135
+	jr z,$+floppystart			;0136; +43
 	ld ix,0013fh		;0138
-	jp 0058ch		;013c
+	jp 0058ch			;013c
 	ld de,03000h		;013f
 	ld hl,00148h		;0142
 	jp displaymsg		;0145  00011h
@@ -265,11 +270,13 @@ displaymsg:
 	defb 065h		;015e
 	defb 02eh		;015f
 	halt			;0160
+floppystart:
 	out (0c5h),a		;0161 Program map B base
 	out (0c8h),a		;0163 Map and system control
 	dec hl			;0165
 	dec hl			;0166
 	ld a,(hl)			;0167
+floppystart2:
 	rrca			;0168
 	and 080h		;0169
 	ld (0ff80h),a		;016b