mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-12 23:53:56 +00:00
refactor continutes
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.0" orientation="orthogonal" renderorder="left-down" width="100" height="16" tilewidth="16" tileheight="16" nextobjectid="1">
|
||||
<map version="1.0" orientation="orthogonal" renderorder="left-down" width="200" height="16" tilewidth="16" tileheight="16" nextobjectid="1">
|
||||
<tileset firstgid="1" name="tilemap" tilewidth="16" tileheight="16" tilecount="320" columns="20">
|
||||
<image source="assets/tilemap.png" width="320" height="256"/>
|
||||
</tileset>
|
||||
<layer name="background" width="100" height="16">
|
||||
<layer name="background" width="200" height="16">
|
||||
<data encoding="base64" compression="zlib">
|
||||
eJztmMsNwjAMhrMAQxSVxwK8WYHHAiB1BNj/gC8VUhSc346bJhWH71I1ru3Yzt90zrkOpA08exBP5dqeveBdbh3HglgSK2IN2gvF5vsm8SHFT/Q7L+Jt7JPPzsDGgTgSJ+KcITbf534fY3Wh8ZPDul44GmIOvnshrsSNuGf0UZpvqZ+afIfqG5kfMTbEdsTcauLg8m0xB4aqkxJA8lNDHAilzI+pxIH0qVX/oRpuCvj6bQauy9mnVhoOja1GSunTVNDzuHG4luOwsmONpZZIsYX2uUTLcX1YgiYsmZr73OKf4c+XVJ0iOcM1Z2fj5LO1phrxc/JLp7TgXqX0NmJfM1ulOk+z52PUQ2iv0HtWrX0LpDWScp6Gep6rB8v8aRjy+1oNJblv09zNxerBz0nsvv4DB9VA2Q==
|
||||
eJztmkFuwjAQAP0BHkFFgQ+UJNAvQPsB+APc+D2bA1Jkpc6uvYFUmcMckBxjzyq2d+M6hHDvsIp+/0WtbNfyKayFjbBV9ncWLgNjs4whZ064wMUQlUMfjbAXDsK38pmrcHMa89OfJh64wEXpvFqWwoey7VE4CT/Cr9P/vyoeuJi3i9z35UvYvXFOLdb3PhWPChe46HHhuXZ4otm/m+C7BuICFzHv3NdK8d6fcYELK331grmCC1zElNQLuiwmMBdc4OI/oc2jLDWRFF794AIXWkrq4E3Q5VGWmkhqPRq7toILXHgylfr3FMAFLqYE+SUuLC5yzmBjfJcfi3h/TeWXuMBF3C7nDNYE23cY7zxorDjgAhceWM+JJXlQX36VioP2vikucFFKbi3Ccs84507yUBxiFx73oHExLxcPLXqIig==
|
||||
</data>
|
||||
</layer>
|
||||
</map>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
FOREGROUND_DELAY_BIT equ 0
|
||||
|
||||
FOREGROUND_SCROLL_SHIFT_CONVERT equ 1
|
||||
FOREGROUND_SCROLL_PIXELS equ 2
|
||||
FOREGROUND_SCROLL_SHIFT_CONVERT equ 4
|
||||
FOREGROUND_SCROLL_TILE_INDEX_CONVERT equ 3
|
||||
FOREGROUND_SCROLL_PIXELS equ 16
|
||||
|
||||
BACKGROUND_SCROLL_SHIFT_CONVERT equ 4
|
||||
BACKGROUND_SCROLL_TILE_INDEX_CONVERT equ 3
|
||||
|
||||
+26
-20
@@ -22,7 +22,7 @@ Entry:
|
||||
move #$7fff,INTENA(a6) ; disable all interrupts
|
||||
|
||||
jsr InstallPalette
|
||||
move.w #$09e,COLOR00(a6)
|
||||
;; move.w #$09e,COLOR00(a6)
|
||||
move.w #$09e,COLOR08(a6)
|
||||
|
||||
lea Level3InterruptHandler,a3
|
||||
@@ -48,15 +48,6 @@ Reset:
|
||||
move.l #-1,frameCount
|
||||
|
||||
MainLoop:
|
||||
|
||||
move.w #$09e,COLOR00(a6)
|
||||
move.w #$09e,COLOR08(a6)
|
||||
|
||||
bsr Update
|
||||
|
||||
bsr RenderNextForegroundFrame
|
||||
bsr RenderNextBackgroundFrame
|
||||
|
||||
jsr WaitVerticalBlank
|
||||
bsr.s HoriScrollPlayfield
|
||||
jsr SwitchBuffers ; takes bitplane pointer offset in d0
|
||||
@@ -64,6 +55,15 @@ MainLoop:
|
||||
move.w #$000,COLOR00(a6)
|
||||
move.w #$000,COLOR08(a6)
|
||||
|
||||
|
||||
bsr Update
|
||||
|
||||
bsr RenderNextForegroundFrame
|
||||
bsr RenderNextBackgroundFrame
|
||||
|
||||
move.w #$09e,COLOR00(a6)
|
||||
move.w #$09e,COLOR08(a6)
|
||||
|
||||
bra MainLoop
|
||||
|
||||
Update:
|
||||
@@ -124,21 +124,26 @@ RenderNextBackgroundFrame:
|
||||
lea backgroundMap,a2
|
||||
move.l backgroundScrollX,d0
|
||||
lsr.l #BACKGROUND_SCROLL_TILE_INDEX_CONVERT,d0
|
||||
and.w #$fffe,d0
|
||||
and.b #$fe,d0
|
||||
add.l d0,a2
|
||||
;; add.l #1954,a2
|
||||
bsr RenderBackgroundTile
|
||||
rts
|
||||
|
||||
RenderNextForegroundFrame:
|
||||
lea map,a2
|
||||
add.l fg_tileIndex,a2
|
||||
move.l foregroundScrollX,d0
|
||||
lsr.l #FOREGROUND_SCROLL_TILE_INDEX_CONVERT,d0
|
||||
lsr.l #1,d0
|
||||
and.b #$fe,d0
|
||||
add.l d0,a2
|
||||
;; add.l fg_tileIndex,a2
|
||||
cmp.w #$FFFF,20(a2)
|
||||
bne .skip
|
||||
bra Reset
|
||||
.skip:
|
||||
bsr RenderForegroundTile
|
||||
bsr ClearForegroundTile
|
||||
.noRender
|
||||
rts
|
||||
|
||||
|
||||
@@ -155,9 +160,12 @@ RenderForegroundTile:
|
||||
add.w (a2),a1 ; source tile
|
||||
move.l foregroundScrollX,d2
|
||||
lsr.b #FOREGROUND_SCROLL_SHIFT_CONVERT,d2 ; convert to pixels
|
||||
|
||||
lsr.b #1,d2
|
||||
|
||||
andi.w #$f,d2 ; find the shift component
|
||||
cmp.b #8,d2 ;
|
||||
bge .skip
|
||||
;; bge .skip
|
||||
jsr BlitTile
|
||||
.skip:
|
||||
rts
|
||||
@@ -167,6 +175,7 @@ ClearForegroundTile
|
||||
add.w #11520,a1 ; source tile
|
||||
move.l foregroundScrollX,d2
|
||||
lsr.b #FOREGROUND_SCROLL_SHIFT_CONVERT,d2 ; convert to pixels
|
||||
lsr.b #1,d2
|
||||
andi.w #$f,d2 ; find the shift component
|
||||
cmp.b #8,d2
|
||||
bge .skip
|
||||
@@ -273,15 +282,12 @@ verticalBlankCount:
|
||||
|
||||
section .bss
|
||||
foregroundBitplanes1:
|
||||
ds.b IMAGESIZE
|
||||
ds.b BITPLANE_WIDTH_BYTES*20
|
||||
ds.b IMAGESIZE*3
|
||||
foregroundBitplanes2:
|
||||
ds.b IMAGESIZE
|
||||
ds.b BITPLANE_WIDTH_BYTES*20
|
||||
ds.b IMAGESIZE*3
|
||||
|
||||
backgroundBitplanes1:
|
||||
ds.b IMAGESIZE
|
||||
ds.b BITPLANE_WIDTH_BYTES*20
|
||||
ds.b IMAGESIZE*2
|
||||
|
||||
startUserstack:
|
||||
ds.b $1000 ; size of stack
|
||||
|
||||
Reference in New Issue
Block a user