Skip to content

Commit

Permalink
mode7_demo: fix interrupt bug on older (pre IIe-enhanced) systems
Browse files Browse the repository at this point in the history
  • Loading branch information
deater committed Sep 4, 2018
1 parent b08d7e5 commit 762ebf1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
7 changes: 6 additions & 1 deletion mode7_demo/Makefile
Expand Up @@ -9,12 +9,17 @@ all: mode7_demo.dsk
$(DOS33):
cd ../dos33fs-utils && make

mode7_demo.dsk: $(DOS33) MODE7_DEMO MODE7_DEMO_C
mode7_demo.dsk: $(DOS33) MODE7_DEMO MODE7_DEMO_C HELLO
# $(DOS33) -y mode7_demo.dsk BSAVE -a 0x4000 MODE7_DEMO
$(DOS33) -y mode7_demo.dsk BSAVE -a 0x2000 MODE7_DEMO_C
$(DOS33) -y mode7_demo.dsk SAVE A HELLO



####
HELLO: hello.bas
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO

###

MODE7_DEMO_C: mode7_decompress.o
Expand Down
10 changes: 10 additions & 0 deletions mode7_demo/hello.bas
@@ -0,0 +1,10 @@
2 HOME
5 PRINT
10 PRINT "MODE7_DEMO V1.1"
20 PRINT
23 PRINT
24 PRINT "WWW.DEATER.NET/WEAVE/VMWPROD/MODE7_DEMO"
25 PRINT : PRINT
30 FOR I = 1 TO 1000: NEXT I
40 HGR
50 PRINT CHR$ (4);"BRUN MODE7_DEMO_C"
21 changes: 19 additions & 2 deletions mode7_demo/interrupt_handler.s
Expand Up @@ -27,9 +27,17 @@
CHUNKSIZE EQU 11 ; hardcoded, based on krg file

interrupt_handler:
pha ; save A ; 3
; pha ; save A ; 3
; instead count on the handler saving A to $45

; Should we save X and Y too?

txa
pha ; Save X
tya
pha ; Save Y


; inc $0404 ; debug (flashes char onscreen)

bit $C404 ; clear 6522 interrupt by reading T1C-L ; 4
Expand Down Expand Up @@ -278,7 +286,16 @@ done_interrupt:

exit_interrupt:

pla ; restore a ; 4
pla
tay
pla
tax


; pla ; restore a ; 4

lda $45 ; restore A


rti ; return from interrupt ; 6

Expand Down
Binary file modified mode7_demo/mode7_demo.dsk
Binary file not shown.
4 changes: 3 additions & 1 deletion mode7_demo/mode7_demo.s
Expand Up @@ -324,7 +324,9 @@ title_routine:
.include "mockingboard.s"
.include "credits.s"
.include "interrupt_handler.s"
.byte 0,0,0,0,0,0,0,0
;.byte 0,0,0,0,0,0,0,0
;.byte 0,0,0,0,0,0,0,0 ; irq handler fix = +8 in size

.byte 0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0
.byte 0,0,0,0
Expand Down

0 comments on commit 762ebf1

Please sign in to comment.