Windows#1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a small GUI/widget layer (message boxes, buttons, mouse hit-testing) on top of the existing Amiga graphics runtime, plus demos and build helpers to compile/link examples against the lib/*.s runtime objects.
Changes:
- Introduces
lib/gui.s+lib/gui.iimplementing rectangle fill/boxes, word-wrapped text, message boxes, buttons, and basic mouse polling/hit-testing. - Exposes graphics runtime symbols needed by the GUI text renderer (
_DrawCharand cursor globals). - Adds a new
msgbox_demoexample and expands the stars demo Makefile to build all.hasdemos (plus a convenience build script for the msgbox demo).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/build_msgbox_demo.sh | New helper script to compile + assemble + link the msgbox demo with runtime objects. |
| lib/gui.s | New 68000 GUI/widget library (FillRect, DrawBox, word-wrap, widgets, mouse helpers). |
| lib/gui.i | New include with GADGET struct offsets/constants and XREFs for gui entry points. |
| lib/graphics.s | Exports _DrawChar and text cursor globals for external GUI code. |
| examples/msgbox_demo.has | New demo showcasing DrawMsgBox/DrawButton + mouse interaction and sprite cursor. |
| examples/demos/stars/Texts.has | New “Print/Text regression” demo for text cursor/wrapping behavior. |
| examples/demos/stars/Makefile | Generalizes stars demo build to compile/link every .has demo and adds font object. |
Comment on lines
+151
to
+158
| move.l d7,d0 | ||
| mulu.w -6(a6),d0 ; d0 = row * row_stride | ||
| move.l d5,d1 | ||
| mulu.w -4(a6),d1 ; d1 = plane * width_bytes | ||
| add.l d1,d0 | ||
| add.l a2,d0 ; d0 += left_byte | ||
| move.l a0,a1 | ||
| add.l d0,a1 ; a1 = address of first byte for this row/plane |
Comment on lines
+205
to
+208
| ; Middle full bytes: count = right_byte - left_byte - 1 | ||
| move.l a3,d2 | ||
| sub.l a2,d2 ; d2 = right_byte - left_byte | ||
| subq.l #1,d2 ; d2 = middle byte count (may be 0) |
Comment on lines
+54
to
+56
| XREF GuiPollMouse | ||
| XREF GuiHitTest | ||
| XREF GuiHitTestRect |
Comment on lines
+14
to
+17
| // Build (link gui.s, graphics.s, font8x8.s alongside the generated .s): | ||
| // python -m hasc.cli examples/msgbox_demo.has -o build/msgbox_demo.s | ||
| // vasmm68k_mot -Fhunkexe -I lib/ -o build/msgbox_demo.o build/msgbox_demo.s lib/gui.s lib/graphics.s lib/font8x8.s lib/helpers.s | ||
| // vlink -bamigahunk build/msgbox_demo.o -o build/msgbox_demo.exe |
Comment on lines
+133
to
+137
| my = GetGuiMouseY(); | ||
| call SetSpritePosition(0, mx, my); | ||
| if (GuiHitTestRect(100, 132, 120, 24) == 1) { | ||
| frame = 1; // Exit button clicked: leave the loop | ||
| } |
Comment on lines
+28
to
+40
| # Allow override: VASM=/path/to/vasmm68k_mot ./scripts/build_msgbox_demo.sh | ||
| VASM="${VASM:-vasmm68k_mot}" | ||
|
|
||
| if ! command -v "$VASM" &>/dev/null; then | ||
| # Fall back to the bundled vasm from the Amiga Assembly VS Code extension | ||
| BUNDLED="$HOME/.vscode/extensions/prb28.amiga-assembly-1.8.13/resources/bin/linux/vasmm68k_mot" | ||
| if [[ -x "$BUNDLED" ]]; then | ||
| VASM="$BUNDLED" | ||
| else | ||
| echo "ERROR: vasmm68k_mot not found. Set VASM=/path/to/vasmm68k_mot." >&2 | ||
| exit 1 | ||
| fi | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.