summaryrefslogtreecommitdiff
path: root/map65/libm65/datcom_ptrs_mod.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
committerChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
commit059831534c7e884f0a607ed86b582fd00d821731 (patch)
tree76bcb67a78f8aa2654fd34c2ad801a62136b0170 /map65/libm65/datcom_ptrs_mod.f90
parentd83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff)
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
Diffstat (limited to 'map65/libm65/datcom_ptrs_mod.f90')
-rw-r--r--map65/libm65/datcom_ptrs_mod.f9041
1 files changed, 41 insertions, 0 deletions
diff --git a/map65/libm65/datcom_ptrs_mod.f90 b/map65/libm65/datcom_ptrs_mod.f90
index bcc8d41a..a507168e 100644
--- a/map65/libm65/datcom_ptrs_mod.f90
+++ b/map65/libm65/datcom_ptrs_mod.f90
@@ -6,6 +6,14 @@ module datcom_ptrs_mod
real(c_float), pointer, contiguous :: dd(:,:) => null() ! [4, 5760000]
real(c_float), pointer, contiguous :: ss(:,:,:) => null() ! [4, 322, NFFT]
real(c_float), pointer, contiguous :: savg(:,:) => null() ! [4, NFFT]
+ real(c_float), pointer, contiguous :: dd_old(:,:) => null() ! [4, 5760000]
+ real(c_float), pointer, contiguous :: ss_old(:,:,:) => null() ! [4, 322, NFFT]
+ real(c_float), pointer, contiguous :: savg_old(:,:) => null() ! [4, NFFT]
+
+ ! Pointers used by decode0 / narrowband decoder
+ real(c_float), pointer, contiguous :: dd_use(:,:) => null()
+ real(c_float), pointer, contiguous :: ss_use(:,:,:)=> null()
+ real(c_float), pointer, contiguous :: savg_use(:,:)=> null()
! Scalar values
integer, parameter :: NFFT=32768 !Length of FFTs
@@ -13,6 +21,12 @@ module datcom_ptrs_mod
contains
+ subroutine snapshot_buffers() bind(C)
+ dd_old(:,:) = dd(:,:)
+ ss_old(:,:,:) = ss(:,:,:)
+ savg_old(:,:) = savg(:,:)
+ end subroutine
+
! Helper subroutine to copy fixed-length Fortran string to C buffer
subroutine move_chars(dest, dest_len, src)
integer(c_int), intent(in) :: dest_len
@@ -53,6 +67,33 @@ contains
print *, "Fortran: savg pointer associated with dimensions", dim1, dim2
end subroutine
+ subroutine set_dd_old_ptr(ptr, dim1, dim2) bind(C, name="set_dd_old_ptr")
+ use iso_c_binding
+ implicit none
+ type(c_ptr), value :: ptr
+ integer(c_int), value :: dim1, dim2
+ call c_f_pointer(ptr, dd_old, [dim1, dim2])
+ print *, "Fortran: dd_old pointer associated with dimensions", dim1, dim2
+ end subroutine
+
+ subroutine set_ss_old_ptr(ptr, dim1, dim2, dim3) bind(C, name="set_ss_old_ptr")
+ use iso_c_binding
+ implicit none
+ type(c_ptr), value :: ptr
+ integer(c_int), value :: dim1, dim2, dim3
+ call c_f_pointer(ptr, ss_old, [dim1, dim2, dim3])
+ print *, "Fortran: ss_old pointer associated with dimensions", dim1, dim2, dim3
+ end subroutine
+
+ subroutine set_savg_old_ptr(ptr, dim1, dim2) bind(C, name="set_savg_old_ptr")
+ use iso_c_binding
+ implicit none
+ type(c_ptr), value :: ptr
+ integer(c_int), value :: dim1, dim2
+ call c_f_pointer(ptr, savg_old, [dim1, dim2])
+ print *, "Fortran: savg_old pointer associated with dimensions", dim1, dim2
+ end subroutine
+
function get_junk1() bind(C, name="get_junk1")
integer(c_int) :: get_junk1
get_junk1 = junk1