You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.0 KiB
58 lines
1.0 KiB
include "charmap.inc"
|
|
include "video.inc"
|
|
include "hardware.inc"
|
|
|
|
section "prog/serial_test.asm", rom0
|
|
|
|
prog_serial_test::
|
|
call lcd_disable
|
|
call font_load
|
|
call pals_set_bw
|
|
call lcd_enable
|
|
|
|
ld hl, string_title
|
|
bgcoord de, (screen_width - string_title.end + string_title + 1) / 2, 2
|
|
call print
|
|
|
|
call serial_init_master
|
|
|
|
main_loop:
|
|
call joypad_update
|
|
bit joy_a_f, a
|
|
jr nz, .send_shit
|
|
|
|
bgcoord hl, 7, 5
|
|
call lcd_blank_wait
|
|
ld [hl], " "
|
|
|
|
.continue
|
|
call vblank_wait
|
|
jr main_loop
|
|
|
|
.send_shit
|
|
call vblank_wait
|
|
call joypad_update
|
|
bit joy_a_f, a
|
|
jr nz, .send_shit
|
|
|
|
bgcoord hl, 7, 5
|
|
call lcd_blank_wait
|
|
ld [hl], "A"
|
|
ld hl, transfer_buffer
|
|
ld de, NULL
|
|
ld bc, transfer_buffer.end - transfer_buffer
|
|
call serial_transfer
|
|
|
|
.send_shit_wait
|
|
call vblank_wait
|
|
call serial_finished
|
|
jr nz, .send_shit_wait
|
|
|
|
jr .continue
|
|
|
|
transfer_buffer:
|
|
db $00, $11, $22, $33, $44, $55, $66, $77, $88, $99, $AA, $BB, $CC, $DD, $EE, $FF
|
|
.end
|
|
|
|
string_title: db "SERIAL TEST$"
|
|
.end
|
|
|