Hi!
I thought I'd share this little project I've been working on in QuickBasic 7.1 PDS and Assembly language.
It's a simple platform game running in 40x25 CGA text mode, tweaked to show 50 rows of half height glyphs. Combined with using the ASCII 222 it gives the game a resolution of 80x50 pixels. I chose this resolution to avoid CGA snow completely. Works in DosBox-X anyway
The engine supports "smooth" scrolling using two 4K off screen buffers. One for drawing changed tile areas at the current scroll offset and another one a blitted copy of that with sprites drawn over it every frame. The sprite animation routine supports multi-part sprites.
Currently most of the graphics routines are made in Assembly and I'm getting framerates of 19-22 in DosBox @ 270 cycles. I'm fairly pleased with that, considering my humble programming experience.
My goal is to have this running on an 4.77mhz 8088 / 256k RAM system with framerates above 15 and have a decent game to play too. I guess I was hoping to get some insights from here, to find out if this is actually possible by showing some stuff. This forum has been a big help already though, especially Trixter's and Deathshadows's stuff
I'll make little updates along the way to this thread and my blog: http://bluepandion.tumblr.com/
And here's my Assembly scrolling routine to show some actual code too, sorry if this is too horrible to look at:
I'll post some more routines later if anyone's interested, maybe it's better not to bloat this post with too much stuff.
Cheers!
I thought I'd share this little project I've been working on in QuickBasic 7.1 PDS and Assembly language.
It's a simple platform game running in 40x25 CGA text mode, tweaked to show 50 rows of half height glyphs. Combined with using the ASCII 222 it gives the game a resolution of 80x50 pixels. I chose this resolution to avoid CGA snow completely. Works in DosBox-X anyway
The engine supports "smooth" scrolling using two 4K off screen buffers. One for drawing changed tile areas at the current scroll offset and another one a blitted copy of that with sprites drawn over it every frame. The sprite animation routine supports multi-part sprites.
Currently most of the graphics routines are made in Assembly and I'm getting framerates of 19-22 in DosBox @ 270 cycles. I'm fairly pleased with that, considering my humble programming experience.
My goal is to have this running on an 4.77mhz 8088 / 256k RAM system with framerates above 15 and have a decent game to play too. I guess I was hoping to get some insights from here, to find out if this is actually possible by showing some stuff. This forum has been a big help already though, especially Trixter's and Deathshadows's stuff
I'll make little updates along the way to this thread and my blog: http://bluepandion.tumblr.com/
And here's my Assembly scrolling routine to show some actual code too, sorry if this is too horrible to look at:
Code:
;---------------------------------------------------------------------------
;Textmode Tile buffer scroll routine for 40x50 mode
;
;Version 7.2
;
;
;---------------------------------------------------------------------------
push bp
mov bp, sp ;Get stack pointer
push ds
push si
push es
push di
;----------------------
; Parameter stack offsets
; Order is inverted from qbasic CALL ABSOLUTE parameter order
;00 bp
;02 ds
;04 si
;06 0a es
;08 0c di
;10 Qbasic return segment
;12 Qbasic return offset
;06 Tile buffer offset
;08 Tile buffer segment
;10 Screen Buffer offset
;12 Screen Buffer segment
;14 Tile Buffer scroll offset
;-----------------------------------------------------------------
mov ax, [bp + 14] ;AX = Scroll offset
mov bx, 4096 ;
sub bx, ax ;BX = 4000 - Scroll offset
;---------------------------------------------------------------
;BLIT Tile buffer to screen buffer
;Screen buffer is written linearly from 0 to 1999
;But SI (Read Offset) first goes from 2000-offset to 2000 ...
mov ds, [bp + 8] ;Change read offset to Tile buffer
mov si, [bp + 6]
mov es, [bp + 12] ;Change write offset to Screen buffer
mov di, [bp + 10]
add si, bx
mov cx, ax ;Loop counter, AX = Scroll offset
shr cx, 1 ;CX / 2
rep movsw ;Blit
;... And then from 0 to 2000-offset
mov ds, [bp + 8] ;Change read offset to Tile buffer
mov si, [bp + 6]
mov cx, bx ;Loop counter, BX (1999 - scroll offset)
shr cx, 1 ;CX / 2
rep movsw ;Blit
;---------------------------------------------------------------
exit:
pop di
pop es
pop si
pop ds
pop bp ;Return stack pointer
retf 8
I'll post some more routines later if anyone's interested, maybe it's better not to bloat this post with too much stuff.
Cheers!