wip: attempting to do gp_display_frame and gp_screen_init in asm

This commit is contained in:
2025-08-07 10:54:05 -04:00
parent 046800b9d8
commit ebc6895c61
5 changed files with 82 additions and 40 deletions
+28 -33
View File
@@ -5,38 +5,22 @@
.include "./asmdd/io.s"
.include "./asmdd/gp.s"
# DrawEnv_Packed { U32 tag; U32 code[15]; }
# DrawEnv_Packed
.equ DrawEnv_Packed_tag, 0
.equ DrawEnv_Packed_code, 4
.equ sizeof_DrawEnv_Packed, 64
# DrawEnv {
# Rect_S16 clip_area;
# A2_S16 drawwing_offset;
# Rect_S16 texture_page;
# BYTE flag_dither;
# BYTE flag_draw_on_display;
# BYTE enable_auto_clear;
# RGB8 initial_bg_color;
# // 2 bytes padding
# DrawEnv_Packed dr_env;
# };
.equ DrawEnv_clip_area, 0
.equ DrawEnv_drawwing_offset, 8
.equ DrawEnv_texture_page, 12
.equ DrawEnv_flag_dither, 20
.equ DrawEnv_flag_draw_on_display, 21
.equ DrawEnv_enable_auto_clear, 22
.equ DrawEnv_initial_bg_color, 23
# DrawEnv
.equ DrawEnv_clip_area, 0
.equ DrawEnv_drawing_offset, 8
.equ DrawEnv_texture_window, 12
.equ DrawEnv_texture_page, 20
.equ DrawEnv_flag_dither, 22
.equ DrawEnv_flag_draw_on_display, 23
.equ DrawEnv_enable_auto_clear, 24
.equ DrawEnv_initial_bg_color, 25
.equ DrawEnv_dr_env, 28
.equ sizeof_DrawEnv, 92
# DisplayEnv {
# Rect_S16 display_area;
# Rect_S16 screen;
# BYTE vinterlace;
# BYTE color24;
# BYTE pad0;
# BYTE pad1;
# };
# DisplayEnv
.equ DisplayEnv_display_area, 0
.equ DisplayEnv_screen, 8
.equ DisplayEnv_vinterlace, 16
@@ -44,10 +28,7 @@
.equ DisplayEnv_pad0, 18
.equ DisplayEnv_pad1, 19
.equ sizeof_DisplayEnv, 20
# DoubleBuffer {
# DrawEnv draw[2];
# DisplayEnv display[2];
# };
# DoubleBuffer
.equ DoubleBuffer_draw, 0
.equ DoubleBuffer_draw_0, 0
.equ DoubleBuffer_draw_1, 92 # 0 + sizeof_DrawEnv
@@ -58,8 +39,9 @@
# Screen Constants
.equ ScreenRes_X, 320
.equ ScreenRes_Y, 240
.equ ScreenRes_CenterX, (ScreenRes_X >> 2)
.equ ScreenRes_CenterY, (ScreenRes_Y >> 2)
.equ ScreenRes_CenterX, (ScreenRes_X >> 1)
.equ ScreenRes_CenterY, (ScreenRes_Y >> 1)
.global gp_screen_init
@@ -72,7 +54,20 @@ gp_screen_init:
gcmd_push gp1, rtmp_1, gp_Reset
gcmd_push gp1, rtmp_1, gp_DisplayEnabled
gcmd_push gp1, rtmp_1, gp_DisplayMode_320x240_15bit_NTSC
gcmd_push gp1, rtmp_1, gp_HorizontalDisplayRange_3168_608
gcmd_push gp1, rtmp_1, gp_VerticalDisplayRange_264_24
jump_reg rret_addr; nop
.Lgp_screen_init_end:
.size gp_screen_init, . - gp_screen_init
.global gp_display_frame
.type gp_display_frame, @function
gp_display_frame:
// TODO(Ed): Time to read docs
.Lgp_display_frame_end:
.size gp_display_frame, . - gp_display_frame