export CROSS_AS=ca65
export CROSS_LD=cl65
export CROSS_CC=cl65
-export CROSS_CCOPTS=-c -O -t none -I$(ROOT_DIR)/cpu-65c816 -I$(ROOT_DIR)/cpu-6502 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include
+export CROSS_CCOPTS=--cpu 65c02 -c -O -t none -I$(ROOT_DIR)/cpu-65c816 -I$(ROOT_DIR)/cpu-6502 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include
#
-# The 6502 compiler produces what is mostly threadcode and is quite determined
-# that the runtime lives in the code segment. As we want the runtime in common
-# memory we use SEG1/SEG2 names for all the kernel code.
+# It really doesn't matter how we map the segments as it's one binary
+# with no banking or tricks. The only exception is the discard area
+# so we can turn it into buffers
#
-export CROSS_CC_SEG1=--code-name SEG1
-export CROSS_CC_SEG2=--code-name SEG2
-# 6502 we need a real SEG3 to make it fit
-export CROSS_CC_SEG3=--code-name SEG3
-export CROSS_CC_SYS1=--code-name SYS1
-export CROSS_CC_SYS2=--code-name SYS2
-export CROSS_CC_SYS3=--code-name SYS3
-export CROSS_CC_SYS4=--code-name SYS4
-export CROSS_CC_SYS5=--code-name SYS5
-export CROSS_CC_VIDEO=--code-name SEG3
+export CROSS_CC_SEG1=--code-name CODE
+export CROSS_CC_SEG2=--code-name CODE
+export CROSS_CC_SEG3=--code-name CODE
+export CROSS_CC_SYS1=--code-name CODE
+export CROSS_CC_SYS2=--code-name CODE
+export CROSS_CC_SYS3=--code-name CODE
+export CROSS_CC_SYS4=--code-name CODE
+export CROSS_CC_SYS5=--code-name CODE
+export CROSS_CC_VIDEO=--code-name CODE
export CROSS_CC_SEGDISC=--code-name DISCARD --rodata-name DISCARDDATA
export ASMEXT = .s
export BINEXT = .o
.import outchar
.import _kernel_flag
- .import _unix_syscall_i
+ .import _unix_syscall
.import map_restore
.import map_save
.import map_process_always
.import map_kernel
- .import _platform_interrupt_i
+ .import _platform_interrupt
.import platform_doexec
.import _inint
.import _trap_monitor
lda #1
sta _kernel_flag ; In kernel mode
cli ; Interrupts now ok
- jsr _unix_syscall_i ; Enter C space via the __interrupt wrapper
+ jsr _unix_syscall ; Enter C space
sei ; Interrupts back off
stz _kernel_flag
rep #$10
lda #1
sta _inint
- jsr _platform_interrupt_i ; call via C int wrapper
+ jsr _platform_interrupt
stz _inint
; Restore the stack we arrived on