Skip to content

Commit c4bf630

Browse files
committed
Fix #2 - return error code in all fn_io_mount_* functions
1 parent c1deaf5 commit c4bf630

File tree

15 files changed

+169
-21
lines changed

15 files changed

+169
-21
lines changed

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## [Unreleased]
44

5+
## [2.2.0] - 2024-02-20
6+
7+
- Change signature of fn_io_mount_disk_image, and fn_io_mount_host_slot to return an error code, so all fn_io_mount* functions are consistent (fixes #2).
8+
- [atari] fn_io_mount_disk_image returns error code from BUS
9+
- [atari] fn_io_mount_host_slot returns error code from BUS
10+
- [atari] added test cases for BUS errors for fn_io_mount_disk_image, fn_io_mount_host_slot, fn_io_mount_all
11+
512
## [2.1.5] - 2024-01-07
613

714
### Fixed

apple2/src/fn_io/fn_io_mount_all.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
uint8_t fn_io_mount_all(void)
55
{
6-
6+
return 0;
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-io.h"
33

4-
void fn_io_mount_disk_image(uint8_t ds, uint8_t mode)
4+
uint8_t fn_io_mount_disk_image(uint8_t ds, uint8_t mode)
55
{
6-
6+
return 0;
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-io.h"
33

4-
void fn_io_mount_host_slot(uint8_t hs)
4+
uint8_t fn_io_mount_host_slot(uint8_t hs)
55
{
6-
6+
return 0;
77
}

atari/src/fn_io/fn_io_mount_disk_image.s

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.include "macros.inc"
66
.include "device.inc"
77

8-
; void fn_io_mount_disk_image(uint8_t device_slot, uint8_t mode)
8+
; uint8_t fn_io_mount_disk_image(uint8_t device_slot, uint8_t mode)
99
.proc _fn_io_mount_disk_image
1010
sta tmp8 ; save mode
1111

@@ -17,7 +17,11 @@
1717
jsr popa ; slot
1818
sta IO_DCB::daux1
1919
mva #$fe, IO_DCB::dtimlo
20-
jmp _bus
20+
jsr _bus
21+
22+
ldx #$00
23+
lda IO_DCB::dstats
24+
rts
2125
.endproc
2226

2327
.rodata

atari/src/fn_io/fn_io_mount_host_slot.s

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.include "macros.inc"
77
.include "device.inc"
88

9-
; void fn_io_mount_host_slot(uint8_t slot_num)
9+
; uint8_t fn_io_mount_host_slot(uint8_t slot_num)
1010
;
1111
.proc _fn_io_mount_host_slot
1212
sta tmp8
@@ -15,7 +15,11 @@
1515
jsr copy_io_cmd_data
1616

1717
mva tmp8, IO_DCB::daux1
18-
jmp _bus
18+
jsr _bus
19+
20+
ldx #$00
21+
lda IO_DCB::dstats
22+
rts
1923

2024
.endproc
2125

commodore/src/fn_io/fn_io_mount_all.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
uint8_t fn_io_mount_all(void)
66
{
7-
7+
return 0;
88
}

commodore/src/fn_io/fn_io_mount_disk_image.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "fujinet-io.h"
33
#include "fn_data.h"
44

5-
void fn_io_mount_disk_image(uint8_t ds, uint8_t mode)
5+
uint8_t fn_io_mount_disk_image(uint8_t ds, uint8_t mode)
66
{
7-
7+
return 0;
88
}

commodore/src/fn_io/fn_io_mount_host_slot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "fujinet-io.h"
55
#include "fn_data.h"
66

7-
void fn_io_mount_host_slot(uint8_t hs)
7+
uint8_t fn_io_mount_host_slot(uint8_t hs)
88
{
99
memset(response, 0, sizeof(response));
1010

@@ -13,4 +13,5 @@ void fn_io_mount_host_slot(uint8_t hs)
1313

1414
cbm_open(LFN, DEV, SAN, response);
1515
cbm_close(LFN);
16+
return 0; // TODO: is there an error code we can use here?
1617
}

fujinet-io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ void fn_io_get_ssid(NetConfig *net_config);
134134
bool fn_io_get_wifi_enabled(void);
135135
uint8_t fn_io_get_wifi_status(void);
136136
uint8_t fn_io_mount_all(void);
137-
void fn_io_mount_disk_image(uint8_t ds, uint8_t mode);
138-
void fn_io_mount_host_slot(uint8_t hs);
137+
uint8_t fn_io_mount_disk_image(uint8_t ds, uint8_t mode);
138+
uint8_t fn_io_mount_host_slot(uint8_t hs);
139139
void fn_io_open_directory(uint8_t hs, char *path_filter);
140140
void fn_io_put_device_slots(DeviceSlot *d);
141141
void fn_io_put_host_slots(HostSlot *h);

0 commit comments

Comments
 (0)