diff --git a/bot_demo/Makefile b/bot_demo/Makefile index 3d6c38de..3bf7d317 100644 --- a/bot_demo/Makefile +++ b/bot_demo/Makefile @@ -5,13 +5,31 @@ TOKENIZE = ../asoft_basic-utils/tokenize_asoft all: bot_demo.dsk -bot_demo.dsk: RLE +bot_demo.dsk: HELLO BOTDEMO cp empty.dsk bot_demo.dsk - $(DOS33) -y bot_demo.dsk BSAVE -a 0x036c RLE + $(DOS33) -y bot_demo.dsk BSAVE -a 0x6000 BOTDEMO + $(DOS33) -y bot_demo.dsk SAVE A HELLO ### +BOTDEMO: botdemo.o + ld65 -o BOTDEMO botdemo.o -C ../linker_scripts/apple2_6000.inc + +botdemo.o: botdemo.s \ + zp.inc hardware.inc nozp.inc \ + load.s \ + interrupt_handler.s + ca65 -o botdemo.o botdemo.s -l botdemo.lst + + +### + +HELLO: hello.bas + ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO + +### + RLE: rle.o ld65 -o RLE rle.o -C ./apple2_custom.inc @@ -21,4 +39,4 @@ rle.o: rle.s #### clean: - rm -f *~ *.o *.lst RLE + rm -f *~ *.o *.lst RLE BOTDEMO diff --git a/bot_demo/apple2_custom.inc b/bot_demo/apple2_custom.inc deleted file mode 100644 index dddae43f..00000000 --- a/bot_demo/apple2_custom.inc +++ /dev/null @@ -1,12 +0,0 @@ -MEMORY { - ZP: start = $00, size = $1A, type = rw; - RAM: start = $36c, size = $8E00, file = %O; -} - -SEGMENTS { -CODE: load = RAM, type = ro, align = $1; -RODATA: load = RAM, type = ro; -DATA: load = RAM, type = rw; -BSS: load = RAM, type = bss, define = yes; -ZEROPAGE: load = ZP, type = zp; -} diff --git a/bot_demo/bg.png b/bot_demo/bg.png new file mode 100644 index 00000000..9fa6e7db Binary files /dev/null and b/bot_demo/bg.png differ diff --git a/bot_demo/load.s b/bot_demo/load.s index 97d3a19c..ce392525 100644 --- a/bot_demo/load.s +++ b/bot_demo/load.s @@ -11,20 +11,51 @@ TRACE_ = $D805 load_file: - + ;================= + ; run list command do_list: - lda #'L' - sta $200 - lda #'I' - sta $201 - lda #'S' - sta $202 - lda #'T' - sta $203 - lda #0 - sta $204 + lda #list_string + sta cti_smc+2 + jsr copy_to_input + jmp run_command + ;================= + ; run run command + ; a do-run-run, a do-run-run +do_run: + lda #run_string + sta cti_smc+1 + jsr copy_to_input + + jmp run_command + + + ;===================== + ; copy_to_input + ; copies NUL terminator too + +copy_to_input: + ldx #0 +cti_loop: +cti_smc: + lda $1234,X + sta $200,X + beq done_copy + inx + bne cti_loop +done_copy: + rts + + +list_string: + .byte "LIST",0 +run_string: + .byte "RUN",0 run_command: ; calls MON_GETLN