Skip to content

Commit 581b442

Browse files
committed
[fuji] Add new hashing API
1 parent 1ac7749 commit 581b442

36 files changed

+384
-93
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- Implement commodore fujinet-lib functions
66
- Add fuji_open_directory2 prototype for applications to send path and
77
filter separately rather than in fixed 256 byte buffer with \0 delimiter. Used by CBM.
8+
- Rework Hash API, provide simpler interface
9+
- Fill in some COCO parameters in FUJI calls
810

911
## [4.1.4] - 2024-06-05
1012

apple2/src/fn_fuji/fuji_hash_length.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdint.h>
22
#include "fujinet-fuji.h"
33

4+
// THIS IS DEPRECATED IN FAVOUR OF LIBRARY VERSION THAT DOES THE CALCULATION, AS IT IS SIMPLE
45
bool fuji_hash_length(uint8_t mode)
56
{
67
return true;

atari/src/fn_fuji/fuji_get_adapter_config_extended.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
.define ACEsz .sizeof(AdapterConfigExtended)
3030

3131
t_fuji_get_adapter_config_ext:
32-
.byte $e8, $40, <ACEsz, >ACEsz, $01, $00
32+
.byte $c4, $40, <ACEsz, >ACEsz, $00, $00
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.export _fuji_hash_clear
2+
3+
.import _bus
4+
.import _fuji_success
5+
.import _copy_fuji_cmd_data
6+
7+
.include "zp.inc"
8+
.include "macros.inc"
9+
10+
; bool fuji_hash_clear();
11+
;
12+
.proc _fuji_hash_clear
13+
setax #t_fuji_hash_clear
14+
jsr _copy_fuji_cmd_data
15+
jsr _bus
16+
jmp _fuji_success
17+
.endproc
18+
19+
.rodata
20+
t_fuji_hash_clear:
21+
.byte $c2, $00, $00, $00, $00, $00
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.export _fuji_hash_compute_no_clear
2+
3+
.import _bus
4+
.import _fuji_success
5+
.import _copy_fuji_cmd_data
6+
.import popa, popax
7+
8+
.include "zp.inc"
9+
.include "macros.inc"
10+
.include "device.inc"
11+
12+
; bool fuji_hash_compute_no_clear(uint8_t type);
13+
;
14+
; functionally same as fuji_hash_compute, but the FujiNet does not clear the stored data being hashed internally after computing.
15+
16+
.proc _fuji_hash_compute_no_clear
17+
sta tmp7 ; hash type, one of HashType. No validation done though
18+
19+
setax #t_fuji_hash_compute_no_clear
20+
jsr _copy_fuji_cmd_data
21+
22+
mva tmp7, IO_DCB::daux1
23+
mva #$03, IO_DCB::dtimlo
24+
jsr _bus
25+
jmp _fuji_success
26+
.endproc
27+
28+
.rodata
29+
t_fuji_hash_compute_no_clear:
30+
.byte $c3, $00, $00, $00, $ff, $00

atari/src/fn_fuji/fuji_hash_length.s

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.include "macros.inc"
1010
.include "device.inc"
1111

12+
; THIS IS DEPRECATED IN FAVOUR OF LIBRARY VERSION THAT DOES THE CALCULATION, AS IT IS SIMPLE
1213
; bool fuji_hash_length(uint8_t type);
1314
;
1415
.proc _fuji_hash_length

atari/src/fn_fuji/fuji_mount_all.s

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
.include "zp.inc"
88
.include "macros.inc"
9-
.include "device.inc"
109

1110
; bool fuji_mount_all(void)
1211
; returns true for success

coco/src/fn_fuji/fuji_base64_decode_length.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ bool fuji_base64_decode_length(unsigned long *len)
1212
uint8_t cmd;
1313
} bdl;
1414

15+
bdl.opcode = OP_FUJI;
16+
bdl.cmd = FUJICMD_BASE64_DECODE_LENGTH;
17+
1518
bus_ready();
1619

1720
dwwrite((uint8_t *)&bdl, sizeof(bdl));

coco/src/fn_fuji/fuji_get_adapter_config.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ bool fuji_get_adapter_config(AdapterConfig *ac)
1212
uint8_t cmd;
1313
} gac;
1414

15+
gac.opcode = OP_FUJI;
16+
gac.cmd = FUJICMD_GET_ADAPTERCONFIG;
17+
1518
bus_ready();
1619

1720
dwwrite((uint8_t *)&gac, sizeof(gac));

coco/src/fn_fuji/fuji_get_adapter_config_extended.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ bool fuji_get_adapter_config_extended(AdapterConfigExtended *ac)
1212
uint8_t cmd;
1313
} gace;
1414

15+
gace.opcode = OP_FUJI;
16+
gace.cmd = FUJICMD_GET_ADAPTERCONFIG_EXTENDED;
17+
1518
bus_ready();
1619

1720
dwwrite((uint8_t *)&gace, sizeof(gace));

0 commit comments

Comments
 (0)