I'm making a simple tic-tac-toe game for the megadrive just to kinda get to know the system.
I was working on a function that would display a block of text so I typed up this:
Code: Select all
BiggerText: DC.B 'Hi this is a text with more lines',$0D DC.B "It's quite handy writing these lines in the editor",$0D DC.B "Here's just one more line for good measure",$0D,$03 COLORPALATE: DC.W $0000,$0000,$000E,$00E0,$0E00,$0002,$0004,$0006,$0008,$000A,$000C,$000E,$0020,$0040,$0060,$0080
I quickly found out that it's a common beginners trap: http://www.easy68k.com/paulrsm/doc/trick68k.htm
So the address of the color palate has to be even, because the cpu reads 16bit words, so an uneven address would simply point to the higher
byte of a word making it an illegal instruction.
Do I understand this correctly?
What would be the best way to combat this mistake?
Would it be best just to add another byte to BiggerText to make COLORPALATE even? (Like I have done now)
Or is there another (maybe better) approach to this?
Hope you're having a good day!