From 786407575b656d93674e617a169ab8569e44a836 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 17 Nov 2020 01:12:08 -0500 Subject: [PATCH] botdemo: some improvements reset out of dhgr mode for one titles for another --- bot_demo/Makefile | 2 +- bot_demo/TODO | 5 ++++ bot_demo/botdemo.s | 31 +++++++++++++------ bot_demo/commands.s | 55 +++++++++++++++++++++++++++++++++- bot_demo/timeline.inc | 46 +++++++++++++++++++++------- linker_scripts/apple2_6000.inc | 2 +- 6 files changed, 118 insertions(+), 23 deletions(-) diff --git a/bot_demo/Makefile b/bot_demo/Makefile index 92ada0db..db9cfa9b 100644 --- a/bot_demo/Makefile +++ b/bot_demo/Makefile @@ -10,7 +10,7 @@ all: bot_demo.dsk bot_demo.dsk: HELLO LOADER cp empty.dsk bot_demo.dsk $(DOS33) -y bot_demo.dsk BSAVE -a 0x1000 LOADER - $(DOS33) -y bot_demo.dsk BSAVE -a 0x6000 BOTDEMO MYSTERY +# $(DOS33) -y bot_demo.dsk BSAVE -a 0x6000 BOTDEMO MYSTERY $(DOS33) -y bot_demo.dsk SAVE A HELLO diff --git a/bot_demo/TODO b/bot_demo/TODO index c40d7695..a24ccf3d 100644 --- a/bot_demo/TODO +++ b/bot_demo/TODO @@ -4,3 +4,8 @@ + code to reset to 40-col text mode after interrupted also reset ROT=0? ++ credits + bars with music + scroll in both sides + lowercase + .oOo. diff --git a/bot_demo/botdemo.s b/bot_demo/botdemo.s index 105ffbe1..ad68d910 100644 --- a/bot_demo/botdemo.s +++ b/bot_demo/botdemo.s @@ -87,32 +87,45 @@ mockingboard_not_found: jsr mock_anim + + ;============================== + ;============================== + ;============================== + ; command loop + ;============================== + ;============================== + ;============================== + + command_loop: + + ; check if irq handler has set trigger because we hit limit + lda trigger beq not_trigger - lda #0 + lda #0 ; reset trigger sta trigger - lda command - cmp #DONE + lda command ; load current command (also set in irq) + cmp #DONE ; if done, just loop forever beq command_loop - cmp #DO_LIST + cmp #DO_LIST ; if command is list bne not_do_list - jmp do_list + jmp do_list ; then do it not_do_list: - cmp #DO_LOAD + cmp #DO_LOAD ; if command is load bne not_do_load - jsr do_load + jsr do_load ; then do it jmp not_trigger not_do_load: - cmp #DO_RUN + cmp #DO_RUN ; if command is run bne not_trigger - jmp do_run + jmp do_run ; then do it not_trigger: diff --git a/bot_demo/commands.s b/bot_demo/commands.s index 1fcd8ffa..6eb81d37 100644 --- a/bot_demo/commands.s +++ b/bot_demo/commands.s @@ -23,11 +23,16 @@ load_file: do_list: ; try to get things back to normal + bit SET_TEXT bit LORES bit PAGE0 bit TEXTGR - + lda #0 + sta $C00C ; disable 80 column display + sta $C000 ; disable 80 column memory mapping + sta $C05F ; clear annunicator 3 (double hires) + jsr SETNORM jsr TEXT jsr HOME @@ -37,6 +42,8 @@ do_list: sta cti_smc+2 jsr copy_to_input + jsr display_title + jmp run_command ; want to list from 0 to ffff @@ -58,6 +65,52 @@ do_list: ; rts + ;================= + ;================= + ; display title + ;================= + ;================= + +display_title: + + lda #' ' + ldx #39 +top_loop: + sta $6d0,X + dex + bpl top_loop + + lda which_file + sec + sbc #1 ; blurgh hack + asl + tay + lda title_list,Y + sta middle_smc+1 + lda title_list+1,Y + sta middle_smc+2 + + ldx #0 +middle_loop: +middle_smc: + lda $dede,X + eor #$80 + sta $750,X + + inx + cpx #40 + bne middle_loop + + lda #' ' + ldx #39 +bottom_loop: + sta $7d0,X + dex + bpl bottom_loop + + rts + + ;============================= ;============================= ; run run command diff --git a/bot_demo/timeline.inc b/bot_demo/timeline.inc index 8c7d0265..967daa78 100644 --- a/bot_demo/timeline.inc +++ b/bot_demo/timeline.inc @@ -11,16 +11,17 @@ todo_list: - .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; flame - .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; a2 + .byte DO_LOAD,1, DO_LIST,4, DO_RUN,5 ; flame + .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; a2 .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; flyer .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; nyan - .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; autumn - .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; rle - .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; raster + .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; rle + .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; raster + .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; qr .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; dhgr - .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; qr .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; circles + .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; autumn + .byte DONE,$FF @@ -29,24 +30,47 @@ file_list: .word a2,a2_end .word flyer,flyer_end .word nyan,nyan_end - .word autumn,autumn_end .word rle,rle_end .word raster,raster_end - .word dhgr,dhgr_end .word qr,qr_end + .word dhgr,dhgr_end .word circles,circles_end + .word autumn,autumn_end + title_list: + .word flame_title + .word a2_title .word flyer_title .word nyan_title + .word rle_title + .word raster_title .word qr_title + .word dhgr_title + .word circles_title + .word autumn_title +; 0123456789012345678901234567890123456789 +flame_title: + .byte " PSX DOOM FIRE " +a2_title: + .byte " LO-RES SELF PORTRAIT " flyer_title: - .byte 8,10,"HI-RES SHAPETABLE FLYER",0 + .byte " HI-RES SHAPETABLE FLYER " nyan_title: - .byte 8,10,"HI-RES ANIMATED NYAN CAT",0 + .byte " HI-RES ANIMATED NYAN CAT " qr_title: - .byte 0,10,"MYSTERY BAR CODE WILL NEVER LET YOU DOWN",0 + .byte " BAR CODE WILL NEVER LET YOU DOWN " +autumn_title: + .byte " HI-RES FRACTAL " +rle_title: + .byte " RLE SHAPES " +circles_title: + .byte " HYPNOTIC CIRCLES " +dhgr_title: + .byte " DHGR PATTERN " +raster_title: + .byte " DHGR COLOR BARS " flyer: diff --git a/linker_scripts/apple2_6000.inc b/linker_scripts/apple2_6000.inc index e768f873..b791e52a 100644 --- a/linker_scripts/apple2_6000.inc +++ b/linker_scripts/apple2_6000.inc @@ -1,6 +1,6 @@ MEMORY { ZP: start = $00, size = $1A, type = rw; - RAM: start = $6000, size = $3000, file = %O; + RAM: start = $6000, size = $4000, file = %O; } SEGMENTS {