more MEGA65 screen editor work, bell works now

This commit is contained in:
FeralChild64 committed 2020-12-28 21:38:36 +01:00
1 parent 1913697cd3
commit 0d05ac1f44
6 files changed
+98 -25

No files matched your search

+4 -4
View File
@@ -54,10 +54,10 @@
!set KEY_TAB = $09
!set KEY_LINE_FEED = $0A ; XXX add to M65 matrix
!set KEY_TAB_SET_CLR = $18 ; XXX add to M65 matrix
!set KEY_UNDERLINE_ON = $02 ; XXX add to M65 matrix
!set KEY_UNDERLINE_OFF = $82 ; XXX add to M65 matrix
!set KEY_FLASHING_ON = $0F
!set KEY_FLASHING_OFF = $8F ; XXX add to M65 matrix
!set KEY_UNDERLINE_ON = $02 ; CTRL+G
!set KEY_UNDERLINE_OFF = $82
!set KEY_FLASHING_ON = $0F ; CTRL+O
!set KEY_FLASHING_OFF = $8F
}
+3 -2
View File
@@ -59,8 +59,9 @@
!addr M65_KB_PRESSED = $5A0 ; $5A0-$5A2 keys pressed, used during scanning keyboard
!addr M65_KB_PRESSED_OLD = $5A3 ; $5A3-$5A5 keys pressed during previous scan
!addr M65_KB_PRESSED_NEW = $5A6 ; $5A6-$5A8 set of M65_KB_PRESSED minus M65_KB_PRESSED_OLD
!addr M65_JOYCRSR = $5A9 ; joystick to be used for cursor movement
; $5AA-$5EB -- UNUSED --
!addr M65_BELLDSBL = $5A9 ; flag - if set, disable the bell
!addr M65_JOYCRSR = $5AA ; joystick to be used for cursor movement
; $5AB-$5EB -- UNUSED --
!addr M65_DMAGIC_LIST = $5F1 ; $5EF-$5FF reserved for DMAgic list, 15 bytes (modulo bytes are not needed)
!addr M65_RS232_INBUF = $600 ; $600-$6FF -- reserved for RS-232 input buffer --
!addr M65_RS232_OUTBUF = $700 ; $700-$7FF -- reserved for RS-232 output buffer --
@@ -79,12 +79,6 @@ m65_chrout_screen_TAB:
+nop
m65_chrout_screen_LINE_FEED:
+nop
m65_chrout_screen_UNDERLINE_ON:
+nop
m65_chrout_screen_UNDERLINE_OFF:
+nop
m65_chrout_screen_TAB_SET_CLR:
+nop
m65_chrout_screen_BELL:
jmp m65_chrout_screen_done
@@ -35,9 +35,10 @@ m65_chrout_screen_CRSR_UP:
m65_chrout_screen_RETURN:
; RETURN clears quote and insert modes, it also clears reverse flag
; RETURN clears quote and insert modes, reverse flag, etc.
jsr m65_screen_clear_special_modes
jsr m65_screen_clear_colorattr
; Move cursor to the beginning of the next line
@@ -10,22 +10,34 @@ m65_chrout_screen_ESC:
sta M65_ESCMODE
bra m65_chrout_screen_ctrl2_end
; Flashing support
; Flashing and underline support
m65_chrout_screen_UNDERLINE_ON:
lda COLOR
ora #%10000000
bra m65_chrout_screen_FLAUND_common
m65_chrout_screen_UNDERLINE_OFF:
lda COLOR
and #%01111111
bra m65_chrout_screen_FLAUND_common
m65_chrout_screen_FLASHING_ON:
lda COLOR
ora #%00010000
bra m65_chrout_screen_FLASHING_common
bra m65_chrout_screen_FLAUND_common
m65_chrout_screen_FLASHING_OFF: ; XXX how to trigger it?
m65_chrout_screen_FLASHING_OFF:
lda COLOR
and #%11101111
; FALLTROUGH
m65_chrout_screen_FLASHING_common:
m65_chrout_screen_FLAUND_common:
sta COLOR
bra m65_chrout_screen_ctrl2_end
@@ -179,3 +191,63 @@ m65_chrout_screen_INS_copy:
bne m65_chrout_screen_INS_copy
rts
; Bell (jingle)
m65_chrout_screen_BELL:
lda M65_BELLDSBL
bmi m65_chrout_screen_BELL_done
; Play bell on both left&right secondary SIDs - first reset the SIDs
ldx #$1F
lda #$00
@1:
sta __SID_BASE + $20,x
sta __SID_BASE + $60,x
dex
bpl @1
lda #$0A ; volume
sta SID_SIGVOL + $20
sta SID_SIGVOL + $60
lda #$23 ; channel 1 - attack/decay
sta SID_ATDCY1 + $20
sta SID_ATDCY1 + $60
lda #$52 ; channel 1 - sustain/release
sta SID_SUREL1 + $20
sta SID_SUREL1 + $60
lda #$1E ; channel 1 - frequency (HI)
sta SID_FREHI1 + $20
sta SID_FREHI1 + $60
lda #$00 ; channel 1 - frequency (LO)
sta SID_FRELO1 + $20
sta SID_FRELO1 + $60
lda #$11 ; channel 1 - waveform
sta SID_VCREG1 + $20
sta SID_VCREG1 + $60
ldx #$0E ; wait loop
@2:
phx
ldx #$FF
jsr wait_x_bars
plx
dex
bne @2
lda #$10 ; stop the jingle
sta SID_VCREG1 + $20
sta SID_VCREG1 + $60
; FALLTROUGH
m65_chrout_screen_BELL_done:
jmp m65_chrout_screen_done
@@ -40,6 +40,19 @@ m65_chrout_screen_escmode:
tax
jmp (m65_chrout_screen_jumptable_escape, x)
m65_chrout_esc_G: ; enable bell
lda #$00
+skip_2_bytes_trash_nvz
; FALLTROUGH
m65_chrout_esc_H: ; disable bell
lda #$FF
sta M65_BELLDSBL
bra m65_chrout_esc_done_1
m65_chrout_esc_LBR: ; set monochrome display
lda #$80
@@ -174,10 +187,6 @@ m65_chrout_esc_R: ; 'reversed' screen colors
; XXX: implement screen routines below:
m65_chrout_esc_AT: ; clears everything from cursor till end of the screen
@@ -194,10 +203,6 @@ m65_chrout_esc_E: ; disable cursor flashing
+nop
m65_chrout_esc_F: ; enable cursor flashing
+nop
m65_chrout_esc_G: ; enable bell
+nop
m65_chrout_esc_H: ; disable bell
+nop
m65_chrout_esc_I: ; insert empty line, move content down
+nop
m65_chrout_esc_L: ; enable screen scrolling