X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/2bcaaabf0bbbb0232fe8ffe0a8943a14159852ab..refs/heads/master:/xm.asm diff --git a/xm.asm b/xm.asm index d4b5374..3a4b25e 100644 --- a/xm.asm +++ b/xm.asm @@ -1,24 +1,23 @@ SECTION "wee",HOME[$0] ; this all needs to be PIC! -st: - ld sp, $CFFF - xor a - ld hl, $FF60 - ld [hli], a - ld [hli], a - ld [hli], a +; xor a +; ld hl, $FF60 +; ld [hli], a +; ld [hli], a +; ld [hli], a +st: ld sp, $CFFF nak: ld a, $15 ; NAK call putc+$FF80 .ack: call getc+$FF80 - cp $01 ;SOH - jr z,.soh +; cp $01 ;SOH +; jr z,.soh cp $04 ;EOT jr z, .eot cp $18 ;CAN jr z, .rst - jr .donak + jr nak .eot: ld A, $06 ; Ack the EOT @@ -27,26 +26,24 @@ nak: .soh: call getc+$FF80 ; blk call getc+$FF80 ; iblk - xor a - ld b, a - ld l, a - ld h, $C0 -.lp: call getc+$FF80 + ld b, $00 + ld hl, $C000 +.lp: bit 7, l + jr nz, .cksm + call getc+$FF80 ld [hli], a add b ld b, a - bit 7, l - jr z, .lp + jr .lp .cksm: call getc+$FF80 cp b jr nz, .donak ld hl, $C000 -.lp2: jr z, .doack - ld a, [hli] +.lp2: ld a, [hli] ld [$FF63], A bit 7, l jr z,.lp2 -.doack: ld A, $06 +.doack: ld A, $06 ; 06 call putc+$FF80 jr .ack .donak: call getc+$FF80 ; Wait until the line clears, and then once @@ -54,7 +51,7 @@ nak: getc: xor d - xor e + ;xor e ; Possibly not needed? .dgetc: dec de xor a @@ -66,11 +63,12 @@ getc: ld a, [$FF52] ret .timeout: - ld hl, $D000 + ld hl, $D010 ld a, [hl] inc a ld [hl], a ld [$FF51], a + pop hl jr nak putc: @@ -84,5 +82,5 @@ putc: ld [$FF52],a ret - section "a", HOME[$7F] - nop \ No newline at end of file + section "a", HOME[$7E] + nop