elliotnunn / mps

Macintosh Programmer's Workshop VM for current computers
MIT License
12 stars 0 forks source link

Adding more traps #1

Closed Jagmn closed 2 years ago

Jagmn commented 2 years ago

Hi Elliot,

Thanks for putting this together; it looks like fun.

I've just used it to build your powermac-rom repo and found that the Rename command uses an unimplemented trap. I've experimented a bit and added my own implementation for the trap (_Rename, I think) that gets the whole EasyBuild working. Do you have any pointers/cheatsheets for understanding and adding new traps should I come across others?

I'm a complete newbie to MPW/68k/PPC but have begun to look around all the great work you and others have been doing.

Thanks

elliotnunn commented 2 years ago

Thanks -- glad you're finding it useful.

I regrettably didn't get around to renaming files, because of the slightly fiddly interaction with the dirID list and potential open FCBs. Thank you for tackling it. Would you mind contributing your patch?

The first Inside Mac edition http://www.weihenstephan.org/~michaste/pagetable/mac/Inside_Macintosh.pdf documents the register behaviour of OS traps and parameter blocks quite well.

The stack behaviour of Toolbox traps can be trickier to understand. I suggest writing a tiny C program that calls the trap, then disassembling the compiled .o file using DumpObj.

Great work!

Jagmn commented 2 years ago

Thanks for the pointers! I also came across https://github.com/autc04/multiversal (part of https://github.com/autc04/executor) which seems like a useful source of information.

I don't think my noddy patch deals with any of the issues you mentioned as I'm only just getting to grips with this world and your mps repo, but I have attached what worked for the powermac-rom EasyBuild case: noddy_rename.patch.txt

elliotnunn commented 2 years ago

Thanks for the patch. Rename is now implemented.