Skip to content

Commit

Permalink
Added X16_DEBUG constant and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johanberntsson committed Feb 29, 2024
1 parent 29acd82 commit d9623f6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
all: x16-dragontroll
all: x16-test

x16-test:
ruby make.rb -s test.z5 -t:x16 -v

mega65-test:
ruby make.rb -s test.z5 -t:mega65 -v

x16-dragontroll:
ruby make.rb -s examples/dragontroll.z5 -t:x16 -v
Expand Down
12 changes: 2 additions & 10 deletions asm/constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ vmap_buffer_end = $0400 ; Last byte + 1. Should not be more than vmap_buff
}

!ifdef TARGET_X16 {
basic_reset = $a000 ; TODO: check this
story_start_far_ram = 0 ; NOTE: This is in banked RAM
SCREEN_HEIGHT = 60
SCREEN_WIDTH = 80
Expand Down Expand Up @@ -317,22 +316,15 @@ reg_bordercolour = $d020
reg_backgroundcolour = $d021
rasterline_for_scroll = 56; 56 works well for PAL and NTSC
}
!ifdef TARGET_X16 {
reg_rasterline_highbit= $d011
reg_rasterline = $d012
reg_screen_char_mode = $d018
reg_bordercolour = $d020
reg_backgroundcolour = $d021
rasterline_for_scroll = 56; 56 works well for PAL and NTSC
}

; --- Kernel routines ---
!ifdef TARGET_C64 {
kernal_reset = $fce2 ; cold reset of the C64
kernal_delay_1ms = $eeb3 ; delay 1 ms
}
!ifdef TARGET_X16 {
kernal_reset = $fce2 ; cold reset of the C64
; TODO: check these addresses
kernal_reset = $fce2 ; cold reset of the X16
kernal_delay_1ms = $eeb3 ; delay 1 ms
}
!ifdef TARGET_PLUS4 {
Expand Down
15 changes: 12 additions & 3 deletions asm/ozmoo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}

!ifdef TARGET_X16 {
X16_DEBUG = 1
TARGET_ASSIGNED = 1
COMPLEX_MEMORY = 1
FAR_DYNMEM = 1
Expand All @@ -28,6 +29,9 @@
}
SKIP_BUFFER = 1 ; This is for SLOW mode and non-VMEM mode, which we know we have
}
!ifdef X16_DEBUG {
DEBUG = 1
}
!ifdef TARGET_MEGA65 {
TARGET_ASSIGNED = 1
FAR_DYNMEM = 1
Expand Down Expand Up @@ -1109,16 +1113,15 @@ game_id !byte 0,0,0,0

jsr z_execute

!ifdef TARGET_PLUS4_OR_C128 {
!ifdef TARGET_C128 {
jmp c128_reset_to_basic
} else {
} else ifdef TARGET_PLUS4 {
lda #$01
sta $2b
lda #$10
sta $2c
jmp basic_reset
}
} else ifdef TARGET_X16 {
} else {
; Back to normal memory banks
lda #%00110111
Expand Down Expand Up @@ -1564,6 +1567,12 @@ deletable_screen_init_2
sty is_buffered_window
ldx #$ff
jsr erase_window
!ifdef X16_DEBUG {
jsr print_following_string
!pet "x16 debug",13,0
jsr printchar_flush
- jmp -
}
jmp start_buffering

z_init
Expand Down
4 changes: 4 additions & 0 deletions asm/screen.asm
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@ show_more_prompt
tya
and #1
beq +
!ifdef TARGET_X16 {
ldx bgcol
} else {
ldx reg_backgroundcolour
}
+
!ifdef TARGET_MEGA65 {
jsr colour2k
Expand Down
2 changes: 2 additions & 0 deletions asm/screenkernal.asm
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ s_scrolled_lines !byte 0
+
}

!ifndef TARGET_X16 {
; ----------- Delay for slower scrolling

ldx scroll_delay
Expand Down Expand Up @@ -965,6 +966,7 @@ s_scrolled_lines !byte 0
; dex
; bne -
.done_delaying
}
; dec reg_backgroundcolour
; inc reg_backgroundcolour

Expand Down

0 comments on commit d9623f6

Please sign in to comment.