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

Migrate sources and build scripts to Nestor80 #115

Merged
merged 34 commits into from Mar 20, 2023
Merged

Conversation

Konamiman
Copy link
Owner

@Konamiman Konamiman commented Mar 17, 2023

Make the necessary adjustments to use the Nestor80 tools instead of the M80 tools for building Nextor (kernel, NEXTOR.SYS and tools). This includes:

  • Change the code that relied on 8080 instructions.
  • Encode the source files with Japanese text in UTF-8, and use .strenc instructions to assemble them as SHIFT-JIS strings.
  • Adjust casing and relative paths in include instructions.
  • Remove the macros for undocumented Z80 instructions (these are natively supported by Nestor80).
  • Rename all the descriptor fields in kvar.mac to longer, more descriptive names.
  • Adapt all the driver source files to be assembled with Nestor80 (including those that required sjasm).
  • Adjust makefiles.
  • Remove all instances of CPM32.EXE, M80.CPM, L80.CPM and LIB80.CPM.
  • Update the GitHub job that builds Nextor to use the new tools.

Additional changes:

  • Add the source code of the Nextor driver for the MegaFlashROM SCC+ SD.
  • The new register-based calling convention provided by SDCC (_sdcccall(1)) is used for C code, this implies that SDCC 4.2 or newer is now required for building Nextor.

Also, support for building Nextor natively in Windows has been definitely removed, Linux (or Windows + WSL) is the only available option now (macOS could work too, not tested).

Change the CODE macro used in the kernel and in NEXTOR.SYS
so that it doesn't rely anymore in the assembler being able
to assemble 8080 mnemonics.
- Re-encode in UTF-8
- Add .strenc instructions
- Remove redundand macros
- Adjust makefile
These files are data.mac, drv.mac, kbar.mac, chgbnk.mac, rel.mac

Also, makefile adjusted appripriately.
With this, M80 isn't needed anymore to assemble the Nextor kernel
(sjasm is still needed)
- Replace data structures with macros and modules.
- Replace multi-push and pop with single ones.
- Replace "ld iy,de" with real instructions.
- Replace 512 repetitions of LDI with a REPT.
- Replace $ hex prefix with h suffix.
- Expect MASTER_ONLY to be defined externally.

The original code seems to mistakenly assume that "pop x,y,z"
generates "pop x - pop y - pop z" when actually what sjasm generates
is "pop z - pop y - pop x"; surprisingly, the driver seems to work
fine with and without fixing this. So in this commit these are fixed,
but if a BAD_POPS constant is defined then the wrong pops will be
generated instead (may be useful for debugging/testing).

Additionally, the makefile has been adapted accordingly.
Also adjust Makefile to properly assemble it.
Also keep it "old style" by removing escape sequences and DZs
Also change --status-verbosity to --verbosity in makefiles
Also add an explicit program name instruction to all source files.
@Konamiman Konamiman force-pushed the adapt_to_Nestor80 branch 16 times, most recently from 3edef07 to 7394d58 Compare March 20, 2023 16:02
@Konamiman Konamiman marked this pull request as ready for review March 20, 2023 16:05
@Konamiman Konamiman force-pushed the adapt_to_Nestor80 branch 4 times, most recently from d44b2cb to 08e9147 Compare March 20, 2023 16:17
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.

None yet

1 participant