logoalt Hacker News

anthktoday at 11:00 AM0 repliesview on HN

Kim-1 emulator and assembler for T3X0:

https://t3x.org/t3x/0/sim65kit.html

https://t3x.org/kimuno/

Pocket calc as 6502 code

https://t3x.org/kimuno/kimcalc.html

T3x0 compiler to build the emulator:

https://t3x.org/t3x/0/index.html

I've got to run under OpenBSD/i386 but it needs a bit of tweaks in the Makefile. On the target section:

    # CFLAGS=$CFLAGS" -m32"                 # on x86 64-bit systems 
    CFLAGS=$CFLAGS" -static"                # in case all else fails
    CFLAGS=$CFLAGS" -fPIC"          # get rid of stupid linker errors
    CFLAGS=$CFLAGS" -Wl,-z,notext"  # get rid of stupid linker errors
    CFLAGS=$CFLAGS" -fno-PIE -no-pie"       # get rid of stupid linker errors
Do the same in the bin/tx0.sh and bin/build.sh just in case. In my system I set the target to unix-386, and T3XDIR it's set to T3XDIR=/usr/local/t3x/lib in the Makefile and bin/tx0.sh scripts.

Also, T3XBIN it's set to BINDIR= /usr/local/t3x/bin

Then I ran:

      sh bin/modpath.sh /usr/local/t3x/lib 
      gmake all-native
      doas gmake install-native install-modules
But it was still broken. Then, I edited /usr/local/t3x/bin/tx0 and set

TX3DIR is above, and ditto with the four CFLAGS flags I posted.

Just the ones at lines 38-42.

OFC set PATH to /usr/local/t3x0/bin:$PATH in ~/.profile:

        export PATH=/usr/local/t3x0/bin:$PATH
Yeah, it's tricky, but from now on everything will just compile with

      'tx0 foo' 
where 'foo' it's a foo.t file.

This was compiled under an Atom n270 CPU based netbook. I think the author uses a Pentium III machine. If T3X0 can do a MOS 6502 emulation that well, you can try expanding s65/sim65 to cover the Apple I emulation.

And, as a plus, it might run fast on DOS 386 machines if s65/sim65 it's compiled a native binary.