ytmytm / c128-z80-8mhz

Double the clock speed of Z80 in C128
19 stars 2 forks source link

OUTI bug present? #1

Open ytmytm opened 5 months ago

ytmytm commented 5 months ago

A C128 hardware bug: https://dr.ea.ms/c128hardwarebug.html

OUTI OUTIR OUTD OUDR

Don't work on C128. A bit surprisingly they don't seem to work with 8Mhz speedup too, even though the CPU should be stopped as soon as /IORQ is requested. The test program stores only zeros to $d020 (also - why zeros?).

Test code for Double-Ass:


10  *= $8000
20  .lis s
30  .obj memory
40  sei
50  lda $d505 :pha
60  lda $ff00 :pha
70  lda #$c3  :sta $ffee
80  lda #<z80 :sta $ffef
90  lda #>z80 :sta $fff0
100 lda #$3e  :sta $ff00
110 lda #$00  :sta $d030
120 lda #$00  :sta $d020 :sta $d021
130 lda #$b0  :sta $d505
140 nop
150 pla       :sta $ff00
160 pla       :sta $d505
165 lda #$cf  :sta $ffee
499 cli       :rts
500 :
510 z80 .mod 1
515 :
520 jp testing
525 testdata:
530 .byt 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
535 testing:
537 ld de, $2000
542 outloop:
545 ld hl,testdata  ; index of the test data
550 xor a           ; zero the counter
555 tlp:
556 ld bc, $d020    ; border
560 outi            ; send test data
570 inc a           ; increment counter
580 cp 16           ; 16 bytes yet?
585 jp nz,tlp       ; no, do more
590 dec de
595 jp outloop
999 jp $ffe0        ; back to 8502

RUN and start in MONITOR: J 08000