aboutsummaryrefslogtreecommitdiffstats
path: root/src/tty.asm
blob: d2c12343382d3e2030c98cbbac7a4bfb14686a6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; =============================================================================
; tty.asm - console output over the serial port (emulator debug channel).
; A real gbos would render to VRAM; serial is a zero-VRAM stub that shows up
; in emulator serial logs (bgb/SameBoy) and on link hardware.
; =============================================================================
INCLUDE "include/gbos.inc"

SECTION "tty", ROM0

; PutChar - A = character. Push to serial data and kick a transfer.
PutChar::
    ld [rSB], a
    ld a, $81               ; start transfer, internal clock
    ld [rSC], a
    ret