sack wrote:How seperated are your graphics/logic code?
It'd be interesting to see how an ST/megadrive port would work
I'd say pretty well separated, most graphics stuff is in separate subroutines or macros. I'll be happy to give out the sources if anyone wants to try porting it!
Junosix wrote:Blimey hukka, that's excellent! How have you done the music? .MOD files or emulated NES soundchip?
Thanks! The music's a Protracker module, but I sampled the instruments from the original NES game to make it sound as close to the original as feasible.
noodles wrote:Sorry if I sound like a noob but what is the difference between macros and straight assembler ? Aren't the macros just bits of assembler code ?
Macros can be used to make the code much more readable, with advanced macros you can basically even make the code look like a higher level language. Example from my code that gets called a lot:
; Plays a sample on SFX_CHANNEL (if 0, auto choose)
; parameters: 1=Sample#
;
macro PlaySample
ifnd NOAUDIO
push d0
moveq \1, d0
bsr SamplePlay
pop d0
endif
endm
A singular line of "PlaySample #SAMPLE_SOMETHING" looks way cleaner in the code than just copypasting the whole block above. Also if I change the SamplePlay subroutine so that, for example, the calling convention changes, I only need to make a single modification to the macro instead of looking for calls all over the code.
hukka wrote:
A singular line of "PlaySample #SAMPLE_SOMETHING" looks way cleaner in the code than just copypasting the whole block above. Also if I change the SamplePlay subroutine so that, for example, the calling convention changes, I only need to make a single modification to the macro instead of looking for calls all over the code.
Ah, just like a function call without parameters then.
What assembler did you use ?
I still miss the Amiga and the 68000... such a waste of a great platform.
Hmm just noticed there is a parameter in your code. This has more possibilities than I thought.
Is it specific to the assembler you are using or is there some sort of standard ?
Most macro systems have loops and conditionals which make them useful for generating code.
It's very handy if you need to get some efficiency from unrolling loops for stuff like scrolling routines. You can end up with kbs of code that you really really wouldn't want to be typing in by hand
A subtle way of sabotaging a codebase that I have seen on occasion is to expand a load of macros, and check in the expanded version. Everything still works, but is suddenly impossible to maintain.
noodles wrote:Hmm just noticed there is a parameter in your code. This has more possibilities than I thought.
Is it specific to the assembler you are using or is there some sort of standard ?
It's standard syntax, I think mainly the amount of possible parameters differs between assemblers. Some assemblers have various related extra features too. Macros are pretty powerful if you use them right!
I use VASM, and a setup where I can crossassemble from Windows (Notepad++) straight to an Amiga executable and launch it in WinUAE by a single keypress. Pretty handy!
hukka wrote:
It's standard syntax, I think mainly the amount of possible parameters differs between assemblers. Some assemblers have various related extra features too. Macros are pretty powerful if you use them right!
I use VASM, and a setup where I can crossassemble from Windows (Notepad++) straight to an Amiga executable and launch it in WinUAE by a single keypress. Pretty handy!
I had AsmOne back in the day as it was considered the reference assembler at the time. Did you ever try using it (or another asm dev environment) directly in WinUAE ?
Not necessarily, although it's unlikely to be a *good* one. C is low-level enough that naive compilation barely requires turing-completeness.
I know it's not quite the same, but my first cut "not good enough" scheme compiler, when given "scheme-normal" code, produced far better ARM assembler than GCC did for the equivalent "c-normal" C code (with optimisation turned off); in some cases it produced something close to what GCC produced with -O3. This latter was largely down to the CPS transform on tail-calls turning "looping" code into a sequence of jumps; as long as no register spilling was required, it produced pretty damn tight code.
"massive retard™", "full of shit™", "tiny bitch™", "retarted™", "a bit of a one trick pony™", "petty™", "simple minded idealistic twat™", "miserable humourless fucker™"