Skip to content

Commit

Permalink
Updated to support Emulator and ROM R36
Browse files Browse the repository at this point in the history
Once again the ports for color, rows and columns have changed.
  • Loading branch information
JimmyDansbo committed Jan 4, 2020
1 parent 8f7c83f commit c7bb5db
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
Binary file modified cx16-maze.prg
Binary file not shown.
34 changes: 24 additions & 10 deletions cx16maze.asm
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,21 @@ CheckROM:
sta VIA1
lda KERNALVER ; Read kernal version
sty VIA1 ; Restore ROM bank
cmp #$DD ; $100-$DD = 35
bne .do34 ; If not R35, branch to 34
cmp #$DE ; $100-$DE = 34
bne .do35 ; If not R34, branch to 35
lda #$86
sta COLPORT ; COLPORT=$0286
lda #$AE
sta NUMCOLS ; NUMCOLS=$02AE
lda #$AF
sta NUMLINES ; NUMLINES=$02AF
lda #$02
sta COLPORT+1
sta NUMCOLS+1
sta NUMLINES+1
rts
.do35: cmp #$DD ; $100-$DD = 35
bne .do36
lda #$77
sta COLPORT ; COLPORT=$0377
lda #$87
Expand All @@ -155,19 +168,20 @@ CheckROM:
sta NUMCOLS+1
sta NUMLINES+1
rts
.do34:
.do36:
lda #$76
sta COLPORT ; COLPORT=$0377
lda #$86
sta COLPORT ; COLPORT=$0286
lda #$AE
sta NUMCOLS ; NUMCOLS=$02AE
lda #$AF
sta NUMLINES ; NUMLINES=$02AF
lda #$02
sta NUMCOLS ; NUMCOLS=$0387
lda #$87
sta NUMLINES ; NUMLINES=$0388
lda #$03
sta COLPORT+1
sta NUMCOLS+1
sta NUMLINES+1
rts


; **************************************************************
; Moves the cursor in the direction chosen by the user if it
; is possible. Returns to caller when the cursor can not move
Expand Down Expand Up @@ -332,7 +346,7 @@ GameLoop:
; *******************************************************************
; INPUTS: .lvl and .mazes is used to find the maze to draw
; *******************************************************************
DrawMaze:!byte $ff
DrawMaze:
.mazeaddr=TMP0 ; Base address of current maze is held
; in TMP0 and TMP1
.linecnt=TMP2 ; Counts lines of the maze (Y)
Expand Down

0 comments on commit c7bb5db

Please sign in to comment.