2018-01-01 22:24:39 +00:00
|
|
|
%output prg,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-01-03 20:43:19 +00:00
|
|
|
var .text name = "????????????????????????????????????????????????????????????????????????????????" ; 80
|
2018-01-01 22:24:39 +00:00
|
|
|
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
|
|
|
|
2018-01-01 22:24:39 +00:00
|
|
|
orig_irq = c64.CINV
|
2017-12-25 20:43:06 +00:00
|
|
|
SI = 1
|
2017-12-25 21:22:19 +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-01 22:24:39 +00:00
|
|
|
%breakpoint ; 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
|
2018-01-01 22:24:39 +00:00
|
|
|
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:
|
2018-01-01 22:24:39 +00:00
|
|
|
%asm {
|
|
|
|
lda c64.SFDX
|
|
|
|
cmp #$40 ; nothing pressed?
|
2017-12-25 20:43:06 +00:00
|
|
|
beq +
|
2018-01-01 22:24:39 +00:00
|
|
|
inc c64.EXTCOL ; otherwise change color
|
2017-12-25 20:43:06 +00:00
|
|
|
+ jmp c64.IRQDFRT
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-01-01 22:24:39 +00:00
|
|
|
|
2017-12-25 20:43:06 +00:00
|
|
|
}
|