diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b3e01ccef8904e3f54d0975c26ce518c2cea3cf5..b1e8e6f57ba86691fe1ba30f3fa3e706a172e323 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -198,6 +198,13 @@ set(SRB2_R_OPENGL_HEADERS
 prepend_sources(SRB2_R_OPENGL_SOURCES)
 prepend_sources(SRB2_R_OPENGL_HEADERS)
 
+set(SRB2_NASM_SOURCES
+	tamp_mmx.nas
+	tmap.nas
+)
+
+prepend_sources(SRB2_NASM_SOURCES)
+
 ### Configuration
 set(SRB2_CONFIG_HAVE_BLUA ON CACHE BOOL
 	"Enable Lua interpreter support")
@@ -210,7 +217,7 @@ set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL
 set(SRB2_CONFIG_HWRENDER ON CACHE BOOL
 	"Enable hardware rendering through OpenGL")
 set(SRB2_CONFIG_USEASM OFF CACHE BOOL
-	"Enable nasm-implemented blit functions for moderate speedup")
+	"Enable NASM tmap implementation for software mode speedup.")
 set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
 	"Use statically linked OpenGL. NOT RECOMMENDED.")
 
@@ -341,6 +348,7 @@ if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
 endif()
 
 if(${SRB2_CONFIG_USEASM})
+	enable_language(ASM-NASM)
 	set(SRB2_USEASM ON)
 	add_definitions(-DUSEASM)
 else()
diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt
index 383e50258dcc12813628d901a059485c0be8a4a2..7df73acff9e0cc666983f0c1688baa3deb1b045a 100644
--- a/src/sdl/CMakeLists.txt
+++ b/src/sdl/CMakeLists.txt
@@ -71,6 +71,12 @@ if(${SDL2_FOUND})
 		)
 	endif()
 
+	if(${SRB2_USEASM})
+		set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
+			${SRB2_NASM_SOURCES}
+		)
+	endif()
+
 	if(${CMAKE_SYSTEM} MATCHES Windows)
 		set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
 			${CMAKE_SOURCE_DIR}/src/win32/win_dbg.c