Thread: 68k details
View Single Post
Old 08 November 2018, 20:28   #728
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,806
Quote:
Originally Posted by plasmab View Post
That will work. Rather hacky. but it will work. I guess you'd use it very sparingly.
That isn't hacky in any way shape or form. In assembler you never have an instruction for every single thing you can think of, so you have to use constructions. Think about it this way: Is a C style for loop written in assembly language a hack because there's no instruction or addressing mode for it? Of course not.

Quote:
Originally Posted by plasmab View Post
The previous code example did pointer arithmetic to get the correct address.
Pointer arithmetic in assembler is not hacky at all, it's absolutely essential to writing assembly code.

Quote:
Originally Posted by plasmab View Post
Disabling the OS is usually a sign of a hack right there. I wrote 68k games as a teenager using this method. It’s pretty much the definition of bad coding.
It completely depends on the context. If you're developing a game for an A500 with 1MB memory, then memory is tight and the OS uses CPU time. Not always a good thing for games. For applications it's still true, of course.

That said, I only write OS friendly stuff

Quote:
Originally Posted by plasmab View Post
Another massive hack is incbin. I read that as “I’m too lazy to load something from disk properly”
Again, it depends. If you have some small data, then it's probably nicer to embed it into the executable (data segment!), because now you have one file with no dependencies. If you have a lot of data and you simply incbin EVERYTHING, then sure, it's crap.
Thorham is offline  
 
Page generated in 0.07979 seconds with 11 queries