Wednesday, August 13, 2014

Troubleshooting Galaxy Ranger

I've been trying to troubleshoot a non-working Dexter setup with Galaxy Ranger and ended up writing some Z80 assembly language to modify the ROM for greater visibility.  This little code snippet will print the LD-V1000 status to the screen.  I am putting it here so I can find it again later if I need it :)

$D46 and $D47 should be changed from 0xCD 0x15 to 0x60 0x5B.  The new code should be put at location $5B60 (lives on the second EPROM) in memory which is filled with 0xFF's on the stock ROMs.

; modify Galaxy Ranger to display LD-V1000 status code during "WARM-UP"

        org 0x5b60
        ; preserve registers
        push hl
        push bc
        push af

        ; set target pointer
        ld hl, 0xF169   ; right above $F189 'warming up' text (each row is 0x20$
        ld a, (0xc800)  ; LD-V1000 I/O flip-flop
        ld b, a

        ; isolate top nibble
        srl     a                       ; A >>= 4
        srl     a
        srl     a
        srl     a
        cp      0xA     ; Acculumulator - 0xA is what?
        jr      c, Its0to9      ; if carry is set, it means subtraction resulte$

        ; A-F (hex)
        add     0x37    ; make it ASCII
        jr      StoreIt
        add     0x30    ; make it ASCII
        ld (hl), a
        inc hl

        ; now grab lower nibble
        ld a, 0xF
        and b

        cp 0xA
        jr      c, Its0to9_2
        add 0x37
        jr StoreIt2
        add 0x30
        ld (hl), a

        ; restore registers
        pop af
        pop bc
        pop hl

        ; go to where we were supposed to originally
        jp 0x15CD