commit ad30d3d7e9a09009efcf95ef330ff6d8b48bbcf1
Author: thing1 <thing1@seacrossedlovers.xyz>
Date: Sun, 30 Nov 2025 18:42:20 +0000
init commit
Diffstat:
| A | 0 | | | 5 | +++++ |
| A | 1 | | | 7 | +++++++ |
| A | 10 | | | 5 | +++++ |
| A | 11 | | | 13 | +++++++++++++ |
| A | 12 | | | 18 | ++++++++++++++++++ |
| A | 13 | | | 23 | +++++++++++++++++++++++ |
| A | 14 | | | 29 | +++++++++++++++++++++++++++++ |
| A | 15 | | | 31 | +++++++++++++++++++++++++++++++ |
| A | 16 | | | 5 | +++++ |
| A | 17 | | | 7 | +++++++ |
| A | 18 | | | 9 | +++++++++ |
| A | 19 | | | 12 | ++++++++++++ |
| A | 2 | | | 9 | +++++++++ |
| A | 20 | | | 14 | ++++++++++++++ |
| A | 21 | | | 17 | +++++++++++++++++ |
| A | 22 | | | 19 | +++++++++++++++++++ |
| A | 23 | | | 21 | +++++++++++++++++++++ |
| A | 24 | | | 4 | ++++ |
| A | 25 | | | 16 | ++++++++++++++++ |
| A | 26 | | | 21 | +++++++++++++++++++++ |
| A | 27 | | | 55 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | 28 | | | 10 | ++++++++++ |
| A | 29 | | | 46 | ++++++++++++++++++++++++++++++++++++++++++++++ |
| A | 3 | | | 11 | +++++++++++ |
| A | 30 | | | 10 | ++++++++++ |
| A | 31 | | | 8 | ++++++++ |
| A | 32 | | | 4 | ++++ |
| A | 33 | | | 6 | ++++++ |
| A | 34 | | | 11 | +++++++++++ |
| A | 35 | | | 14 | ++++++++++++++ |
| A | 36 | | | 4 | ++++ |
| A | 37 | | | 10 | ++++++++++ |
| A | 4 | | | 5 | +++++ |
| A | 5 | | | 7 | +++++++ |
| A | 6 | | | 8 | ++++++++ |
| A | 7 | | | 10 | ++++++++++ |
| A | 8 | | | 14 | ++++++++++++++ |
| A | 9 | | | 16 | ++++++++++++++++ |
| A | index | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
39 files changed, 573 insertions(+), 0 deletions(-)
diff --git a/0 b/0
@@ -0,0 +1,4 @@
+
+
+ Howdy and welcome to the talk
+ ------------------------
+\ No newline at end of file
diff --git a/1 b/1
@@ -0,0 +1,6 @@
+
+
+ Howdy and welcome to the talk
+ ------------------------
+
+ - Talking on asm
+\ No newline at end of file
diff --git a/10 b/10
@@ -0,0 +1,4 @@
+
+
+ How big was the game?
+ ------------------
+\ No newline at end of file
diff --git a/11 b/11
@@ -0,0 +1,13 @@
+
+
+ How big was the game?
+ ------------------
+
+ % wc -l *
+ 20 Makefile
+ 410 game.S
+ 127 run
+ 123 mapgen.c
+ 17 pp.c
+ 697 total
+
diff --git a/12 b/12
@@ -0,0 +1,17 @@
+
+
+ How big was the game?
+ ------------------
+
+ % wc -l *
+ 20 Makefile
+ 410 game.S
+ 127 run
+ 123 mapgen.c
+ 17 pp.c
+ 697 total
+
+ game.S: Is the main logic for the game,
+ it handles printing, moving and
+ other such tasks.
+
+\ No newline at end of file
diff --git a/13 b/13
@@ -0,0 +1,22 @@
+
+
+ How big was the game?
+ ------------------
+
+ % wc -l *
+ 20 Makefile
+ 410 game.S
+ 127 run
+ 123 mapgen.c
+ 17 pp.c
+ 697 total
+
+ game.S: Is the main logic for the game,
+ it handles printing, moving and
+ other such tasks.
+
+ mapgen.c: This runs at the start of every
+ game, it generates asm that
+ needs to be assembled and
+ then linked with game.S.
+
+\ No newline at end of file
diff --git a/14 b/14
@@ -0,0 +1,28 @@
+
+
+ How big was the game?
+ ------------------
+
+ % wc -l *
+ 20 Makefile
+ 410 game.S
+ 127 run
+ 123 mapgen.c
+ 17 pp.c
+ 697 total
+
+ game.S: Is the main logic for the game,
+ it handles printing, moving and
+ other such tasks.
+
+ mapgen.c: This runs at the start of every
+ game, it generates asm that
+ needs to be assembled and
+ then linked with game.S.
+
+ run: This is a shell script, its job is
+ to call mapgen, link the exec,
+ and put the terminal in raw
+ mode. It also prints the opening
+ dialog and starts the music.
+
+\ No newline at end of file
diff --git a/15 b/15
@@ -0,0 +1,30 @@
+
+
+ How big was the game?
+ ------------------
+
+ % wc -l *
+ 20 Makefile
+ 410 game.S
+ 127 run
+ 123 mapgen.c
+ 17 pp.c
+ 697 total
+
+ game.S: Is the main logic for the game,
+ it handles printing, moving and
+ other such tasks.
+
+ mapgen.c: This runs at the start of every
+ game, it generates asm that
+ needs to be assembled and
+ then linked with game.S.
+
+ run: This is a shell script, its job is
+ to call mapgen, link the exec,
+ and put the terminal in raw
+ mode. It also prints the opening
+ dialog and starts the music.
+
+ pp.c Pretty printer used to make the
+ opening nicer,
+\ No newline at end of file
diff --git a/16 b/16
@@ -0,0 +1,4 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+\ No newline at end of file
diff --git a/17 b/17
@@ -0,0 +1,6 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+\ No newline at end of file
diff --git a/18 b/18
@@ -0,0 +1,8 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+
+ - Every cpu architecture has its own version of asm
+\ No newline at end of file
diff --git a/19 b/19
@@ -0,0 +1,11 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+
+ - Every cpu architecture has its own version of asm
+
+ - Different assemblers have different syntax,
+ while producing the same machine code
+\ No newline at end of file
diff --git a/2 b/2
@@ -0,0 +1,8 @@
+
+
+ Howdy and welcome to the talk
+ ------------------------
+
+ - Talking on asm
+
+ - Talking on gamedev
+\ No newline at end of file
diff --git a/20 b/20
@@ -0,0 +1,14 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+
+ - Every cpu architecture has its own version of asm
+
+ - Different assemblers have different syntax,
+ while producing the same machine code
+
+ This program
+ -----------
diff --git a/21 b/21
@@ -0,0 +1,17 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+
+ - Every cpu architecture has its own version of asm
+
+ - Different assemblers have different syntax,
+ while producing the same machine code
+
+ This program
+ -----------
+
+ - Written in GAS (gnu assembler), for 64 bit linux systems
+
diff --git a/22 b/22
@@ -0,0 +1,19 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+
+ - Every cpu architecture has its own version of asm
+
+ - Different assemblers have different syntax,
+ while producing the same machine code
+
+ This program
+ -----------
+
+ - Written in GAS (gnu assembler), for 64 bit linux systems
+
+ - Does not rely on libc, uses syscalls straight to the kernel
+
diff --git a/23 b/23
@@ -0,0 +1,21 @@
+
+
+ Some general notes on asm, this program, and stuff
+ ----------------------------------------
+
+ - Asm is what most languages compile to
+
+ - Every cpu architecture has its own version of asm
+
+ - Different assemblers have different syntax,
+ while producing the same machine code
+
+ This program
+ -----------
+
+ - Written in GAS (gnu assembler), for 64 bit linux systems
+
+ - Does not rely on libc, uses syscalls straight to the kernel
+
+ - Makes no stack or heap memory allocation, excluding
+ call stack (runs entirely in the 15 registers from x86_64)
diff --git a/24 b/24
@@ -0,0 +1,4 @@
+
+
+ Top level overview
+ ---------------
diff --git a/25 b/25
@@ -0,0 +1,16 @@
+
+
+ Top level overview
+ ---------------
+
+ The entire game runs with these functions
+
+ putline
+ printscreen
+ clearscreen
+ drawtextbuf
+ drawframe
+ moveplayer
+ zero
+ strcpy
+ _start
diff --git a/26 b/26
@@ -0,0 +1,20 @@
+
+
+ Top level overview
+ ---------------
+
+ The entire game runs with these functions
+
+ putline
+ printscreen
+ clearscreen
+ drawtextbuf
+ drawframe
+ moveplayer
+ zero
+ strcpy
+ _start
+
+ Originally I was going to show a version of the game
+ re-written in C here but i didn't have time to finish it,
+ so instead lets break things down in pseudo code
+\ No newline at end of file
diff --git a/27 b/27
@@ -0,0 +1,54 @@
+
+
+ Top level overview
+ ---------------
+
+ putline
+
+ Equivilent C function: void putline(char *map, int off);
+
+ Use: Draws one line of the map, at the postion "off"
+
+ How: For loop
+
+ Code:
+
+
+ putline:
+ save
+
+ mov %rsi, %r14 /* off arg */
+ mov %rdi, %r15 /* map arg */
+
+ mov %r14, %r13
+ add %r14, %r15
+ .loop1:
+ mov $999, %r11 /* condition 1 */
+ cmp %r13, %r11
+ jl .eloop1
+
+ mov %r13, %r12 /* condition 2 */
+ sub %r14, %r12
+ mov $20, %r11
+ cmp %r12, %r11
+ jl .eloop1
+
+ mov $1, %rax /* putc(map[i]); */
+ mov $1, %rdi
+ mov %r15, %rsi
+ inc %r15
+ mov $1, %rdx
+ syscall
+
+ inc %r13 /* i++ */
+ jmp .loop1
+ .eloop1:
+
+ mov $1, %rax
+ mov $1, %rdi
+ mov $nl, %rsi
+ mov $2, %rdx
+ syscall
+
+ restore
+ ret
+\ No newline at end of file
diff --git a/28 b/28
@@ -0,0 +1,9 @@
+
+
+ Top level overview
+ ---------------
+
+ func putline (map, off):
+ for i = 0; i < 1000 && off - i < 20; i++:
+ print(map + off)
+ print(\n)
+\ No newline at end of file
diff --git a/29 b/29
@@ -0,0 +1,46 @@
+
+
+ Top level overview
+ ---------------
+
+ printscreen
+
+ Equivilent C function: void printscreen(char *map);
+
+ Use: Draws the entire map around the player
+
+ How: For loop + maths
+
+ Code:
+
+
+ printscreen:
+ save
+
+ /* map arg in rsi */
+
+ mov %r8, %r10 /* decide where to draw the screen (centers the player) */
+ mov %r9, %r11
+ sub $10, %r10
+ sub $10, %r11
+ mov %rsi, %r12
+ mov $1000, %rax
+ mul %r11
+ lea (%rax,%r12), %r12
+
+ mov $0, %r13 /* draw the camera's view */
+ mov $21, %r14
+ mov $0, %r15
+ .putlines:
+ lea (%r15,%r12), %rdi
+ mov %r10, %rsi
+ call putline
+ add $1000, %r15
+ add $1, %r13
+ cmp %r13, %r14
+ jne .putlines
+
+ restore
+ ret
+
+
diff --git a/3 b/3
@@ -0,0 +1,10 @@
+
+
+ Howdy and welcome to the talk
+ ------------------------
+
+ - Talking on asm
+
+ - Talking on gamedev
+
+ - Showing off how small a "game" can be
+\ No newline at end of file
diff --git a/30 b/30
@@ -0,0 +1,9 @@
+
+
+ Top level overview
+ ---------------
+
+ func printscreen(map):
+ screen = map[y - 10]
+ for i = 0; i < 20; i++:
+ printline(screen, y - 10)
+\ No newline at end of file
diff --git a/31 b/31
@@ -0,0 +1,7 @@
+
+
+ Top level overview
+ ---------------
+
+ I won't go into full details of the others, as they are mostly
+ switch statments on the dialog options and input
+\ No newline at end of file
diff --git a/32 b/32
@@ -0,0 +1,4 @@
+
+
+ More general notes
+ ---------------
diff --git a/33 b/33
@@ -0,0 +1,6 @@
+
+
+ More general notes
+ ---------------
+
+ - The map is just one long array of chars 1000 x 1000, it takes up 1MB
diff --git a/34 b/34
@@ -0,0 +1,11 @@
+
+
+ More general notes
+ ---------------
+
+ - The map is just one long array of chars 1000 x 1000, it takes up 1MB
+
+ - The game doesn't check stop you from walking through walls, it didn't
+ make the gameplay much better having it, and it would have taken alot
+ to make
+
diff --git a/35 b/35
@@ -0,0 +1,13 @@
+
+
+ More general notes
+ ---------------
+
+ - The map is just one long array of chars 1000 x 1000, it takes up 1MB
+
+ - The game doesn't check stop you from walking through walls, it didn't
+ make the gameplay much better having it, and it would have taken alot
+ to make
+
+ - The player overwrites anything they walk on with an '@' and every time
+ the player moves, a ' ' is written to where they were previously
+\ No newline at end of file
diff --git a/36 b/36
@@ -0,0 +1,4 @@
+
+
+ I ran out of things to talk about
+ ------------------------
diff --git a/37 b/37
@@ -0,0 +1,9 @@
+
+
+ I ran out of things to talk about
+ ------------------------
+
+ Any questions?
+
+
+ (yes these slides are running in acme, all praise glenda!!!!)
+\ No newline at end of file
diff --git a/4 b/4
@@ -0,0 +1,4 @@
+
+
+ So what game did I make?
+ --------------------
+\ No newline at end of file
diff --git a/5 b/5
@@ -0,0 +1,6 @@
+
+
+ So what game did I make?
+ --------------------
+
+ - I made "docs ghost" for the ascii gamejam
+\ No newline at end of file
diff --git a/6 b/6
@@ -0,0 +1,8 @@
+
+
+ So what game did I make?
+ --------------------
+
+ - I made "docs ghost" for the ascii gamejam
+
+ - The game is written in a mixture of asm and C
diff --git a/7 b/7
@@ -0,0 +1,10 @@
+
+
+ So what game did I make?
+ --------------------
+
+ - I made "docs ghost" for the ascii gamejam
+
+ - The game is written in a mixture of asm and C
+ - C handles the map gen
+ - asm plays the game
diff --git a/8 b/8
@@ -0,0 +1,13 @@
+
+
+ So what game did I make?
+ --------------------
+
+ - I made "docs ghost" for the ascii gamejam
+
+ - The game is written in a mixture of asm and C
+ - C handles the map gen
+ - asm plays the game
+
+ Why?
+ ----
+\ No newline at end of file
diff --git a/9 b/9
@@ -0,0 +1,15 @@
+
+
+ So what game did I make?
+ --------------------
+
+ - I made "docs ghost" for the ascii gamejam
+
+ - The game is written in a mixture of asm and C
+ - C handles the map gen
+ - asm plays the game
+
+ Why?
+ ----
+
+ - Great question.... I still don't know
+\ No newline at end of file
diff --git a/index b/index
@@ -0,0 +1,38 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+\ No newline at end of file