Been on the ball with going for this little game. The game is top down style (neutopia, falcom, arkista’s ring, etc). I really like that mini char style that Falcom did with it’s early games, and I’m glad they kept it like that on the Popful Mail remake for the PCE. Anyway, I’ve done scrolling engines before (along with collision), but man – this force scroll in section business threw me for a loop. I’d thought it’d be easier, but it’s taken me 5 days to get this thing working (large meta-map/world, force scrolling to next map, etc).
I’m using lots and lots of macros. Mostly to keep the source code as condensed as possible. It looks more like a 16bit processor code than anything else. Really makes thing nice and readable. Almost no performance hit either. When I coded on the 68k, I rarely ever used indexing for direct and indirect addressing, because index wasn’t free and had the over head to setup. So I took that to practice on the macro system I made as well. I have LEA macros as well as ADD.move (base+pointer->address reg), MAPBANK, conditional JSR instructions, long branches (both 16bit and 24bit), 16bit add/sub/shift/rotates/compares, etc. It just makes the source code look compact and easier to read when scrolling through it. I basically reserve X and Y real regs for internal macro support. When I need down to the metal performance, I just use regular 6280 code.
Here’s an example:
;screen collision map
;screen collision map bank
;set vram address
sVDC_REG MAWR, $0000
MOVE.w [A0], vdata_port
MOVE.w.add [A0], vdata_port, #$01
MOVE.w.add [A0], vdata_port, #$02
MOVE.w.add [A0], vdata_port, #$03
ADD.w #$02,<A0 ;map
ADD.w #$02,<A1 ;ptr for row one
ADD.w #$02,<A2 ;ptr for row two