Re:A Great Old-Timey Game-Programming Hack
by Sheepshow on Monday December 16, 2013 @05:15PM
(#6918220)
Here's how that would look in the instruction set we use here ($100M commercial product)
; ARM spells it
ADD R0, R1, R2, LSL #8
; We spell it
CLX R0 ; 1 cycles
ADX R1 ; 1
ADX R2 ; 1
LDX N, 8 ; 3
RSX ; N (const 8 in this case)
Try optimizing THAT!If you ever feel like reliving a bit of your past the Game Boy Advance uses the ARMv3 instruction set. With an easily available flash cart you have a cool little portable system to develop on.
Re:A Great Old-Timey Game-Programming Hack
by eropple on Monday December 16, 2013 @03:10PM
(#6917463)
Nit: the GBA uses an ARM7TDMI that IIRC implements ARMv4T, which isn't a strict superset of ARMv3 (I think that's the first ARM that dropped the old crazy addressing). Still very fun to mess with.
Sorry about that! The ARM naming scheme confuses the hell out of me. I always mix up the processor generations and instruction sets.
Re:A Great Old-Timey Game-Programming Hack
by mattbee on Monday December 16, 2013 @09:31AM
(#6914873)
ARM was my start with assembler too. But you appear to a have forgotten there are 5 more registers you can use for that blit ;-)
Re:A Great Old-Timey Game-Programming Hack
by stusmith1977 on Monday December 16, 2013 @10:35AM
(#6915311)
I can't remember how tight I made it... but I would think you need a couple spare: one for the number of iterations, and another for the screen stride. But yes, spilling registers like SP and LR is a useful trick if you need it.
It had a "barrel shifter" that gave you free shifts of powers of two, so you could calculate screen byte offsets quickly:
It also had bulk loads and stores that made reading/writing RAM cheaper. The trick there was to spill as many registers as you possibly could, so that you could transfer as many words as possible per bulk load/store. Happy days...