Skip to content

Commit

Permalink
TOS: Fixed register clash in write_serial
Browse files Browse the repository at this point in the history
PC: About window style update
  • Loading branch information
z80andrew committed Aug 15, 2022
1 parent 1280708 commit 13fd0c9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions STSerialDisk/src/RLE.asm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ do_read:
tst.l d3 | Any bytes left to read?
jne do_compare | Yes, compare with next byte
jbsr do_run | No, output what's in the run so far
jmp 99f | Go to end
jmp _rw_write_crc32 | Finished sending data, output CRC32
do_compare:
cmp.b (a4),d4 | Compare read byte with next byte (pre-incremented)
jeq do_read | Same? Read next byte
Expand Down Expand Up @@ -53,4 +53,3 @@ end_run:
moveq #0,d7 | Reset number of repeats
rts

99:
18 changes: 9 additions & 9 deletions STSerialDisk/src/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,8 @@ _rw_write:

btst #compression_isenabled,d0 | Check for compression flag
jeq _rw_write_uncompressed

_rw_write_compressed:
.include "../src/RLE.asm"
jmp _rw_write_crc32
_rw_write_uncompressed:
move.b (a4)+,d0 | Move buffer address into d0, increment to next byte in rw struct
jbsr write_serial | Write byte to serial
Expand Down Expand Up @@ -643,11 +642,12 @@ wait:
| Output
|
| Corrupts
|
| d0, d5, d6
| a6

write_serial:
movem.l d1-d4,-(sp) | Push registers to the stack which are affected by BIOS calls
move.l d0,d4 | Store byte to send
movem.l d7,-(sp) | Push registers to the stack which are used by calling routines
move.l d0,d7 | Store byte to send
lea _vbclock,a6
move.l (a6),d6 | Store current VLBANK count

Expand All @@ -661,19 +661,19 @@ write_serial:
tst d0 | Test that port is ready to send data
jne 3f | Data can be sent - stop checking

move.l (a6),d7 | Current VLBANKs
move.l (a6),d5 | Current VLBANKs

cmp.l d6,d7 | Compare max VLBANKs with current VLBANKs
cmp.l d6,d5 | Compare max VLBANKs with current VLBANKs
jgt 2f | Timeout if current VLBANKs is greater than max VLBANKs

jra 1b | Check serial status again if current VLBANKs is less than max VLBANKs
2:
move #-1,d0 | Data could not be sent, set error return value
jmp 99f
3:
Bconout serial_device,d4 | Read byte from serial port
Bconout serial_device,d7 | Read byte from serial port
99:
movem.l (sp)+,d1-d4 | Restore registers affected by BIOS calls
movem.l (sp)+,d7 | Restore registers used by calling routines
rts

|-------------------------------------------------------------------------------
Expand Down
Binary file modified SerialDisk/Atari/SERDISK3.TOS
Binary file not shown.
2 changes: 1 addition & 1 deletion SerialDiskUI/Views/AboutWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Style Selector="TabControl">
<Setter Property="TabControl.ItemsPanel">
<ItemsPanelTemplate>
<UniformGrid Rows="1" HorizontalAlignment="Center" Height="5" Margin="0,10,0,20"/>
<UniformGrid Rows="1" HorizontalAlignment="Center" Height="5" Margin="0,13,0,20"/>
</ItemsPanelTemplate>
</Setter>
</Style>
Expand Down
2 changes: 1 addition & 1 deletion SerialDiskUI/Views/SettingsWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
IsReadOnly="True">
</TextBox>
<TextBlock VerticalAlignment="Center">MiB</TextBlock>
<Image ToolTip.Tip="Please ensure the disk buffer size is set correctly in SERDISK.CFG when using a virtual disk larger than 32MiB" IsVisible="{Binding ShowDiskSizeInfoMessage}" Height="14" Source="/Assets/Icons/info_128.png"/>
<Image ToolTip.Tip="Please ensure large disk support is enabled in SERDISK.CFG when using a virtual disk larger than 32MiB" IsVisible="{Binding ShowDiskSizeInfoMessage}" Height="14" Source="/Assets/Icons/info_128.png"/>
</StackPanel>
</StackPanel>
</Border>
Expand Down

0 comments on commit 13fd0c9

Please sign in to comment.