ROM Monitor clears remaining input buffer and waits for GPU to be ready before starting
This commit is contained in:
parent
8ee4201dc8
commit
ae998ec3dc
|
@ -25,11 +25,13 @@ ROM_monitor_stack: equ 0x10ff ;upper TPA in RAM, below RAM monitor
|
||||||
;Needs to be called only once after computer comes out of reset.
|
;Needs to be called only once after computer comes out of reset.
|
||||||
;If called while port is active will cause port to fail.
|
;If called while port is active will cause port to fail.
|
||||||
;16x = 9600 baud
|
;16x = 9600 baud
|
||||||
initialize_port: ld a,04eh ;1 stop bit, no parity, 8-bit char, 16x baud
|
initialize: in a,(0x1E) ; Clear out input buffer
|
||||||
out (3),a ;write to control port
|
in a,(0x1F)
|
||||||
ld a,037h ;enable receive and transmit
|
and 0x01
|
||||||
out (3),a ;write to control port
|
jp nz, initialize
|
||||||
out (3),a ;write to control port
|
initialize_2: in a,(3) ; Wait for GPU to be ready
|
||||||
|
and 0x02
|
||||||
|
jp nz, initialize_2
|
||||||
ret
|
ret
|
||||||
;
|
;
|
||||||
;Puts a single char (byte value) on serial output
|
;Puts a single char (byte value) on serial output
|
||||||
|
@ -455,7 +457,7 @@ decimal_error_msg: defm 13,10,"Error: invalid decimal number, try again: ",0
|
||||||
;
|
;
|
||||||
;Simple monitor program for CPUville Z80 computer with serial interface.
|
;Simple monitor program for CPUville Z80 computer with serial interface.
|
||||||
monitor_cold_start: ld sp,ROM_monitor_stack
|
monitor_cold_start: ld sp,ROM_monitor_stack
|
||||||
call initialize_port
|
call initialize
|
||||||
ld hl,monitor_message
|
ld hl,monitor_message
|
||||||
call write_string
|
call write_string
|
||||||
monitor_warm_start: call write_newline ;routine program return here to avoid re-initialization of port
|
monitor_warm_start: call write_newline ;routine program return here to avoid re-initialization of port
|
||||||
|
|
Loading…
Reference in New Issue
Block a user