Summer game

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
LEA.w [A0],$6000,<A1
ADD.w #$02,<A0
;screen collision map bank
MAPBANK.2 [A0],$6000
INC.w <A0

;set vram address
sVDC_REG MAWR, $0000
;setup pointer
MOVE.w <A1,<A0

MOVE.w #$0000,<A1
MOVE.w #$0040,<A2
MOVE.b #$10,<A3.l
MOVE.b #$0b,<A3.h

MOVE.w <A1,vdata_port
MOVE.w [A0], vdata_port
MOVE.w.add [A0], vdata_port, #$01

MOVE.w <A2,vdata_port
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

dec <A3.l
beq .check
jmp .loop
MOVE.b #$10,<A3.l
ADD.w #$60,<A1
ADD.w #$60,<A2
dec <A3.h
beq .out
jmp .loop


One Response to “Summer game”

  1. Do you plan to release a pce dev environement (assembler, macros, IDE you use, debugger?) in anyway, shape or form?
    That would be very helpfull for an old geezer like me who hasn’t done any asm in 20 years or so 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: