;###############################################| ;F-Sched | ;By: Adam King | ; (c) 1997 | ; | ;###############################################| @program prog_code,prog_name include macros.h ;############### Start of Code ############# prog_code: jsr reclib[init] ;Recover Library jsr flib[clr_scr] ;starting crap lea $4440,a4 lea 150(a4),a4 ;loads the position of the sprite lea tab1(pc),a5 move.l #8,d3 lea page_data(pc),a0 move.l #0,(a0) tab_loop: ;-----------------------------------------------' ;Rutien to put a sprite for a word and long word' ;a4= lcd_mem location ' ;a5= sprite_data ' ;a6= remembered position ' ;d3= length of sprite in lines(minus 1) ' ;-----------------------------------------------' put_long_word_sprite: move.l (a5)+,(a4) ;put long word on screen lea 30(a4),a4 ;move to next line on screen dbra d3,put_long_word_sprite ;see if your at the end of the sprite lea 120(a4),a4 ;loads the position of the sprite lea tab1(pc),a5 move.l #8,d3 cmp #20502,a4 blt put_long_word_sprite DrawBox #31,#0,#239,#119 SetFont #0 WriteStr #4,#7,#1,monday WriteStr #4,#20,#1,tuesday WriteStr #4,#33,#1,wednesday WriteStr #4,#46,#1,thursday WriteStr #4,#59,#1,friday WriteStr #4,#72,#1,saturday WriteStr #4,#85,#1,sunday WriteStr #4,#98,#1,exit_data jsr flib[idle_loop] cmp #268,d0 beq mon cmp #269,d0 beq tues cmp #270,d0 beq wed cmp #271,d0 beq thurs cmp #272,d0 beq fri cmp #273,d0 beq sat cmp #274,d0 beq sun cmp #275,d0 beq exit mon: lea page_data(pc),a1 move.w #150,2(a1) lea monday_data(pc),a0 bra text_editor_setup tues: lea page_data(pc),a1 move.w #540,2(a1) lea tuesday_data(pc),a0 bra text_editor_setup wed: lea page_data(pc),a1 move.w #930,2(a1) lea wednesday_data(pc),a0 bra text_editor_setup thurs: lea page_data(pc),a1 move.w #1320,2(a1) lea thursday_data(pc),a0 bra text_editor_setup fri: lea page_data(pc),a1 move.w #1710,2(a1) lea friday_data(pc),a0 bra text_editor_setup sat: lea page_data(pc),a1 move.w #2100,2(a1) lea saturday_data(pc),a0 bra text_editor_setup sun: lea page_data(pc),a1 move.w #2490,2(a1) lea sunday_data(pc),a0 bra text_editor_setup text_editor_setup: ;start of scedulaing stuff movem.l d0-d7/a0-a6,-(a7) SetFont #1 movem.l (a7)+,d0-d7/a0-a6 move.l a0,day_data ;saves address of day data move.l #117,d0 ;clears editor screen lea $4440,a0 lea 30(a0),a0 text_editor_clear: move.l #0,4(a0) move.l #0,8(a0) move.l #0,12(a0) move.l #0,16(a0) move.l #0,20(a0) move.l #0,24(a0) move.w #2,28(a0) lea 30(a0),a0 dbra d0,text_editor_clear ;writes old data to the screen move.l day_data,a6 move.l #32,d0 ;x-pos of character move.l #2,d1 ;y-pos of character move.l #475,d2 text_editor_display: clr.l d3 move.b (a6),d3 cmp #0,d3 beq editor_display_zero cmp #13,d3 beq editor_display_return movem.l d0-d7/a0-a6,-(a7) WriteChar d0,d1,#1,d3 movem.l (a7)+,d0-d7/a0-a6 addq #6,d0 cmp #235,d0 bgt editor_display_return lea 1(a6),a6 dbra d2,text_editor_display bra editor_display_end editor_display_return: lea 1(a6),a6 move.l #32,d0 addq #8,d1 bra text_editor_display editor_display_zero: movem.l d0-d7/a0-a6,-(a7) WriteChar d0,d1,#1,#32 movem.l (a7)+,d0-d7/a0-a6 addq #6,d0 cmp #235,d0 bgt editor_display_return lea 1(a6),a6 dbra d2,text_editor_display bra editor_display_end editor_display_end: lea $4440,a4 ;removes old tab pic lea page_data(pc),a0 move.l #0,d0 move.w (a0),d0 cmp #0,d0 beq text_editor_tab add d0,a4 add #30,a4 lea tab2(pc),a5 move.l #8,d3 put_tab_one: move.l (a4),d0 move.l (a5)+,d1 eor.l d0,d1 move.l d1,(a4) ;put long word on screen lea 30(a4),a4 ;move to next line on screen dbra d3,put_tab_one ;see if your at the end of the sprite text_editor_tab: lea $4440,a4 lea page_data(pc),a0 move.l #0,d0 move.w 2(a0),d0 move.w d0,(a0) add d0,a4 add #30,a4 lea tab2(pc),a5 move.l #8,d3 put_tab: move.l (a4),d0 move.l (a5)+,d1 eor.l d0,d1 move.l d1,(a4) ;put long word on screen lea 30(a4),a4 ;move to next line on screen dbra d3,put_tab ;see if your at the end of the sprite movem.l d0-d7/a0-a6,-(a7) SetFont #1 movem.l (a7)+,d0-d7/a0-a6 move.l day_data,a6 move.l #32,d1 move.l #2,d2 ;d0= char value from flib[idle_loop] ;d1= x_position ;d2= y_position text_editor: jsr flib[idle_loop] ;looks for key press, stores key value in d0 cmp #268,d0 beq mon cmp #269,d0 beq tues cmp #270,d0 beq wed cmp #271,d0 beq thurs cmp #272,d0 beq fri cmp #273,d0 beq sat cmp #274,d0 beq sun cmp #275,d0 beq exit cmp #264,d0 beq exit cmp #13,d0 beq text_editor_return movem.l d0-d7/a0-a6,-(a7) WriteChar d1,d2,#1,d0 movem.l (a7)+,d0-d7/a0-a6 move.b d0,(a6) lea 1(a6),a6 add #6,d1 cmp #235,d1 bgt carage_return bra text_editor carage_return: move.l #32,d1 addq.l #8,d2 bra text_editor text_editor_return move.b d0,(a6) lea 1(a6),a6 move.l #32,d1 addq.l #8,d2 bra text_editor exit: rts ;########## Data Section ############## prog_name: dc.b "F-Sced Vs. 1.0",0 monday dc.b "F1 Mon",0 tuesday dc.b "F2 Tues",0 wednesday dc.b "F3 Wed",0 thursday dc.b "F4 Thur",0 friday dc.b "F5 Fri",0 saturday dc.b "F6 Sat",0 sunday dc.b "F7 Sun",0 exit_data dc.b "F8 Exit",0 monday_data ds.b 476 ;reserves 476 bytes for the screen data tuesday_data ds.b 476 wednesday_data ds.b 476 thursday_data ds.b 476 friday_data ds.b 476 saturday_data ds.b 476 sunday_data ds.b 476 day_data dc.l 0 page_data dc.w 0 ;old offset possition of tab dc.w 0 ;new offset possition of tab tab1 dc.l %00011111111111111111111111111111 dc.l %01100000000000000000000000000000 dc.l %10000000000000000000000000000000 dc.l %10000000000000000000000000000000 dc.l %10000000000000000000000000000000 dc.l %10000000000000000000000000000000 dc.l %10000000000000000000000000000000 dc.l %01100000000000000000000000000000 dc.l %00011111111111111111111111111111 tab2 dc.l %00000000000000000000000000000001 dc.l %00000000000000000000000000000001 dc.l %00000000000000000000000000000001 dc.l %00000000000000000000000000000001 dc.l %00000000000000000000000000000001 dc.l %00000000000000000000000000000001 dc.l %10000000000000000000000000000001 dc.l %01100000000000000000000000000000 dc.l %00011111111111111111111111111110 ;=========END FARGO PROGRAM=========== reloc_open add_library reclib add_library romlib add_library flib reloc_close end