Skip to content

Network image loading in test programs + local-image render fixes#1

Merged
midwan merged 1 commit intomasterfrom
feat/network-images
Apr 18, 2026
Merged

Network image loading in test programs + local-image render fixes#1
midwan merged 1 commit intomasterfrom
feat/network-images

Conversation

@midwan
Copy link
Copy Markdown
Owner

@midwan midwan commented Apr 18, 2026

Summary

  • SimpleTest and LibLoad_Test now exercise the full MCC capability surface (images, forms, tables, fonts, entities) and render both local PROGDIR: files and plain-HTTP URLs via a shared image-load hook (test_image_hook.h).
  • Fixes a RenderEngine FirstFrame-uninitialized bug that silently broke image decoding for stack-allocated instances, a file://-prefix slicing bug in DefaultLoadFunc, and gets the m68k hook calling convention right (HookEntry trampoline on m68k/MorphOS, direct assignment on OS4).
  • HTTPS URLs are rejected cleanly (stock bsdsocket has no TLS) by aborting on any non-200 status; follow-up work is to add real HTTPS support.

Test plan

  • OS3 build: HTMLview.mcc, SimpleTest, LibLoad_Test compile clean via amigadev/crosstools:m68k-amigaos
  • OS3 runtime (Amiberry): local PROGDIR:test.png renders in both test programs
  • OS3 runtime (Amiberry): http://aminet.net/pics/aminet.png fetched and rendered
  • OS3 runtime (Amiberry): http://www.amigaworld.net/... (302 → HTTPS) fails cleanly with placeholder, no crash
  • OS4 build + runtime smoke test
  • MorphOS build + runtime smoke test

SimpleTest and LibLoad_Test now exercise the full MCC capability surface
(images, forms, tables, fonts, entities) and render both local PROGDIR:
files and plain-HTTP URLs through a shared image-load hook
(test_image_hook.h). HTTPS is rejected cleanly (stock bsdsocket has no
TLS) by aborting on any non-200 status code.

Core fixes required to make images render at all:

- IM_Render: RenderEngine::RenderEngine now zeroes FirstFrame. The
  LastFrame self-ref trick relies on it starting NULL, which the stack-
  allocated instance never guaranteed -- AllocateFrame's first-frame
  detection misfired and StatusItem->Start() was skipped.
- Dispatcher: DefaultLoadFunc now strips "file://" only when present;
  bare paths (PROGDIR:foo.png) used to get the first 7 chars sliced off.
- Hook wiring: m68k/MorphOS route through HookEntry trampoline so
  CallHookPkt's register args reach the plain-C handler; OS4 assigns
  TestImageHookFunc directly (HookEntry isn't declared there).
- LibLoad_Test: defer MUIA_HTMLview_Contents until after the window is
  open -- the image decoder needs a screen, which isn't known at
  MUI_NewObject time.
- test_image_hook.h: per-hook bsdsocket.library OpenLibrary with
  task-scoped shadow globals, so the socket base is valid in the
  decoder task (m68k bsdsocket is task-local).
- Makefile: copy testdata/test.png into bin_$(OS)/ for PROGDIR: loads;
  add -Wl,-u,_startu on OS4 so C++ static init runs.
@midwan midwan merged commit 925c668 into master Apr 18, 2026
3 checks passed
@midwan midwan deleted the feat/network-images branch April 18, 2026 11:14
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

Successfully merging this pull request may close these issues.

1 participant