Jump to content
IGNORED

Creating a custom rom


gozar

Recommended Posts

I'm working on a little program to make it easy to set some defaults for a custom ROM (left margin, reverse basic, hi-speed SIO, custom font, etc.) but I seem to be stuck at the start. There isn't a simple memory map of the ROM. :-) I was looking at the OS listing, and found where it stores $02 in LMARGN for the left margin, but I have no idea how to find that in the ROM.

 

Font is at E000-E3FF, which I calculate that to be at 2000 in the ROM. How can I figure out the locations of the left margin and colors?

Link to comment
Share on other sites

What you need is to understand that every 6502 instruction has a hexadecimal number. (Google for 6502 instructions)

 

So when you find in the OS listing where #$02 is stored in LMARGIN, then you could convert that part of the OS into hexadecimal numbers.

 

When you know these numbers you can hex-search them in a hex-editor.

 

With all the respect though... I don't want to discourage you... but when you not know what you are doing at this level (6502 code, hex editing etc.) you'd better stay away from editing your OS yet. The last thing you want is creating an instable, buggy OS.

Link to comment
Share on other sites

I figured this would also help me in my quest to learn assembly. :-) In the source it's:

lda #$02
sta LMARGN


So I would look for A902850052 (A9 - lda immediate, 02 - number, 85 - sta immediate, 0052 - LMARGN)? Did I do that correctly?

Link to comment
Share on other sites

There's no guarantee on stuff like that.

 

Custom FP - the entry points are all the same so you can mix and match there. Though there is one version that uses extra Rom space around $CB00 (?) so you need that space free of anything else to be able to use it.

 

Things like margin, getting rid of attract mode. The sequence of instructions should be the same regardless of OS version so you could probably just search the entire Rom for the sequence and replace with what you want.

 

Then once all done, calculate and store the checksums and you should be good to go. Test on emulator before flashing or burning to Eprom.

  • Like 1
Link to comment
Share on other sites

I figured this would also help me in my quest to learn assembly. :-) In the source it's:

lda #$02
sta LMARGN


So I would look for A902850052 (A9 - lda immediate, 02 - number, 85 - sta immediate, 0052 - LMARGN)? Did I do that correctly?

 

That's what I'm saying indeed. But... here it is also important to know whether IMMEDIATE ZERO PAGE is used or not Zero Page.

If it is NOT zero page then it would be A9028D0052, when it is Zero Page, then it would be A9028552.

 

ZeroPage addressing is slightly faster and consumes 1 byte less code.

 

Handier is to look your code up in an emulator debugging window. You will probably see the code there too, and then it is easier to search for sequences in an hex editor.

But.... important thing to remember for future projects; when you search for some general sequences, they may exist more than once in a binary/rom dump, so make sure when you start editing, you edit the right things.

 

Oh and when you are going to implent OWN routines, make 100% sure you NEVER use more space than the space is used in the rom. You can not simply delete a byte or insert a byte in a hex editor. Everything must stay on the right place. You could use the NOP command (EA) to fill up unneeded code.

Link to comment
Share on other sites

What I was planning to do was to always start with an unmodified ROM, and then just change the bytes that need to be changed for certain things. I didn't want to get too fancy, lol!

 

Thank you!

 

Ha, but when you succeed, believe me... you want more!

I have been there too...

 

But good luck anyway :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...