Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEMlib - GEM API conformance (functions only) #23

Open
3 of 63 tasks
xdelatour opened this issue Apr 14, 2023 · 16 comments
Open
3 of 63 tasks

GEMlib - GEM API conformance (functions only) #23

xdelatour opened this issue Apr 14, 2023 · 16 comments

Comments

@xdelatour
Copy link
Contributor

xdelatour commented Apr 14, 2023

Missing bindings

AES

XaAES (tos.hyp and source)

  • appl_options (see patch)
  • objc_data (to remove - XaAES-specific and unused)

N.AES (naesbind.h)

  • wind_sget (alternative binding for wind_get, see patch)

MyAES (undoc.)

  • graf_vmem

PC-GEM (seasip.info)

  • appl_xbvset (same as appl_bvset but with 32b, and ability to get values)
  • xgrf_stepcalc
  • xgrf_2box
  • xgrf_colour
  • xgrf_dtimage (set a MFDB as desktop image)

FreeGEM (OpenGEM on github - for info only)

  • prop_get/prop_put/prop_del (config file management)
  • prop_gui_get/prop_gui_set
  • x_appl_getinfo (appl_getinfo with different opcode)
  • xshl_getshell/xshl_setshell

MultiGEM II

  • wind_apfind (same parameters as wind_find but opcode 119)

Geneva (tos.hyp)

  • All functions (gemlib headers include all or most of the constants)

VDI

TOS (tos.hyp - available in Pure C bindings. GEM/1 only. Replaced by vsp_film, vqp_filmname and vsc_expose)

  • vqp_films
  • vqp_state
  • vsp_state
  • vsp_save
  • vsp_message
  • vqp_error

NVDI (tos.hyp)

  • vr_clip_rects_by_dst
  • vr_clip_rects_by_src
  • vr_clip_rects32_by_dst
  • vr_clip_rects32_by_src

FSM/Speedo (bindings?)

  • vs_backmap
  • vs_outmode
  • vs_use_fonts
  • vqt_drv_avail
  • v_set_cachedir
  • v_get_cachedir
  • v_def_cachedir
  • v_clr_cachedir
  • v_delete_cache
  • v_mono_ftext
  • vq_ptsinsz
  • v_killoutline (removed in gemlib pl26)
  • v_fgetoutline
  • vqt_cacheinfo

Other

  •  vs_lum

Sound - (freemint/tos.hyp#101)

  • vq_driver_name
  • vspl_play
  • vspl_load_sample
  • vspl_unload_sample
  • vspl_play_dma
  • vspl_stop_dma
  • vqspl_status_dma
  • vqspl_position_dma
  • vspl_pause_dma
  • vspl_load_d2d
  • vspl_unload_d2d
  • vspl_play_d2d
  • vspl_pause_d2d
  • vspl_stop_d2d
  • vqspl_status_d2d
  • vqspl_position_d2d
  • vqspl_time_left_d2d
  • vspl_make_d2d
  • vsspl_monitor_on
  • vsspl_monitor_off
  • vmid_load
  • vmid_unload
  • vmid_play

Matrix (bindings?)

  • vsf_rgb
  • vst_rgb
  • vsl_rgb
  • vrf_rgb
  • vrt_rgb
  • vrl_rgb
  • vs_pixcol
  • vq_pixcol
  • vs_pixrgb
  • vq_pixrgb
  • vrun_rect
  • vrun_parallel
  • vrun_triangle
  • vs_colors
  • vq_colors

PC-GEM (tos.hyp)

  • v_setrgbi
  • v_topbot
  • v_etext
  • vst_ex_load_fonts
  • vqt_justified
  • vs_grayoverride
  • v_pat_rotate
  • v_get_driver_info
  • v_ps_halftone
  • v_xbit_image
  • vs_bkcolor

Note about PC-GEM:

  • MagiC includes some AES functions from PC-GEM (appl_bvset, menu_click, menu_unregister, scrp_clear...)
  • GEMlib includes some VDI functions from PC-GEM (v_sound, vs_mute, vsf_xperimeter...)
@xdelatour
Copy link
Contributor Author

xdelatour commented Apr 15, 2023

Patch to add appl_options (XaAES) and wind_sget (N.AES):
appl_options-wind_sget-20240421-v2.patch.txt

[EDIT] Includes both appl_options and wind_sget (previously only appl_options)

@xdelatour
Copy link
Contributor Author

Note about objc_data (who created this ###?)

  • Entries in intin: between 3 and 7
  • Entries in intout: between 1 and 5
  • Entries in addrin: between 2 and 4
  • Entries in addrout: between 0 and 4

Instead of a single objc_data() binding, there is (at least!) one binding for each 'request' value :

  • OBGET_OBTYPE: objc_get_type(tree, obj_idx, what, &type);
  • OBGET_STRING: objc_get_string(tree, obj_idx, wh, blen, text, clip); and objc_set_string(tree, obj_idx, wh, blen, text, clip);
  • OBGET_OBSPEC: objc_get_spec(handle, obj_idx, wh, &spec, clip);
  • OBGET_BFOBSPEC: objc_get_bfobspec(handle, obj_idx, wh, clip, &bfobspec);
  • OBGET_OBFLAGS: objc_get_obflags(handle, obj_idx, wh, clip, flags); and objc_set_obflags(handle, obj_idx, wh, clip, flags);
  • OBGET_OBSTATE: objc_get_obstate(handle, obj_idx, wh, clip, flags); and objc_set_obstate(handle, obj_idx, wh, clip, flags);
  • OBGET_AREA: ????
  • Last but not least: this list is not yet finished as this comment says: 'more cases here'

@th-otto
Copy link
Contributor

th-otto commented Apr 22, 2023

IMHO objc_data is really useless, and i'm quite sure that nobody uses it. All that is done there could be done in the application, too, without relying on the function being present. And since XaAES is probably the only AES with that function, you have to resort to such a fallback anyway. So instead of adding lots of bindings to gemlib, we should rather think about disabling that function.

@xdelatour
Copy link
Contributor Author

I totally agree.

My goal is to make XaAES compatible with existing AES (and add gemlib with functions that are actually used by others AES/VDI to detect missing features), not to add extra unused functionality. Moreover, this function does not really bring anything and I just discover at the moment a lot of unused defines (OBSET_OBTYPE, OBSET_STRING, ...).

Disable or delete, which is better?

@th-otto
Copy link
Contributor

th-otto commented Apr 23, 2023

Would be easier to just disable it, but of course with git it's always easy to revert removed code.

@th-otto
Copy link
Contributor

th-otto commented Apr 23, 2023

Patch for appl_options applied now, with 2 minor changes:

  • when sending patches, please take care to use the right indentation (spaces vs. tabs)
  • when assigning or retrieving pointers from integer arrays, please use the macros/inline functions from gem_aesP.h (aes_intin_ptr in this case). This is to avoid gcc complaining about dereferencing type-punned pointers (and potential problems with strict-aliasing)

@xdelatour
Copy link
Contributor Author

Thanks

@th-otto
Copy link
Contributor

th-otto commented Apr 25, 2023

I've just added (hopefully) all geneva declarations and functions. Documentation is a bit incomplete (but it is available in tos.hyp)

Maybe you want to take a look if there are any errors.

@xdelatour
Copy link
Contributor Author

xdelatour commented Apr 25, 2023

Thanks a lot, I'll take a look at the weekend.

Would be easier to just disable it, but of course with git it's always easy to revert removed code.

Patch to disable objc_data:
dis-objc_data-20230428.patch.txt

  • Size of xaaes040.km with objc_data: 537528 bytes
  • Size of xaaes040.km without objc_data: 535603 bytes (-1925)

@xdelatour
Copy link
Contributor Author

Maybe you want to take a look if there are any errors.

I did not find any error and I confirm x_form_center returns coordinates in intout[1-4] (the Geneva doc said intout[0-3] in gnvb.asc)

@xdelatour
Copy link
Contributor Author

Here is a patch to get rid of a lot of TODO in mt_gem.h.in.
comments.patch.txt

@mikrosk
Copy link
Member

mikrosk commented May 22, 2023

@xdelatour the patch above seems to be already applied (sorry for my late response). Just be careful with trailing spaces, I see quite a few of them introduced in 090db4d.

@xdelatour
Copy link
Contributor Author

Yes, patch already applied by Thorsten
I'm working on similar patch for gemx.h. My todo list is still sooooo long

@xdelatour
Copy link
Contributor Author

Patch for mt_gemx.h:
comments_gemx-20230529.patch.txt

@mikrosk
Copy link
Member

mikrosk commented May 31, 2023

Applied, one less item off your TODO list. ;-)

@xdelatour
Copy link
Contributor Author

Thank you!

About wind_apfind, I wonder if it's really useful to add it.

I don't want to add bloatware in xaaes (it's already too big). Maybe I can just add its description in tos.hyp. It is by doing tests under MultiGEM II that I discovered that the desktop pid is 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants