Fixed soft80 shutdown.
A call to $FDA3 cannot be used because it re-enables the BASIC ROM. If a large program (such as Contiki's webbrowser80) has destructor code or data "behind" that ROM, then the program might crash when it tries to quit gracefully. Changing that code to set CIA2_PRA works well enough.
This commit is contained in:
@@ -26,11 +26,11 @@ soft80_init:
|
|||||||
; _bgcolor and _textcolor functions here.
|
; _bgcolor and _textcolor functions here.
|
||||||
|
|
||||||
lda CHARCOLOR ; use current textcolor
|
lda CHARCOLOR ; use current textcolor
|
||||||
and #$0f ; make sure the upper nibble is 0s
|
and #$0F ; make sure the upper nibble is 0s
|
||||||
sta CHARCOLOR
|
sta CHARCOLOR
|
||||||
|
|
||||||
lda VIC_BG_COLOR0 ; use current bgcolor
|
lda VIC_BG_COLOR0 ; use current bgcolor
|
||||||
and #$0f
|
and #$0F
|
||||||
sta soft80_internal_bgcolor
|
sta soft80_internal_bgcolor
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
@@ -39,21 +39,22 @@ soft80_init:
|
|||||||
ora CHARCOLOR
|
ora CHARCOLOR
|
||||||
sta soft80_internal_cellcolor
|
sta soft80_internal_cellcolor
|
||||||
|
|
||||||
lda #$3b
|
lda #$3B
|
||||||
sta VIC_CTRL1
|
sta VIC_CTRL1
|
||||||
lda #$00
|
lda #$00
|
||||||
sta CIA2_PRA
|
sta CIA2_PRA
|
||||||
lda #$68
|
lda #$68
|
||||||
sta VIC_VIDEO_ADR
|
sta VIC_VIDEO_ADR
|
||||||
lda #$c8
|
lda #$C8
|
||||||
sta VIC_CTRL2
|
sta VIC_CTRL2
|
||||||
|
|
||||||
jmp soft80_kclrscr
|
jmp soft80_kclrscr
|
||||||
|
|
||||||
soft80_shutdown:
|
soft80_shutdown:
|
||||||
|
|
||||||
jsr $fda3 ; Initialise I/O
|
lda #$07
|
||||||
jmp $ff5b ; Initialize screen editor
|
sta CIA2_PRA
|
||||||
|
jmp $FF5B ; Initialize video I/O
|
||||||
|
|
||||||
.segment "INIT"
|
.segment "INIT"
|
||||||
firstinit:
|
firstinit:
|
||||||
@@ -66,18 +67,18 @@ firstinit:
|
|||||||
|
|
||||||
inc soft80_first_init
|
inc soft80_first_init
|
||||||
|
|
||||||
lda #>soft80_charset
|
|
||||||
sta ptr1+1
|
|
||||||
lda #<soft80_charset
|
lda #<soft80_charset
|
||||||
|
ldx #>soft80_charset
|
||||||
sta ptr1
|
sta ptr1
|
||||||
lda #>soft80_lo_charset
|
stx ptr1+1
|
||||||
sta ptr2+1
|
|
||||||
lda #<soft80_lo_charset
|
lda #<soft80_lo_charset
|
||||||
|
ldx #>soft80_lo_charset
|
||||||
sta ptr2
|
sta ptr2
|
||||||
lda #>soft80_hi_charset
|
stx ptr2+1
|
||||||
sta ptr3+1
|
|
||||||
lda #<soft80_hi_charset
|
lda #<soft80_hi_charset
|
||||||
|
ldx #>soft80_hi_charset
|
||||||
sta ptr3
|
sta ptr3
|
||||||
|
stx ptr3+1
|
||||||
|
|
||||||
ldx #4
|
ldx #4
|
||||||
@l2:
|
@l2:
|
||||||
@@ -103,8 +104,8 @@ firstinit:
|
|||||||
@l3:
|
@l3:
|
||||||
lda soft80_tables_data_start,x
|
lda soft80_tables_data_start,x
|
||||||
sta soft80_bitmapxlo,x
|
sta soft80_bitmapxlo,x
|
||||||
lda soft80_tables_data_start + (soft80_tables_data_end - soft80_tables_data_start - $100) ,x
|
lda soft80_tables_data_start + (soft80_tables_data_end - soft80_tables_data_start - $0100),x
|
||||||
sta soft80_bitmapxlo + (soft80_tables_data_end - soft80_tables_data_start - $100),x
|
sta soft80_bitmapxlo + (soft80_tables_data_end - soft80_tables_data_start - $0100),x
|
||||||
inx
|
inx
|
||||||
bne @l3
|
bne @l3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user