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

@@ -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