summaryrefslogtreecommitdiff
path: root/map65/libm65/datcom_ptrs_mod.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-09-26 23:24:28 +0200
committerChristoph Berg <myon@debian.org>2026-09-26 23:24:28 +0200
commit69344560ea394c06ca94acac46a2e4c3e8b7b229 (patch)
treeebc98370a697a9bbd6b973a14fa5113c475c6db7 /map65/libm65/datcom_ptrs_mod.f90
parent3e9d10a67671d0bd5c7b8c3ca8088f1818322eff (diff)
parent059831534c7e884f0a607ed86b582fd00d821731 (diff)
Update upstream source from tag 'upstream/3.2.0_rc1+dfsg'
Update to upstream version '3.2.0~rc1+dfsg' with Debian dir dbff457fd2c3616d5c77b863c7bfb2186ed86047
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