The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: daydreamer on June 10, 2010, 01:50:19 PM

Title: apple II shapes revival
Post by: daydreamer on June 10, 2010, 01:50:19 PM
decided to write something similar to apple II shapes drawing
;(c) 2010 Daydreamer
    .model tiny
    .686p
    .XMM
    .stack
   
    GETKEY MACRO
      mov   ah,0
      int   16h
    ENDM
   
    mode13 MACRO
    mov ax,013h ;13h
    int 10h
    mov ax,0A000h
    mov es,ax
    ENDM
.data?
;map db 32000 dup (?)
ad dw ?
finc REAL4 ?
angle1 REAL4 ?
angle2 REAL4 ?
xm REAL4 ?
ym REAL4 ?
xf2 REAL4 ?
yf2 REAL4 ?
x dw ?
tmp REAL8 ?
.data
    shape db 15,8,16,240,255,200,0
    startpoint dw 32160
         sc dw 200
     wd dw 320
     i real8 0.001
     i2 real8 0.0
;anglei1 dw 0
;scale dw 4096
;squares dw 256
;xray dw 0
;yray dw 0
;degrees dw 1920
;degrees2 dw 960
;cols dw 256
;xf  REAL4 64.0
;yf  REAL4 64.0

   
.code
    .startup
    mode13
    mov cl,6
    lea bx,shape
    mov di,startpoint
@@l1:   
    push cx
    mov cl,4
@@l2:    mov ax,15
    stosb
    dec di
    mov al,[bx]
    and al,3
    .IF al==0
     inc di
     .ENDIF
     .IF al==1
     add di,320
     .ENDIF
     .IF al==2
     dec di
     .ENDIF
     .IF al==3
     sub di,320
     .ENDIF
     sar byte ptr [bx],2
     dec cl
     jne @@l2
     pop cx
     inc bx
     dec cl
     jne @@l1         
   
     GETKEY

         
    .exit
end

Title: Re: apple II shapes revival
Post by: daydreamer on June 16, 2010, 03:29:56 PM
sitting here trying to make a shape that looks like Scandinivia, I think I try to develop it to have a macro system ontop of it of the most used curves and lines you use to make up a map and also these macros are only allowed to make up few bits
maybe one of the macros is a special one that makes up a repeat function, set by the following bits?
Title: Re: apple II shapes revival
Post by: qWord on June 16, 2010, 04:07:39 PM
so you want to create a monochrome bitmap, where each pixel/bit represend an endpoint of a line?
Title: Re: apple II shapes revival
Post by: daydreamer on June 18, 2010, 12:06:19 PM
Quote from: qWord on June 16, 2010, 04:07:39 PM
so you want to create a monochrome bitmap, where each pixel/bit represend an endpoint of a line?
In the 1980's I ported a risk on Apple II to my atari and had to write a small assembly snippet that supported the 42 apple shapes that made out a whole Worldmap, 42 different territories
while creating Scandinavia with 2 bits/pixel I saw it is flawed and will be lots of bits for a worldmap, just because of unnesserary repeats to create diagonal \ / lines and not reusing partial circles data
so I decided to improve it with the map will instead be drawn with help of a library of tiny shapes resembling: diagonals, 1/4th circle, tiny Island, tiny peninsula etc
and reduce librarysize with help of xor the right numbers to flip it horizontally and vertically
Title: Re: apple II shapes revival
Post by: daydreamer on June 29, 2010, 08:37:43 PM
I havent had time to do more, still tests to draw all kinds of "shapes"
Title: Re: apple II shapes revival
Post by: daydreamer on August 19, 2010, 01:34:06 PM
maybe I end up making a race game outta this, so thats why I developed procedural curve tile to start with
what do you think?
Title: Re: apple II shapes revival
Post by: dedndave on August 19, 2010, 01:47:01 PM
both seem to work fine here, using XP
mode 13h was always fun to play with   :P
Title: Re: apple II shapes revival
Post by: daydreamer on August 22, 2010, 11:50:09 AM
mode13h I use just because it is easy for testing purposes, will move on to some of the VESA modes later
this new version is faster
updated version here, creates 4 different tiles rendered after each other depending on bit0 and bit1
Title: Re: apple II shapes revival
Post by: daydreamer on August 25, 2010, 06:14:09 PM
crap, right now the latest version renders different kinds of tiles depending on bit0 and bit1 settings,so far it changes curve horizontally and vertically depending on those bits, but I am stuck right now to solve how it scrolls thru several tiles