Skip to content

Commit

Permalink
Fix bug that caused disks to be unmounted when accessing scrollback b…
Browse files Browse the repository at this point in the history
…uffer on MEGA65, due to memory conflict with DOS.
  • Loading branch information
fredrikr committed Aug 9, 2022
1 parent 9f6bada commit e5d4778
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions asm/scrollback.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ scrollback_supported !byte $ff
normal_line_length = 80
scrollback_prebuffer_pages = $10; (in pages) $1000 = 4KB
scrollback_prebuffer_pages_32 !byte 0, scrollback_prebuffer_pages, 0, 0
.scrollback_screen_ram !le32 $00010000
.scrollback_screen_ram !le32 $00040000
scrollback_total_buffer_size = $100000;
scrollback_start_minus_50_lines !le32 $08200000 + (scrollback_prebuffer_pages << 8) - 50 * 80
} else {
Expand Down Expand Up @@ -166,10 +166,11 @@ launch_scrollback
lda #$00
sta dma_command_lsb ; Has been changed to $03 (FILL), must be restored to $00 (COPY)

lda #0
tax
taz
ldy #$01
ldq .scrollback_screen_ram
; lda #0
; tax
; taz
; ldy #$01
stq z_operand_value_high_arr + 4
ldz #79
ldy #79
Expand Down Expand Up @@ -323,10 +324,10 @@ launch_scrollback
lsr
ora #$80 ; Base of HyperRAM
sta dma_source_address_top
ldx #1
stx dma_dest_bank_and_flags
dex
ldq .scrollback_screen_ram
sty dma_dest_bank_and_flags
stx dma_dest_address + 1
ldx #0
stx dma_dest_address_top
ldx #$50
stx dma_dest_address
Expand Down
4 changes: 2 additions & 2 deletions documentation/manual/techreport.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ On the MEGA65, the boot file doesn't hold any story data, the entire Z-code file
| **Address range** | **KB** | **Usage** |
| -- | ---- |
| \$0000-\$ffff | 64 | System RAM, screen RAM, interpreter |
| \$10000-\$107ff | 2 | Screen RAM for scrollback mode |
| \$40000-\$40fff | 4 | Screen RAM for scrollback mode |
| \$08000000-\$0807ffff | 512| Story file |
| \$08080000-\$080800ff: | 0.25 | Signature of last game that was loaded (to make restart faster) |
| \$08100000-\$081fffff: | 1024 | Sound data |
| \$08200000-\$082fffff: | 1024 | Scrollback buffer |
| \$0ff80000-\$0ff807ff: | 2 | Colour RAM |
| \$0ff80800-\$0ff81fff: | 2 | Colour RAM for scrollback mode|
| \$0ff80800-\$0ff817ff: | 4 | Colour RAM for scrollback mode|

## Save and Restore

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0
11.1

0 comments on commit e5d4778

Please sign in to comment.