BIOS now attached to BOOTCPM command, fixed another screen editor bug
This commit is contained in:
1 parent
6935ece386
commit
94a699119a
10 files changed
+151
-34
No files matched your search
@@ -382,7 +382,7 @@ $(DIR_M65)/dos.seg_1 $(DIR_M65)/DOS_1_combined.vs $(DIR_M65)/DOS_1_combine
|
|||||||
$(DIR_M65)/mon.seg_1 $(DIR_M65)/MON_1_combined.vs $(DIR_M65)/MON_1_combined.sym: \
|
$(DIR_M65)/mon.seg_1 $(DIR_M65)/MON_1_combined.vs $(DIR_M65)/MON_1_combined.sym: \
|
||||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_MON_M65) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_MON_M65) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
||||||
$(DIR_M65)/zvm.seg_1 $(DIR_M65)/ZVM_1_combined.vs $(DIR_M65)/ZVM_1_combined.sym: \
|
$(DIR_M65)/zvm.seg_1 $(DIR_M65)/ZVM_1_combined.vs $(DIR_M65)/ZVM_1_combined.sym: \
|
||||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_ZVM_M65) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_ZVM_M65) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_M65)/KERNAL_C_combined.sym
|
||||||
|
|
||||||
$(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym: \
|
$(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym: \
|
||||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym $(DIR_X16)/BASIC_0_combined.sym
|
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym $(DIR_X16)/BASIC_0_combined.sym
|
||||||
|
|||||||
@@ -4,6 +4,13 @@
|
|||||||
|
|
||||||
BOOTCPM:
|
BOOTCPM:
|
||||||
|
|
||||||
; jsr map_MON_1
|
jsr CLALL
|
||||||
; XXX implement system startupo
|
clc
|
||||||
jmp BOOTCPM
|
jsr M65_MODESET
|
||||||
|
|
||||||
|
jsr viciv_init ; do it now, later it will not be safe anymore
|
||||||
|
lda #$01
|
||||||
|
jsr M65_SCRMODESET
|
||||||
|
|
||||||
|
jsr map_ZVM_1
|
||||||
|
jmp ($2000)
|
||||||
@@ -15,3 +15,11 @@
|
|||||||
;; #ALIAS# __kb_matrix_alwaysrepeat_end = KERNAL_0.__kb_matrix_alwaysrepeat_end
|
;; #ALIAS# __kb_matrix_alwaysrepeat_end = KERNAL_0.__kb_matrix_alwaysrepeat_end
|
||||||
;; #ALIAS# kb_matrix_joy_status = KERNAL_0.kb_matrix_joy_status
|
;; #ALIAS# kb_matrix_joy_status = KERNAL_0.kb_matrix_joy_status
|
||||||
;; #ALIAS# kb_matrix_joy_keytab_idx = KERNAL_0.kb_matrix_joy_status
|
;; #ALIAS# kb_matrix_joy_keytab_idx = KERNAL_0.kb_matrix_joy_status
|
||||||
|
|
||||||
|
;
|
||||||
|
; Definitions needed to perform proxy functionality for Z80 Virtual Machione
|
||||||
|
;
|
||||||
|
|
||||||
|
;; #ALIAS# CHROUT = KERNAL_0.CHROUT
|
||||||
|
|
||||||
|
;; #ALIAS# map_ZVM_1 = KERNAL_0.map_ZVM_1
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
; - KERNAL_1 - for calling KERNAL_1 segment code
|
; - KERNAL_1 - for calling KERNAL_1 segment code
|
||||||
; - DOS_1 - for swiching to DOS context
|
; - DOS_1 - for swiching to DOS context
|
||||||
; - NORMAL_from_DOS_1 - for switching bact from DOS context
|
; - NORMAL_from_DOS_1 - for switching bact from DOS context
|
||||||
|
; - MON_1 - for the monitor
|
||||||
|
; - ZVM_1 - for Z80 virtual machine
|
||||||
|
|
||||||
|
|
||||||
map_NORMAL:
|
map_NORMAL:
|
||||||
@@ -117,3 +119,20 @@ map_MON_1:
|
|||||||
|
|
||||||
map
|
map
|
||||||
bra map_end
|
bra map_end
|
||||||
|
|
||||||
|
map_ZVM_1:
|
||||||
|
|
||||||
|
php
|
||||||
|
pha
|
||||||
|
phx
|
||||||
|
phy
|
||||||
|
phz
|
||||||
|
|
||||||
|
lda #$00
|
||||||
|
tay
|
||||||
|
taz
|
||||||
|
|
||||||
|
ldx #$E3 ; $2000 <- map 24KB from $32000
|
||||||
|
|
||||||
|
map
|
||||||
|
bra map_end
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
;; #LAYOUT# M65 KERNAL_C #TAKE
|
||||||
|
;; #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
;
|
||||||
|
; Proxies for calling MEGA65 segment KERNAL_0 routines from ZVM_1
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
proxy_Z1_CHROUT:
|
||||||
|
|
||||||
|
jsr CHROUT
|
||||||
|
|
||||||
|
; FALLTROUGH
|
||||||
|
|
||||||
|
proxy_Z1_end:
|
||||||
|
|
||||||
|
jmp map_ZVM_1
|
||||||
@@ -72,23 +72,23 @@ m65_chrout_screen_HOME:
|
|||||||
|
|
||||||
; Character set switching
|
; Character set switching
|
||||||
|
|
||||||
m65_chrout_screen_GFX:
|
m65_chrout_screen_TXT:
|
||||||
|
|
||||||
lda VIC_CHARPTR+1
|
lda VIC_CHARPTR+1
|
||||||
ora #%00001000
|
ora #%00001000
|
||||||
|
|
||||||
; FALLTROUGH
|
; FALLTROUGH
|
||||||
|
|
||||||
m65_chrout_screen_GFX_cont:
|
m65_chrout_screen_GFXTXT_cont:
|
||||||
|
|
||||||
sta VIC_CHARPTR+1
|
sta VIC_CHARPTR+1
|
||||||
bra m65_chrout_screen_ctrl2_end
|
bra m65_chrout_screen_ctrl2_end
|
||||||
|
|
||||||
m65_chrout_screen_TXT:
|
m65_chrout_screen_GFX:
|
||||||
|
|
||||||
lda VIC_CHARPTR+1
|
lda VIC_CHARPTR+1
|
||||||
and #%11110111
|
and #%11110111
|
||||||
bra m65_chrout_screen_GFX_cont
|
bra m65_chrout_screen_GFXTXT_cont
|
||||||
|
|
||||||
; INS key
|
; INS key
|
||||||
|
|
||||||
|
|||||||
@@ -277,18 +277,22 @@ Z80_instr_ED_5F: ; LD A,R
|
|||||||
ora REG_IFF2
|
ora REG_IFF2
|
||||||
sta REG_F
|
sta REG_F
|
||||||
|
|
||||||
|
clc
|
||||||
lda REG_R06 ; register R only simulates random numbers
|
lda REG_R06 ; register R only simulates random numbers
|
||||||
|
bpl @1
|
||||||
|
sec
|
||||||
|
@1:
|
||||||
|
rol
|
||||||
eor VIC_RASTER
|
eor VIC_RASTER
|
||||||
adc TIME+2
|
|
||||||
eor VIC_XPOS
|
eor VIC_XPOS
|
||||||
sta REG_R06
|
sta REG_R06
|
||||||
|
|
||||||
and #%01111111
|
and #%01111111
|
||||||
eor REG_R7 ; not 'ora', we want to reuse the 'garbage'
|
eor REG_R7 ; not 'ora', we want to reuse the 'garbage'
|
||||||
sta REG_A
|
sta REG_A
|
||||||
bpl @1
|
bpl @2
|
||||||
+Z80_PUT_1_SF
|
+Z80_PUT_1_SF
|
||||||
@1:
|
@2:
|
||||||
+bne ZVM_next
|
+bne ZVM_next
|
||||||
+Z80_PUT_1_ZF
|
+Z80_PUT_1_ZF
|
||||||
jmp ZVM_next
|
jmp ZVM_next
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ zvm_BIOS_00_BOOT: ; Cold start
|
|||||||
dew REG_AF ; AF and SP have $FFFF value on start
|
dew REG_AF ; AF and SP have $FFFF value on start
|
||||||
dew REG_SP
|
dew REG_SP
|
||||||
|
|
||||||
|
lda TIME+2 ; give a little initial randomness to register R
|
||||||
|
sta REG_R06
|
||||||
|
|
||||||
; XXX load CPM3.SYS
|
; XXX load CPM3.SYS
|
||||||
|
|
||||||
; FALLTROUGH
|
; FALLTROUGH
|
||||||
|
|||||||
+41
-23
@@ -5,7 +5,47 @@
|
|||||||
|
|
||||||
ZVM_entry:
|
ZVM_entry:
|
||||||
|
|
||||||
; XXX mark that this is the first start of CP/M iin the lifecycle, display BIOS information
|
; Reset stack pointer - this routine will never return
|
||||||
|
|
||||||
|
ldx #$FF
|
||||||
|
txs
|
||||||
|
|
||||||
|
; Skip the IRQ processing, even if Kernal reenables it
|
||||||
|
|
||||||
|
sei
|
||||||
|
lda #<return_from_interrupt
|
||||||
|
sta CINV+0
|
||||||
|
lda #>return_from_interrupt
|
||||||
|
sta CINV+1
|
||||||
|
|
||||||
|
; Make sure $C000-$CFFF ROM is mapped-in, we keep our proxies there
|
||||||
|
|
||||||
|
lda VIC_CTRLA
|
||||||
|
ora #%00100000
|
||||||
|
sta VIC_CTRLA
|
||||||
|
|
||||||
|
; Setup colours, print welcome message
|
||||||
|
|
||||||
|
lda #$00
|
||||||
|
sta VIC_EXTCOL
|
||||||
|
sta VIC_BGCOL0
|
||||||
|
|
||||||
|
jsr PRIMM
|
||||||
|
!byte KEY_GREEN, KEY_ESC, 'o', KEY_CLR, KEY_C65_SHIFT_ON, KEY_TXT, KEY_C65_SHIFT_OFF
|
||||||
|
!pet "Open ROMs MEGA65 BIOS for CP/M", $0D
|
||||||
|
!pet "Zilog Z80 to 45GS02 translator", $0D
|
||||||
|
!byte $0D,$0D
|
||||||
|
!byte 0
|
||||||
|
|
||||||
|
; XXX code is not ready to progress further
|
||||||
|
|
||||||
|
jsr PRIMM
|
||||||
|
!byte $0D
|
||||||
|
!pet "* Implementation not finished yet - system HALTED *"
|
||||||
|
!byte 0
|
||||||
|
@1
|
||||||
|
bra @1
|
||||||
|
|
||||||
jmp zvm_BIOS_00_BOOT
|
jmp zvm_BIOS_00_BOOT
|
||||||
|
|
||||||
ZVM_store_next:
|
ZVM_store_next:
|
||||||
@@ -71,28 +111,6 @@ Z80_instr_FD: +ZVM_DISPATCH Z80_vectab_FD_0, Z80_vectab_FD_1 ;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
; Not implemented yet - XXX implement them!
|
; Not implemented yet - XXX implement them!
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
;; #IMPORT# KERNAL_0 = KERNAL_0_combined.sym
|
||||||
|
;; #IMPORT# KERNAL_C = KERNAL_C_combined.sym
|
||||||
|
|
||||||
|
;
|
||||||
|
; Definitions for calling MEGA65 segment KERNAL_0 routines from ZVM_1
|
||||||
|
;
|
||||||
|
|
||||||
|
;; #ALIAS# CHROUT = KERNAL_C.proxy_Z1_CHROUT
|
||||||
|
|
||||||
|
;; #ALIAS# return_from_interrupt = KERNAL_0.return_from_interrupt
|
||||||
|
|
||||||
|
|
||||||
|
; 'Print immediate', original implementation by Mike Barry, adapted to 65CE02, modified to preserve .Y
|
||||||
|
; see http://www.6502.org/source/io/primm.htm
|
||||||
|
|
||||||
|
PRIMM:
|
||||||
|
|
||||||
|
pla ; get low part of (string address-1)
|
||||||
|
sta PTR1
|
||||||
|
pla ; get high part of (string address-1)
|
||||||
|
sta PTR2
|
||||||
|
phy
|
||||||
|
+bra @2
|
||||||
|
@1:
|
||||||
|
jsr CHROUT ; output a string char
|
||||||
|
@2:
|
||||||
|
inc PTR1 ; advance the string pointer
|
||||||
|
bne @3
|
||||||
|
inc PTR2
|
||||||
|
@3:
|
||||||
|
ldy #$00
|
||||||
|
lda (PTR1), y ; get string char
|
||||||
|
bne @1 ; output and continue if not NUL
|
||||||
|
ply
|
||||||
|
lda PTR2
|
||||||
|
pha
|
||||||
|
lda PTR1
|
||||||
|
pha
|
||||||
|
|
||||||
|
rts
|
||||||
Reference in new issue
Block a user