Skip to content

Apple II dynamic origin, fixes #204#232

Merged
sehugg merged 5 commits into
sehugg:masterfrom
fredsa:fix204
Mar 24, 2026
Merged

Apple II dynamic origin, fixes #204#232
sehugg merged 5 commits into
sehugg:masterfrom
fredsa:fix204

Conversation

@fredsa

@fredsa fredsa commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

Use the minimum offset as the origin.

@sehugg

sehugg commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Is there a case that isn't addressed by DOS or AppleSingle headers? The listing files aren't guaranteed to be complete or accurate and some tools don't generate them.

@fredsa

fredsa commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

I added an explicit example of DASM building an AppleSingle file (presets/apple2/applesinglebin.a) to this PR.

I then checked the 3 different loadROM paths in apple2.ts. The ones marked // FIXED below did not work previously, but have now been made to work:

  1. AppleSingle

    • Sieve (C) loads correctly ($0803), skipping 58 bytes for the header
    • AppleSingle Binary (new DASM example) loads where I tell it, e.g.
      • org $4000 -> 58 bytes skipped, program loaded @ $403a
      • org $4001 -> 58 bytes skipped, program loaded @ $403b
  2. 4-byte DOS header

    • DOS 3.3 Binary (previously added DASM example) loads where I tell it, e.g.
      • ORIGIN equ $0803 -> org ORIGIN - 4 is $07ff -> 4 bytes skipped, program loaded @ $0803
      • ORIGIN equ $2000 -> org ORIGIN - 4 is $1ffc -> 4 bytes skipped, program loaded @ $2000
      • ORIGIN equ $2001 -> org ORIGIN - 4 is $1ffd -> 4 bytes skipped, program loaded @ $2001 // FIXED
  3. Vanilla BIN

    • HGR Test with (example specified) org $803 -> loads @ $0803
    • HGR Test with ($xx00 address) org $4000 -> loads @ $4000 // FIXED
    • HGR Test with (random address) org $4001 -> loads @ $4001 // FIXED

    Let me know if there are other paths I'm not thinking of.

@fredsa fredsa force-pushed the fix204 branch 3 times, most recently from 2fe475e to fc12c34 Compare March 22, 2026 20:13
fredsa added 5 commits March 23, 2026 18:30
- Remove note requiring alignment to $0803 or $xx00
- Replace confusingly used ORIGIN label with PGM_START
- Minor cleanup & make samples consistent with each other
@sehugg sehugg merged commit 77e947c into sehugg:master Mar 24, 2026
1 check passed
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.

2 participants