prog8/python/testsource/input.ill

52 lines
939 B
Plaintext
Raw Normal View History

2018-01-11 23:55:47 +00:00
%output basic
2017-12-25 20:43:06 +00:00
2018-01-03 20:43:19 +00:00
%import c64lib
2017-12-25 20:43:06 +00:00
~ main {
2018-04-03 14:40:24 +00:00
var .str name = "????????????????????????????????????????????????????????????????????????????????" ; 80
var .word orig_irq
2017-12-25 20:43:06 +00:00
2018-01-03 20:43:19 +00:00
start:
2017-12-31 02:19:06 +00:00
c64.init_system()
2017-12-27 18:01:14 +00:00
orig_irq = c64.CINV
2017-12-25 20:43:06 +00:00
SI = 1
2018-01-05 21:52:23 +00:00
c64.CINV = &irq_handler
2017-12-25 20:43:06 +00:00
SI = 0
2017-12-27 22:45:22 +00:00
2017-12-31 02:19:06 +00:00
c64scr.print_string("enter your name: ")
c64scr.input_chars(name)
2017-12-25 20:43:06 +00:00
c64.CHROUT('\n')
2017-12-27 22:45:22 +00:00
2018-01-03 20:43:19 +00:00
blop:
2018-01-05 21:52:23 +00:00
return
%breakpoint
return
; yeah!
2017-12-27 22:45:22 +00:00
2017-12-31 02:19:06 +00:00
c64scr.print_string("thank you, mr or mrs: ")
c64scr.print_string(name)
2017-12-25 20:43:06 +00:00
c64.CHROUT('\n')
2017-12-25 21:22:19 +00:00
SI = 1
c64.CINV = orig_irq
2017-12-25 21:22:19 +00:00
SI = 0
2017-12-25 20:43:06 +00:00
return
2017-12-27 18:01:14 +00:00
2018-01-03 20:43:19 +00:00
irq_handler:
%asm {
lda c64.SFDX
cmp #$40 ; nothing pressed?
2017-12-25 20:43:06 +00:00
beq +
inc c64.EXTCOL ; otherwise change color
2017-12-25 20:43:06 +00:00
+ jmp c64.IRQDFRT
}
2018-01-05 21:52:23 +00:00
}