Skip to content

Commit

Permalink
Implemented dummy ROM switch macros for X16
Browse files Browse the repository at this point in the history
  • Loading branch information
johanberntsson committed Feb 29, 2024
1 parent 9229ffb commit bf0afc2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
all: x16
all: x16-dragontroll

x16-dragontroll:
ruby make.rb -s examples/dragontroll.z5 -t:x16 -v

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

!ifdef TARGET_X16 {
basic_reset = $a000
basic_reset = $a000 ; TODO: check this
story_start_far_ram = 0 ; NOTE: This is in banked RAM
SCREEN_HEIGHT = 60
SCREEN_WIDTH = 80
SCREEN_ADDRESS = $0000
Expand Down
23 changes: 23 additions & 0 deletions asm/utilities.asm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ plus4_enable_rom = $ff3e
lda #%00110000
!ifdef TARGET_PLUS4 {
; sta plus4_enable_ram
} else ifdef TARGET_X16 {
} else {
sta zero_processorports
}
Expand All @@ -76,6 +77,7 @@ plus4_enable_rom = $ff3e
lda #%00110000
!ifdef TARGET_PLUS4 {
; sta plus4_enable_ram
} else ifdef TARGET_X16 {
} else {
sta zero_processorports
}
Expand All @@ -84,6 +86,7 @@ plus4_enable_rom = $ff3e

!macro set_memory_no_basic {
!ifdef TARGET_PLUS4 {
} else ifdef TARGET_X16 {
} else {
pha
!ifdef TARGET_C128 {
Expand All @@ -99,6 +102,7 @@ plus4_enable_rom = $ff3e

!macro set_memory_no_basic_unsafe {
!ifdef TARGET_PLUS4 {
} else ifdef TARGET_X16 {
} else {
!ifdef TARGET_C128 {
lda #%00001110 ; 48K RAM0 (0-$c000)
Expand All @@ -112,6 +116,7 @@ plus4_enable_rom = $ff3e

!macro set_memory_normal {
!ifdef TARGET_PLUS4 {
} else ifdef TARGET_X16 {
} else {
pha
!ifdef TARGET_C128 {
Expand Down Expand Up @@ -341,6 +346,24 @@ convert_byte_to_two_digits
rts
}

!ifdef TARGET_X16 {
; Macros for far memory read and write
; TODO
!macro read_far_byte .vector {
lda #.vector
sta $02aa
ldx #$7f
jsr $02a2
}

!macro write_far_byte .vector {
ldx #.vector
stx $02b9
ldx #$7f
jsr $02af
}
}

!ifdef TARGET_C128 {
; Macros for far memory read and write
!macro read_far_byte .vector {
Expand Down

0 comments on commit bf0afc2

Please sign in to comment.