<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2662543901542679221</id><updated>2011-10-24T14:18:09.288+01:00</updated><title type='text'>ZX Spectrum Developer</title><subtitle type='html'>This is a blog dedicated to helping others learn from my progress in developing machine code games for the Sinclair ZX Spectrum using a Windows based PC.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zxspectrumdev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://zxspectrumdev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rob</name><uri>http://www.blogger.com/profile/12744061461211205009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2662543901542679221.post-7620323222170715214</id><published>2010-11-25T16:24:00.002Z</published><updated>2010-11-25T16:25:54.769Z</updated><title type='text'>Return to the Spectrum</title><content type='html'>After more than a year away from the Speccy scene, developing iPhone apps and the like, I have decided to return and continue work on the large map tile games.&lt;br /&gt;&lt;br /&gt;Thanks for your patience, watch this space&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2662543901542679221-7620323222170715214?l=zxspectrumdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zxspectrumdev.blogspot.com/feeds/7620323222170715214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zxspectrumdev.blogspot.com/2010/11/return-to-spectrum.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/7620323222170715214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/7620323222170715214'/><link rel='alternate' type='text/html' href='http://zxspectrumdev.blogspot.com/2010/11/return-to-spectrum.html' title='Return to the Spectrum'/><author><name>Rob</name><uri>http://www.blogger.com/profile/12744061461211205009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2662543901542679221.post-2411460735177359248</id><published>2009-08-25T12:45:00.003+01:00</published><updated>2009-08-25T12:49:08.768+01:00</updated><title type='text'>Scrolling Map Project (Update)</title><content type='html'>Just a quick post to let all who are following that the game based on the Maze theory is starting to kick off in earnest.&lt;br /&gt;&lt;br /&gt;Once I have reached a presentable state with it, I'll update Part 2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2662543901542679221-2411460735177359248?l=zxspectrumdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zxspectrumdev.blogspot.com/feeds/2411460735177359248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/08/maze-game-progressing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/2411460735177359248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/2411460735177359248'/><link rel='alternate' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/08/maze-game-progressing.html' title='Scrolling Map Project (Update)'/><author><name>Rob</name><uri>http://www.blogger.com/profile/12744061461211205009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2662543901542679221.post-5071238984741004869</id><published>2009-05-08T10:30:00.002+01:00</published><updated>2010-11-25T21:22:08.107Z</updated><title type='text'>Scrolling Map Project (Part 1)</title><content type='html'>&lt;p&gt; &lt;/p&gt;  &lt;p&gt;I have always been a big fan of large scrolling map games, where the play area is much larger than the screen.  Sonic the hedgehog is a good example.  I suppose even Lunar Jet man could be classed as one of this games.&lt;/p&gt;  &lt;p&gt;I then played a game on the spectrum called “Maze Mania” by Hewson Consultants and thought “How did they do that?”.&lt;/p&gt;  &lt;h2&gt;&lt;/h2&gt;  &lt;h2&gt;Discussion&lt;/h2&gt;  &lt;p&gt;There is an “animated” thread discussing this here: &lt;a title="http://www.worldofspectrum.org/forums/showthread.php?t=24788" href="http://www.worldofspectrum.org/forums/showthread.php?t=24788"&gt;http://www.worldofspectrum.org/forums/showthread.php?t=24788&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Basically, I observed that the main screen is 28 chars by 16 chars in size, moving 1 char (8 pixels) in all directions.  Moving 1 char avoided any colour clash and looked really good.  The game ran at 12.5 Frames per second, and looked pretty smooth.&lt;/p&gt;  &lt;p&gt;Investigating the code using a disassembler I noticed&lt;/p&gt;  &lt;p&gt;1. They drew the tiles to a back buffer   &lt;br /&gt;2. Drew the sprites in their correct positions over the top of the back buffer tiles    &lt;br /&gt;3. Copied the buffer to the main screen    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;The following diagram showed how I planned to implement this (I was aiming for 24x16) where Diagram 1 is the back buffer, 2 is the region to copy and 3 is the end result on the screen.&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" rowspan="3" width="310"&gt;&lt;img style="margin: 0px 15px 0px 0px; display: inline" border="0" alt="" align="left" src="http://www.peargames.co.uk/images/buffer.png" /&gt;&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;Back buffer&lt;/p&gt;          &lt;p&gt; &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;Region To Copy&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="300"&gt;Display&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Copying the Back Buffer&lt;/h2&gt;  &lt;p&gt;In Maze Mania, in order to copy the back buffer to the screen I think they have a table for each of the lines (18 x 8 = 144 lines) containing the source address and the destination screen address. The SP is pointed to this table, and the values are "popped" into HL and DE. Then 28 x LDI's are done to copy from the source to the destination. &lt;/p&gt;  &lt;p&gt;  &lt;br /&gt;Here is my suggested code based on 16 rows (128) x 24 columns&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;HALT            ; Wait for Top Of Scanline, in reality would set up IM2 or something&lt;br /&gt;DI              ; Disable Interrupts&lt;br /&gt;LD (spstore),SP ; Store Stack Pointer&lt;br /&gt;LD SP,table_of_source_and_dest_addresses ; Point SP to our table of source and destination (display) addresses&lt;br /&gt;&lt;br /&gt;; Wait for scan line&lt;br /&gt;LD BC,$0320 ; 800&lt;br /&gt;loop:&lt;br /&gt;DEC BC&lt;br /&gt;LD A,B&lt;br /&gt;OR C&lt;br /&gt;JR NZ,loop&lt;br /&gt;&lt;br /&gt;LD A,$80 ; 128 (16 Rows of 8 bytes)&lt;br /&gt;line_loop:&lt;br /&gt;POP DE   ; Get DESTINATION (Display) from our table&lt;br /&gt;POP HL   ; Get SOURCE address from our table&lt;br /&gt;LDI        ; Copy Contents of (HL) to (DE) 24 times (24 columns)&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;LDI&lt;br /&gt;&lt;br /&gt;DEC A    ; Move to next row&lt;br /&gt;JR NZ,line_loop ; repeat until all done&lt;br /&gt;&lt;br /&gt;LD SP,(spstore) ; restore Stack Pointer&lt;br /&gt;EI ; enable interrupts&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;An example of the "table_of_source_and_dest_addresses" then looks like this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Code:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;table_of_source_and_dest_addresses:&lt;br /&gt;; Destination (Display), Source&lt;br /&gt;defw $4000,$E500,%4100,$E600..... for all 144 lines (18 Rows)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Where the first 2 bytes are the screen destination, the next 2 are the back buffer (in this case starting at $E500) &lt;/p&gt;&lt;p&gt;&lt;br /&gt;This takes about 140,000 T-Cycles, so I reckon with some optimised Tile Writing and Sprite Code I could get 50/4 = 12.5 Frames per second, or at least thats my goal. &lt;/p&gt;&lt;h2&gt;Writing Tiles&lt;/h2&gt;&lt;p&gt;We need to write tiles to the back buffer.  For starters, I have written code that writes them straight to the display.&lt;/p&gt;&lt;p&gt;The code reads from a map, converts to a graphics address and writes the tile to the display.  The map is 16 x 16 squares (256).  The Clear square is Tile 0, the Lines are Tile 1 and the solid block is Tile 3.&lt;/p&gt;&lt;p&gt;The following code when assembled will produce the following:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_XV-UYycKBhQ/SgP7zDkrH_I/AAAAAAAAAFg/51LrXwDpoHY/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_XV-UYycKBhQ/SgP7zWbBtTI/AAAAAAAAAFk/9zhgRRMIdmA/image_thumb%5B1%5D.png?imgmax=800" width="392" height="335" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;If you move the screen address around (de), or the map position (bc) you will see the tiles react accordingly.&lt;/p&gt;&lt;pre&gt;&lt;p&gt;;    draw03.asm &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;;    Draw a 4x4 block and fill the screen &lt;/p&gt;&lt;p&gt; &lt;br /&gt;;    de = Screen address &lt;/p&gt;&lt;br /&gt;&lt;p&gt;;    Takes about 100,000 cycles to do this (8 columns * 4) &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    org 08000h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ;    Turn border black&lt;br /&gt;&lt;br /&gt;    xor a        ; a = 0&lt;br /&gt;&lt;br /&gt;    out (254),a     ; send out of port to set border &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    di        ; disable interrupts &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld de,04000h    ; de points to screen (top left)     ld bc,map       ; bc points to map position (0,0) &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld a,5        ; 5 Rows x 4 = 24 rows&lt;br /&gt;&lt;br /&gt;loop1:     push af        ; store counter     push de        ; store screen address (First column) &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld a,8          ; 8 columns to draw&lt;br /&gt;&lt;br /&gt;loop2:    push af        ; store column counter &lt;/p&gt;&lt;p&gt;    push de         ; store screen address &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld a,(bc)       ; Get Map TILE at map Position &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld l,a          ; e = tile&lt;br /&gt;&lt;br /&gt;    ld h,0 &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ; Multiply by 128 to get tile gfx address &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    rl l&lt;br /&gt;&lt;br /&gt;    rl h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    rl l&lt;br /&gt;&lt;br /&gt;    rl h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    rl l&lt;br /&gt;&lt;br /&gt;    rl h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    rl l    rl h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    rl l&lt;br /&gt;&lt;br /&gt;    rl h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    rl l&lt;br /&gt;&lt;br /&gt;    rl h &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    rl l&lt;br /&gt;&lt;br /&gt;    rl h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; add address to base gfx address&lt;br /&gt;&lt;br /&gt;    ld a,h     add a,gfx/256&lt;br /&gt;&lt;br /&gt;    ld h,a &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    push bc        ; store map position&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;    call drawblock    ; draw the block&lt;br /&gt;&lt;br /&gt;    pop bc        ; get map position back &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    inc c           ; increase map position (column) &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    pop de          ; retrieve screen address &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;    inc e           ; Move screen address along 4 characters to next column&lt;br /&gt;&lt;br /&gt;    inc e&lt;br /&gt;&lt;br /&gt;    inc e&lt;br /&gt;&lt;br /&gt;    inc e &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    pop af        ; get column counter&lt;br /&gt;&lt;br /&gt;    dec a        ; and decrease &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    jr nz,loop2    ; repeat until all columns drawn &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    pop de          ; get original (first column) screen address back &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld a,80h    ; 4 lines (32 * 4 = 128)    add a,e         ; add to screen address (e)     ld e,a &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    jr nc,loop3     ; If we have not crossed the 256 byte border, ok to draw &lt;/p&gt;&lt;br /&gt;&lt;p&gt;    ld a,d          ; Move to next 2048k screen third&lt;br /&gt;&lt;br /&gt;    add a,8         ; By adding 8 to d, 001000 = 2048&lt;br /&gt;&lt;br /&gt;    ld d,a &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;loop3:&lt;br /&gt;&lt;br /&gt;    ld a,c        ; We have drawn 8 columns so move to next row (16 by 16 map)     add a,8         ; add 8 columns to get to next row     ld c,a &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    pop af        ; get counter back&lt;br /&gt;&lt;br /&gt;    dec a        ; decrease counter&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    jr nz,loop1     ; repeat if we are not at the bottom row &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ei &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ret &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;drawblock: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ;    Start &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (spstore),sp    ; Store Stack Pointer &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld sp,hl        ; SP = Graphics Block &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ex de,hl    ; hl now has screen address &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld a,4    ; 4 Rows of Chars&lt;br /&gt;&lt;br /&gt;a1: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; Store Counter&lt;br /&gt;&lt;br /&gt;    ex af,af' &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ;-------------------------------------&lt;br /&gt;&lt;br /&gt;    ;This code is repeated 8 times &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; Get 4 bytes from GFX&lt;br /&gt;&lt;br /&gt;    pop de&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; Store in screen position&lt;br /&gt;&lt;br /&gt;    ld (hl),e&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),b &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; Next screen line&lt;br /&gt;&lt;br /&gt;    inc h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; Get 4 more and work back&lt;br /&gt;&lt;br /&gt;    pop de&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),b&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),e &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ;------------------------------------- &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;  pop de&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),e&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),b &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    pop de&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),b&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),e &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h&lt;br /&gt;&lt;br /&gt;  pop de&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),e&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),b &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    pop de&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),b&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),e &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h&lt;br /&gt;&lt;br /&gt;  pop de&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),e&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    inc l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),b &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    pop de&lt;br /&gt;&lt;br /&gt;    pop bc &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ld (hl),b&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),d&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    dec l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ld (hl),e &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    inc h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ;    Work out next screen line&lt;br /&gt;&lt;br /&gt;NextPixelLine: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;                  ld    a,h&lt;br /&gt;&lt;br /&gt;                  and   7&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  jr    nz,npl_ok&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  ld    a,h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  sub   8&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  ld    h,a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next_Char_Line:   ld    a,l&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  add   a,32&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  ld    l,a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  and   224&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  jr   nz,npl_ok&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  ld    a,h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  add   a,8&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                  ld    h,a &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ; loop&lt;br /&gt;&lt;br /&gt;npl_ok: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;       ex af,af' &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;       dec a&lt;br /&gt;&lt;br /&gt;       jr nz,a1 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;       ; restore SP and return&lt;br /&gt;&lt;br /&gt;       ld sp,(spstore) &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    ret &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;spstore:    defw 0000 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;org 0e400h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;map: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    defb 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;    defb 1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;org 0e500h &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;gfx:&lt;br /&gt;&lt;br /&gt;       defb %11111111,%11111111,%11111111,%11111111&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;       defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %10000000,000000,000000,000001&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        defb %11111111,%11111111,%11111111,%11111111 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    defs 128,128 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;defs 128,255 &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;    end 08000h&lt;/p&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif; white-space: normal; font-size: 24px; font-weight: bold; "&gt;Conclusion&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;So far, we have worked out in theory how the map will work and have developed code to &lt;/p&gt;1. Copy the back buffer to the screen&lt;br /&gt;2. Draw tiles to the back buffer (The above code is direct to the screen)&lt;br /&gt;&lt;br /&gt;The next step (Part 2 to follow) will add colour to the tiles and draw attributes as well as left, right, up and down controls to allow you to scroll through the map.&lt;br /&gt;&lt;br /&gt;Further parts to this series will then draw masked sprites on top of the background.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;My goal is to document the complete development of this game, so stay posted and constructive comments are always welcome.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can download the source and “tap” image for the spectrum for this article &lt;a href="http://www.peargames.co.uk/downloads/draw03.zip"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;*** ADDITION ***&lt;br /&gt;&lt;p&gt;You can download a work in progress of step 2 &lt;a href="http://www.peargames.co.uk/downloads/draw05.zip"&gt;here&lt;/a&gt;.  Use Q,A,O &amp;amp; P to navigate the map.&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2662543901542679221-5071238984741004869?l=zxspectrumdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zxspectrumdev.blogspot.com/feeds/5071238984741004869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/05/scrolling-map-project-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/5071238984741004869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/5071238984741004869'/><link rel='alternate' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/05/scrolling-map-project-part-1.html' title='Scrolling Map Project (Part 1)'/><author><name>Rob</name><uri>http://www.blogger.com/profile/12744061461211205009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_XV-UYycKBhQ/SgP7zWbBtTI/AAAAAAAAAFk/9zhgRRMIdmA/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2662543901542679221.post-8982702497237003588</id><published>2009-01-29T10:31:00.001Z</published><updated>2009-01-29T10:35:31.681Z</updated><title type='text'>Fast Sprites using Pre-Shifted Data</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I wrote this demo on September 15th 2006.&amp;#160; &lt;/p&gt;  &lt;p&gt;The purpose was to develop a sprite engine (XOR to remove/display) that allows developer to concentrate on creating graphics and animation and not worry about shifting bytes, or pixel perfect collision.&amp;#160; I also wanted to get as many sprites on the screen at any one time by using the screen refresh to time drawing of each sprite.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_XV-UYycKBhQ/SYGFah3crJI/AAAAAAAAAFY/fQLaq8ArHuA/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_XV-UYycKBhQ/SYGFbg3pnZI/AAAAAAAAAFc/GxGslLa7slw/image_thumb%5B3%5D.png?imgmax=800" width="443" height="416" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Advantages&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;No need for pre-shifted graphics (Frame 1,2 etc), saving memory space&lt;/li&gt;    &lt;li&gt;Pixel perfect collision&lt;/li&gt;    &lt;li&gt;Full screen&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Timing&lt;/h2&gt;  &lt;p&gt;On each 1/50th of a second:&lt;/p&gt;  &lt;p&gt;For each sprite (1-4):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;move&lt;/li&gt;    &lt;li&gt;remove&lt;/li&gt;    &lt;li&gt;check for collision&lt;/li&gt;    &lt;li&gt;draw&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If more than 4 sprites, we handle it like this (1/25th second)&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;LOOP 1     &lt;br /&gt;Process first 4 sprites (Remove, draw)      &lt;br /&gt;Draw ALL sprite attributes &lt;/li&gt;    &lt;li&gt;LOOP 2     &lt;br /&gt;Process remaining sprites &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This demo allows for the drawing of 8 sprites.&amp;#160; We can do this before the scan line hits the main screen (whilst still in border) if we time sprites right:&lt;/p&gt;  &lt;p&gt;The following sprites can appear on the following rows to beat scan line (Flicker/No Visibility):&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Sprites 1 and 2 can appear anywhere on screen&lt;/li&gt;    &lt;li&gt;Sprite 3 can appear on rows 7-22&lt;/li&gt;    &lt;li&gt;Sprite 4 can appear on rows 12-22 &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The same then applies for 5 and 6,7 and 8 on loop 2.&amp;#160; Then, for all the extra time we have before the next screen refresh, we would fill in the remaining time of the second drawing with music, or other animation. &lt;/p&gt;  &lt;h2&gt;Colour&lt;/h2&gt;  &lt;p&gt;When the sprite is drawn, to avoid flicker, the screen attributes are &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Copied to the attribute buffer&lt;/li&gt;    &lt;li&gt;Sprite attributes are written to the buffer&lt;/li&gt;    &lt;li&gt;The attribute buffer is copied to the screen&lt;/li&gt; &lt;/ol&gt;  &lt;h2&gt;Download&lt;/h2&gt;  &lt;p&gt;You can download the source code and TAP file from &lt;a href="http://www.peargames.co.uk/downloads/fsprites.zip"&gt;http://www.peargames.co.uk/downloads/fsprites.zip&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;To run, set up your development environment as described in my previous post, and open “fsprites.asm”.&amp;#160; &lt;/li&gt;    &lt;li&gt;In “ConText”, press F9 to compile, F10 to run in “Spectaculator”&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Next Steps&lt;/h2&gt;  &lt;p&gt;I plan to write a detailed walkthrough of the code to explain how it all works, watch this space ;-) !&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2662543901542679221-8982702497237003588?l=zxspectrumdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zxspectrumdev.blogspot.com/feeds/8982702497237003588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/01/fast-sprites-using-pre-shifted-data.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/8982702497237003588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/8982702497237003588'/><link rel='alternate' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/01/fast-sprites-using-pre-shifted-data.html' title='Fast Sprites using Pre-Shifted Data'/><author><name>Rob</name><uri>http://www.blogger.com/profile/12744061461211205009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_XV-UYycKBhQ/SYGFbg3pnZI/AAAAAAAAAFc/GxGslLa7slw/s72-c/image_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2662543901542679221.post-4864360498189892595</id><published>2009-01-28T17:12:00.004Z</published><updated>2010-11-25T16:29:06.069Z</updated><title type='text'>Setting up the Development Environment on a Windows PC</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;When I develop Machine Code games for the Sinclair ZX Spectrum, I use the following Development Tools:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;ConText Text Editor (&lt;a href="http://www.contexteditor.org/"&gt;http://www.contexteditor.org/&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Pasmo Assembler (&lt;a href="http://www.speccy.org/pasmo/"&gt;Pasmo&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Spectaculator Emulator (&lt;a href="http://www.spectaculator.com/"&gt;http://www.spectaculator.com/&lt;/a&gt;) &lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Installing “Spectaculator”&lt;/h2&gt;&lt;p&gt;Download and Install “Spectaculator” 30 Day Trial. I cannot recommend this emulator more highly, it is awesome&lt;/p&gt;&lt;h2&gt;Installing “Context” Editor&lt;/h2&gt;&lt;p&gt;The Editor allows me to write the code with Syntax Highlighting, as well as define events for key presses that assist me in running and testing my programs.&lt;/p&gt;&lt;p&gt;Download the editor (1.6 MB) from &lt;a href="http://www.contexteditor.org/"&gt;http://www.contexteditor.org/&lt;/a&gt; andfollow the installation instructions:&lt;/p&gt;&lt;p&gt;Step 1:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_XV-UYycKBhQ/SYCRkuXVhNI/AAAAAAAAADI/mmZE4Is3AXA/s1600-h/image%5B58%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_XV-UYycKBhQ/SYCRlbf_xSI/AAAAAAAAADM/isOz7VXYwKU/image_thumb%5B26%5D.png?imgmax=800" width="370" height="288" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Step 2:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCRmSgU0lI/AAAAAAAAADQ/dyu7_NAqJds/s1600-h/image%5B59%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_XV-UYycKBhQ/SYCRnLLqGcI/AAAAAAAAADU/KieO8xQn6MQ/image_thumb%5B27%5D.png?imgmax=800" width="374" height="291" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;And follow the wizard until it has installed&lt;/p&gt;&lt;h2&gt;Install “Pasmo” Assembler&lt;/h2&gt;&lt;p&gt;Next, download the Assembler from &lt;a href="http://www.arrakis.es/~ninsesabe/pasmo/"&gt;http://www.arrakis.es/~ninsesabe/pasmo/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I use the 0.5.3 version, downloadable as a ZIP from &lt;a title="pasmo-0.5.3.zip" href="http://pasmo.euler.es/bin/pasmo-0.5.3.zip"&gt;pasmo-0.5.3.zip&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Once downloaded, Unzip and extract.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCRyTR8yyI/AAAAAAAAAEY/01bvfHD2qm0/s1600-h/image%5B66%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_XV-UYycKBhQ/SYCRzRhe35I/AAAAAAAAAEc/C836JYERo2Y/image_thumb%5B34%5D.png?imgmax=800" width="409" height="293" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Install in a directory of your choice&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCR0LnJUbI/AAAAAAAAAEg/pOyF3ysHcHo/s1600-h/image%5B67%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_XV-UYycKBhQ/SYCR0nHMPkI/AAAAAAAAAEk/407dTmm2qdE/image_thumb%5B35%5D.png?imgmax=800" width="477" height="355" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;h2&gt;Configure Context&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;From the menu choose “Options -&amp;gt; Environment”. A dialog box will appear. &lt;/li&gt;&lt;li&gt;Click the “Execute Keys” tab. &lt;/li&gt;&lt;li&gt;Click the “Add” button, and add an entry for files with a “asm” extension. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_XV-UYycKBhQ/SYCR1LTYeeI/AAAAAAAAAEo/arBt7tCPkyk/s1600-h/image%5B68%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_XV-UYycKBhQ/SYCR1oC0d6I/AAAAAAAAAEs/qIE6NqW6O44/image_thumb%5B36%5D.png?imgmax=800" width="328" height="193" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;Set up the “F9” Functionality.&lt;/h3&gt;&lt;p&gt;This will allow the file to be compiled, and a “TAP” file which includes a BASIC loader will be created.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCR2o6_BzI/AAAAAAAAAEw/X3RoW_zK0pg/s1600-h/image%5B69%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCR3dS8kdI/AAAAAAAAAE0/qDu4eM1HAq8/image_thumb%5B37%5D.png?imgmax=800" width="479" height="589" /&gt;&lt;/a&gt; &lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Execute:&lt;/strong&gt; Browse To and Select the Pasmo executable. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Start in:&lt;/strong&gt; %p (File path) &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; --tapbas %n %F.tap &lt;ul&gt;&lt;li&gt;This will create a ZX Spectrum TAP file with BASIC loader, output to same filename with “TAP” extension. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Use short DOS names for Pasmo. &lt;/li&gt;&lt;li&gt;Output to compiler window. &lt;/li&gt;&lt;li&gt;Scroll to last line for verbose output. &lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Set up the “F10” functionality&lt;/h3&gt;&lt;p&gt;This will execute “Spectaculator” and pass in the compiled filename.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_XV-UYycKBhQ/SYCR4wH_CJI/AAAAAAAAAE4/jCHnsqEWdTE/s1600-h/image%5B70%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_XV-UYycKBhQ/SYCR5yLQtxI/AAAAAAAAAE8/6yK-87uAu68/image_thumb%5B38%5D.png?imgmax=800" width="474" height="581" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Execute:&lt;/strong&gt; Points to the Spectaculator executable. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Start in&lt;/strong&gt;: %p (File path) &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; %p\%F.tap &lt;ul&gt;&lt;li&gt;This means Path, and Filename (tap) &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Use short DOS names for Emulator &lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Testing the Development Environment&lt;/h2&gt;&lt;p&gt;Create the following test program in Context, and save to your project folder as “text.asm”.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;org 08000h&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;ld hl,04000h&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;ld (hl),%10101010&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;ld de,04001h&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;ld bc,17FFh&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;ldir&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;ret&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;end 08000h&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Press “F9” and the program should assemble.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCR6z5-zMI/AAAAAAAAAFI/qrMsv0eubMQ/s1600-h/image%5B71%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCR7hbbP2I/AAAAAAAAAFM/RtZpdWqud3U/image_thumb%5B39%5D.png?imgmax=800" width="585" height="488" /&gt;&lt;/a&gt; &lt;p&gt;Press “F10” to execute “Spectaculator” and you should get the following results:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_XV-UYycKBhQ/SYCR8AayLjI/AAAAAAAAAFQ/AdDexpxPvpA/s1600-h/image%5B72%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_XV-UYycKBhQ/SYCR9ZXEBdI/AAAAAAAAAFU/yypSxO1qYUc/image_thumb%5B40%5D.png?imgmax=800" width="472" height="447" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Congratulations! You are now ready to develop Machine Code on your Windows PC!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2662543901542679221-4864360498189892595?l=zxspectrumdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zxspectrumdev.blogspot.com/feeds/4864360498189892595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/01/setting-up-development-environment-on.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/4864360498189892595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2662543901542679221/posts/default/4864360498189892595'/><link rel='alternate' type='text/html' href='http://zxspectrumdev.blogspot.com/2009/01/setting-up-development-environment-on.html' title='Setting up the Development Environment on a Windows PC'/><author><name>Rob</name><uri>http://www.blogger.com/profile/12744061461211205009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_XV-UYycKBhQ/SYCRlbf_xSI/AAAAAAAAADM/isOz7VXYwKU/s72-c/image_thumb%5B26%5D.png?imgmax=800' height='72' width='72'/><thr:total>9</thr:total></entry></feed>
