• R/O
  • SSH
  • HTTPS

oricsdk: Commit


Commit MetaInfo

Revision1585 (tree)
Time2022-07-19 19:40:22
Authordbug

Log Message

Added the source code of MonoSlide, a 256 bytes intro presented at the Sommarhack 2022 demoparty

Change Summary

Incremental Difference

--- public/atari/demos/defenceforce/MonoSlide/MonoSlide.s (nonexistent)
+++ public/atari/demos/defenceforce/MonoSlide/MonoSlide.s (revision 1585)
@@ -0,0 +1,144 @@
1+;
2+; MonoSlide
3+;
4+; 256 bytes monochrome mode intro by Dbug for Sommarhack 2022 (8th to 10 July)
5+;
6+; - Idea came from the 2020 MindBender and the Monochrome compo -
7+; Thanks to Tat for the 64bit rotation suggestion
8+;
9+; 268 bytes
10+
11+enable_proper_setup equ 0 ; Enables the tabbed out code for easier testing
12+
13+ opt o+,w+
14+
15+ section TEXT
16+
17+ clr.l -(sp)
18+ move.w #$20,-(sp) ; Switch to Supervisor mode
19+ trap #1
20+ ifne enable_proper_setup
21+ addq.l #6,sp ; We switch to supervisor, but never come back so no need to correct the stack pointer
22+ move.l d0,-(sp) ; Except during development process when it's nice to be able to go back to the editor
23+ endc
24+
25+ dc.w $a00a ; Hide the mouse cursor
26+
27+ pea Message(pc) ; Print the "Dbug @ Sommarhack 2022" message (which also erases the screen)
28+ move.w #9,-(sp)
29+ trap #1
30+ ifne enable_proper_setup
31+ addq.l #6,sp
32+ endc
33+
34+loop_patterns
35+ addq.w #1,a6 ; Evolve the pattern
36+
37+ moveq #1,d7 ; By default we only wait one frame
38+
39+ move.w a6,d4
40+ move.w d4,d5
41+ and.w #7,d5
42+ bne.s .end_pause
43+ moveq #71,d7 ; We are in Monochrome the screen is not at 50hz
44+.end_pause
45+
46+ moveq.l #62,d5
47+ sub.w a6,d5
48+
49+.delay_loop
50+ move.w #37,-(sp) ; Vertical Synchronization (adds a 1/71th of a second delay)
51+ trap #14
52+ addq.l #2,sp
53+
54+ ifne enable_proper_setup
55+ cmp.b #$39,$fffffc02.w ; Keyboard check
56+ bne.s .no_key_pressed
57+ dc.w $a009 ; Show the mouse cursor
58+ move.w #$20,-(sp) ; Return to user mode (using the stack value stored earlier)
59+ trap #1
60+ addq.l #6,sp
61+ clr.w -(sp) ; Back to the caller (Called Gemdos Pterm0)
62+ trap #1
63+.no_key_pressed
64+ endc
65+
66+ dbra d7,.delay_loop
67+
68+ ; Do some weird noise with the YM using the current shift registers
69+ lea YmData(pc),a0
70+ move.b d4,1(a0)
71+ move.b d5,3(a0)
72+ moveq #4-1,d0
73+.loop_ym
74+ move.b (a0)+,$ffff8800.w
75+ move.b (a0)+,$ffff8802.w
76+ dbra d0,.loop_ym
77+
78+ move.l $44e.w,a0 ; screenpt
79+ lea 160*11(a0),a0
80+
81+ moveq #0,d6 ; Define a 64bit alternating pattern from black to white
82+ moveq #-1,d7
83+
84+ moveq #5-1,d2
85+loop_alternate
86+
87+ moveq #2-1,d1
88+loop_band
89+
90+ bsr.s DrawGrayLine ; Draw one separating gray line
91+
92+ move.w #32*10-1,d0 ; Draw one row of alternated white and black blocks
93+loop_black_white_blocks
94+ move.l d6,(a0)+
95+ move.l d7,(a0)+
96+ dbra d0,loop_black_white_blocks
97+
98+ move.l d4,d3
99+ moveq #0,d0
100+ and #63,d3
101+.loop ; Rotates D6-D7 by D4 amount
102+ add.l d6,d6
103+ addx.l d7,d7
104+ addx.l d0,d6
105+ dbra d3,.loop
106+
107+ dbra d1,loop_band
108+
109+ exg d4,d5 ; Change the direction of patterns
110+
111+ dbra d2,loop_alternate
112+
113+ bsr.s DrawGrayLine ; Draw one final gray line
114+
115+ ifne enable_proper_setup
116+ bra loop_patterns
117+ else
118+ bra.s loop_patterns
119+ endc
120+
121+DrawGrayLine ; Draw gray line - two pixels thick at a0
122+ moveq #80-1,d0
123+loop_separator_x
124+ move.b #%01010101,80(a0)
125+ move.b #%10101010,(a0)+
126+ dbra d0,loop_separator_x
127+ lea 80(a0),a0
128+ rts
129+
130+YmData
131+ dc.b 1,0 ; Channel A frequency (high byte)
132+ dc.b 6,0 ; Noise generator frequency
133+ dc.b 7,%11110110 ; Enable Channel A tone and noise
134+ dc.b 8,15 ; Channel A volume
135+
136+Message
137+ dc.b 27,"E" ; Erase the screen
138+ dc.b 174,"MonoSlide",175 ; Write MonoSlide at the top left
139+ dc.b 27,"Y",32+23,32+0,"256 bytes" ; Write 256 bytes at the bottom left
140+
141+ dc.b 27,"Y",32+23,32+58,"Dbug @ Sommarhack 2022" ; And finally the signature at the bottom right
142+ dc.b 0
143+
144+ end
Show on old repository browser