A83: Re: Re: Re: OK, a real question, it's about fun with text.


[Prev][Next][Index][Thread]

A83: Re: Re: Re: OK, a real question, it's about fun with text.




Heck, I felt like making that program so I put it here... just a nifty
program to scroll some text up the screen!
Sorry about sending so many messages... hehe

 .nolist
 #include "sos.inc"
 #include "joeti83.inc"
 .org  $9327
 .list

current_line =sram
text_count =sram+1

;* SOS program
 xor a
 jr start
 .dw 0
 .dw text

;* start of code
start: ld (current_line),a

;* Main loop
scroll_loop:
 ld hl,text_count
 ld a,(hl)
 inc a
 and 7
 ld (hl),a
 call z,drawText ; draw text every 8th time
 call scrollDisplay ; scroll the screen
 call bufcopy  ; display the new data
 ld b,15  ; short delay and key check
delay: push bc
 ei
 halt
 call getk
 or a
 pop bc
 ret nz
 djnz delay
 jr scroll_loop

;* Draw a line of text
drawText:
 set 7,(iy+20)
 ld hl,(63-6)*256+0
 ld (pencol),hl
 ld hl,current_line
 ld a,(hl)
 inc a
 cp 8
 jr nz,drawTextS
 ld a,1
drawTextS:
 ld (hl),a
 ld b,a
 ld hl,scroll_data
drawTextL:
 push bc
 xor a
 ld bc,-1
 cpir
 pop bc
 djnz drawTextL
 jp vputs

;* Scroll the Display
scrollDisplay:
 ld bc,768-12
 ld de,gbuf
 ld hl,gbuf+12
 ldir
 ld hl,gbuf+768-12
 ld b,12
scrollDisplayL:
 ld (hl),0
 inc hl
 djnz scrollDisplayL
 ret

scroll_data:
 .db 0
text: .db "Scroll Demo v1.0",0
 .db "by Joe Wingbermuehle",0
 .db "08-23-1998",0
 .db "joewing@usmo.com",0
 .db "www.usmo.com/joewing",0
 .db "Press any key!",0
 .db " ",0

.end
END