Retro Game & PC/정보

Apple2 Taipan pure basic source and machine code version

smores 2023. 12. 13. 00:06

오리지널은 TRS-80 에서 개발된 것으로 알고 있다. Apple2 로도 포팅이 되어 있고, 순수한 애플소프트 베이식 버전과 기계어 (아마도 컴파일된?) 버전이 있는데 순수 베이식 소스 버전도 찾아서 참고로 남겨둔다. 거기다가 Apple2 소스 관련 책도 있다. 

 

taipan.dsk
0.14MB

 

taipan+.dsk
0.14MB

 

 

TaipanAHistoricalAdventureForTheAppleComputerAppleIIEdition.pdf
12.93MB

 

 

https://retrocomputing.stackexchange.com/questions/28083/help-understanding-taipan-source-code-for-the-apple-ii

 

Help understanding TAIPAN source code for the Apple II

I am trying to run the source code found at https://taipangame.com/BASIC.txt on Epple 2 (with Apple II+ roms) to eventually run on my own Apple II+, but the program keeps crashing. First, I used a ...

retrocomputing.stackexchange.com

 

I am trying to run the source code found at https://taipangame.com/BASIC.txt on Epple 2 (with Apple II+ roms) to eventually run on my own Apple II+, but the program keeps crashing.

First, I used a python script to clean up the text and remove all spaces not between quotes. The reason for this is some of the lines are too long to type in with spaces and the batch paste ends up not working correctly.

text = """<the code starting from 10 without the final bracket>"""
lines = text.split("\n")
for i in range(len(lines)):
    if lines[i].startswith(" "):
            lines[i] = lines[i][1:]
for i in range(len(lines)-1,-1,-1):
    if lines[i].startswith("    "):
        lines[i-1] += lines[i][4:]
i=0
while i<len(lines):
    if lines[i].startswith("    "):
        del lines[i]
    else:
        i+=1
for i in range(len(lines)):
    lines[i] = re.sub(r"\s+(?=([^\"]*\"[^\"]*\")*[^\"]*$)", "", lines[i]) # deletes all spaces not between quotes
    lines[i] = re.sub(r"(^\d*)",r"\1 ",lines[i]) # adds back space after line number
However, after copying this script into Epple (and running LIST to make sure it looked fine) I RUN it and it gives the error 1842-   A=31 X=9C Y=06 P=31 S=F9.

At this point, the computer starts acting very weird. I tried running LIST, RUN, PRINT and 1 REM and all of them errored at address 012A. Address 012A contained the byte 03.

I am not sure what steps to take next. The issue could be with the emulator, or the python script, or even the website I got the code from. Any help would be much appreciated.

(Note: My final goal is to save Taipan as a cassette .wav to play into the Apple II's cassette jack from my phone, since I do not have a floppy drive.)

------

You don't need to follow the listing far to see the problem.

Line 10 ends with GOTO 10000, and 10000 starts with CALL 6147, which is $1803, smack in the middle of the Applesoft source code, which continues up to around $4200 if it starts at the default of $800.

There are many other CALLs in the listing. The original program had assembly language routines - at least for the HRCG (Hires Character Generator for hires text). And because it used hires, the Applesoft portion of the code had to run higher in memory.

If you look at the version of Taipan on the disk image on this page named "taipan+.dsk", the Applesoft that corresponds to your listing starts at offset $3800 in the file.

If you boot the disk and LOAD TAIPAN, you can see the game's title screen on hires page 1, and at $1803 there's the routine it should be calling. Your listing starts at $801 + $3800 = $4001.

The pure Applesoft version in the book on that Taipan website seems quite different.

 

 

 

https://taipangame.com/

 

Taipan!

TAIPAN! A game based on the China trade of the 1800s.

taipangame.com