0x4000,0x6d01,text0,init
items
-0x93d6,0x0001,,code_ign # bug? overruns larr_9577
-0x93de,0x0001,,code_ign # bug? overruns harr_9637
+# draw_erase_x0: for drawing
+# draw_erase_x0 + 1: for erasing
+0x0000,0x0002,draw_erase_x0,byte
+# draw_erase_y0: for drawing
+# draw_erase_y0 + 1: for erasing
+0x0002,0x0002,draw_erase_y0,byte
+# draw_erase_shape: for drawing
+# draw_erase_shape + 1: for erasing
+0x0004,0x0002,draw_erase_shape,byte
+# clip_rect: x0
+# clip_rect + 1: x1
+# clip_rect + 2: y0
+# clip_rect + 3: y1
+0x0007,0x0004,clip_rect,byte
+0x000b,0x0001,draw_x1,byte
+0x000d,0x0001,draw_y1,byte
+# draw_x0: for drawing
+# draw_x0 + 1: for erasing
+0x0010,0x0002,draw_x0,byte
+# draw_y0: for drawing
+# draw_y0 + 1: for erasing
+0x0012,0x0002,draw_y0,byte
+0x0014,0x0002,video_line_ptr,word
+# lo byte of (shift count * 0x80) + shape
+# also y coordinate temporary storage
+0x0017,0x0001,draw_temp,byte
+0x0020,0x0001,draw_x_save,byte
+0x2000,0x0028,VIDEO_LINE_00,byte
+0x2028,0x0028,VIDEO_LINE_40,byte
+0x2050,0x0028,VIDEO_LINE_80,byte
+0x2080,0x0028,VIDEO_LINE_08,byte
+0x20a8,0x0028,VIDEO_LINE_48,byte
+0x20d0,0x0028,VIDEO_LINE_88,byte
+0x2100,0x0028,VIDEO_LINE_10,byte
+0x2128,0x0028,VIDEO_LINE_50,byte
+0x2150,0x0028,VIDEO_LINE_90,byte
+0x2180,0x0028,VIDEO_LINE_18,byte
+0x21a8,0x0028,VIDEO_LINE_58,byte
+0x21d0,0x0028,VIDEO_LINE_98,byte
+0x2200,0x0028,VIDEO_LINE_20,byte
+0x2228,0x0028,VIDEO_LINE_60,byte
+0x2250,0x0028,VIDEO_LINE_A0,byte
+0x2280,0x0028,VIDEO_LINE_28,byte
+0x22a8,0x0028,VIDEO_LINE_68,byte
+0x22d0,0x0028,VIDEO_LINE_A8,byte
+0x2300,0x0028,VIDEO_LINE_30,byte
+0x2328,0x0028,VIDEO_LINE_70,byte
+0x2350,0x0028,VIDEO_LINE_B0,byte
+0x2380,0x0028,VIDEO_LINE_38,byte
+0x23a8,0x0028,VIDEO_LINE_78,byte
+0x23d0,0x0028,VIDEO_LINE_B8,byte
+0x2400,0x0028,VIDEO_LINE_01,byte
+0x2428,0x0028,VIDEO_LINE_41,byte
+0x2450,0x0028,VIDEO_LINE_81,byte
+0x2480,0x0028,VIDEO_LINE_09,byte
+0x24a8,0x0028,VIDEO_LINE_49,byte
+0x24d0,0x0028,VIDEO_LINE_89,byte
+0x2500,0x0028,VIDEO_LINE_11,byte
+0x2528,0x0028,VIDEO_LINE_51,byte
+0x2550,0x0028,VIDEO_LINE_91,byte
+0x2580,0x0028,VIDEO_LINE_19,byte
+0x25a8,0x0028,VIDEO_LINE_59,byte
+0x25d0,0x0028,VIDEO_LINE_99,byte
+0x2600,0x0028,VIDEO_LINE_21,byte
+0x2628,0x0028,VIDEO_LINE_61,byte
+0x2650,0x0028,VIDEO_LINE_A1,byte
+0x2680,0x0028,VIDEO_LINE_29,byte
+0x26a8,0x0028,VIDEO_LINE_69,byte
+0x26d0,0x0028,VIDEO_LINE_A9,byte
+0x2700,0x0028,VIDEO_LINE_31,byte
+0x2728,0x0028,VIDEO_LINE_71,byte
+0x2750,0x0028,VIDEO_LINE_B1,byte
+0x2780,0x0028,VIDEO_LINE_39,byte
+0x27a8,0x0028,VIDEO_LINE_79,byte
+0x27d0,0x0028,VIDEO_LINE_B9,byte
+0x2800,0x0028,VIDEO_LINE_02,byte
+0x2828,0x0028,VIDEO_LINE_42,byte
+0x2850,0x0028,VIDEO_LINE_82,byte
+0x2880,0x0028,VIDEO_LINE_0A,byte
+0x28a8,0x0028,VIDEO_LINE_4A,byte
+0x28d0,0x0028,VIDEO_LINE_8A,byte
+0x2900,0x0028,VIDEO_LINE_12,byte
+0x2928,0x0028,VIDEO_LINE_52,byte
+0x2950,0x0028,VIDEO_LINE_92,byte
+0x2980,0x0028,VIDEO_LINE_1A,byte
+0x29a8,0x0028,VIDEO_LINE_5A,byte
+0x29d0,0x0028,VIDEO_LINE_9A,byte
+0x2a00,0x0028,VIDEO_LINE_22,byte
+0x2a28,0x0028,VIDEO_LINE_62,byte
+0x2a50,0x0028,VIDEO_LINE_A2,byte
+0x2a80,0x0028,VIDEO_LINE_2A,byte
+0x2aa8,0x0028,VIDEO_LINE_6A,byte
+0x2ad0,0x0028,VIDEO_LINE_AA,byte
+0x2b00,0x0028,VIDEO_LINE_32,byte
+0x2b28,0x0028,VIDEO_LINE_72,byte
+0x2b50,0x0028,VIDEO_LINE_B2,byte
+0x2b80,0x0028,VIDEO_LINE_3A,byte
+0x2ba8,0x0028,VIDEO_LINE_7A,byte
+0x2bd0,0x0028,VIDEO_LINE_BA,byte
+0x2c00,0x0028,VIDEO_LINE_03,byte
+0x2c28,0x0028,VIDEO_LINE_43,byte
+0x2c50,0x0028,VIDEO_LINE_83,byte
+0x2c80,0x0028,VIDEO_LINE_0B,byte
+0x2ca8,0x0028,VIDEO_LINE_4B,byte
+0x2cd0,0x0028,VIDEO_LINE_8B,byte
+0x2d00,0x0028,VIDEO_LINE_13,byte
+0x2d28,0x0028,VIDEO_LINE_53,byte
+0x2d50,0x0028,VIDEO_LINE_93,byte
+0x2d80,0x0028,VIDEO_LINE_1B,byte
+0x2da8,0x0028,VIDEO_LINE_5B,byte
+0x2dd0,0x0028,VIDEO_LINE_9B,byte
+0x2e00,0x0028,VIDEO_LINE_23,byte
+0x2e28,0x0028,VIDEO_LINE_63,byte
+0x2e50,0x0028,VIDEO_LINE_A3,byte
+0x2e80,0x0028,VIDEO_LINE_2B,byte
+0x2ea8,0x0028,VIDEO_LINE_6B,byte
+0x2ed0,0x0028,VIDEO_LINE_AB,byte
+0x2f00,0x0028,VIDEO_LINE_33,byte
+0x2f28,0x0028,VIDEO_LINE_73,byte
+0x2f50,0x0028,VIDEO_LINE_B3,byte
+0x2f80,0x0028,VIDEO_LINE_3B,byte
+0x2fa8,0x0028,VIDEO_LINE_7B,byte
+0x2fd0,0x0028,VIDEO_LINE_BB,byte
+0x3000,0x0028,VIDEO_LINE_04,byte
+0x3028,0x0028,VIDEO_LINE_44,byte
+0x3050,0x0028,VIDEO_LINE_84,byte
+0x3080,0x0028,VIDEO_LINE_0C,byte
+0x30a8,0x0028,VIDEO_LINE_4C,byte
+0x30d0,0x0028,VIDEO_LINE_8C,byte
+0x3100,0x0028,VIDEO_LINE_14,byte
+0x3128,0x0028,VIDEO_LINE_54,byte
+0x3150,0x0028,VIDEO_LINE_94,byte
+0x3180,0x0028,VIDEO_LINE_1C,byte
+0x31a8,0x0028,VIDEO_LINE_5C,byte
+0x31d0,0x0028,VIDEO_LINE_9C,byte
+0x3200,0x0028,VIDEO_LINE_24,byte
+0x3228,0x0028,VIDEO_LINE_64,byte
+0x3250,0x0028,VIDEO_LINE_A4,byte
+0x3280,0x0028,VIDEO_LINE_2C,byte
+0x32a8,0x0028,VIDEO_LINE_6C,byte
+0x32d0,0x0028,VIDEO_LINE_AC,byte
+0x3300,0x0028,VIDEO_LINE_34,byte
+0x3328,0x0028,VIDEO_LINE_74,byte
+0x3350,0x0028,VIDEO_LINE_B4,byte
+0x3380,0x0028,VIDEO_LINE_3C,byte
+0x33a8,0x0028,VIDEO_LINE_7C,byte
+0x33d0,0x0028,VIDEO_LINE_BC,byte
+0x3400,0x0028,VIDEO_LINE_05,byte
+0x3428,0x0028,VIDEO_LINE_45,byte
+0x3450,0x0028,VIDEO_LINE_85,byte
+0x3480,0x0028,VIDEO_LINE_0D,byte
+0x34a8,0x0028,VIDEO_LINE_4D,byte
+0x34d0,0x0028,VIDEO_LINE_8D,byte
+0x3500,0x0028,VIDEO_LINE_15,byte
+0x3528,0x0028,VIDEO_LINE_55,byte
+0x3550,0x0028,VIDEO_LINE_95,byte
+0x3580,0x0028,VIDEO_LINE_1D,byte
+0x35a8,0x0028,VIDEO_LINE_5D,byte
+0x35d0,0x0028,VIDEO_LINE_9D,byte
+0x3600,0x0028,VIDEO_LINE_25,byte
+0x3628,0x0028,VIDEO_LINE_65,byte
+0x3650,0x0028,VIDEO_LINE_A5,byte
+0x3680,0x0028,VIDEO_LINE_2D,byte
+0x36a8,0x0028,VIDEO_LINE_6D,byte
+0x36d0,0x0028,VIDEO_LINE_AD,byte
+0x3700,0x0028,VIDEO_LINE_35,byte
+0x3728,0x0028,VIDEO_LINE_75,byte
+0x3750,0x0028,VIDEO_LINE_B5,byte
+0x3780,0x0028,VIDEO_LINE_3D,byte
+0x37a8,0x0028,VIDEO_LINE_7D,byte
+0x37d0,0x0028,VIDEO_LINE_BD,byte
+0x3800,0x0028,VIDEO_LINE_06,byte
+0x3828,0x0028,VIDEO_LINE_46,byte
+0x3850,0x0028,VIDEO_LINE_86,byte
+0x3880,0x0028,VIDEO_LINE_0E,byte
+0x38a8,0x0028,VIDEO_LINE_4E,byte
+0x38d0,0x0028,VIDEO_LINE_8E,byte
+0x3900,0x0028,VIDEO_LINE_16,byte
+0x3928,0x0028,VIDEO_LINE_56,byte
+0x3950,0x0028,VIDEO_LINE_96,byte
+0x3980,0x0028,VIDEO_LINE_1E,byte
+0x39a8,0x0028,VIDEO_LINE_5E,byte
+0x39d0,0x0028,VIDEO_LINE_9E,byte
+0x3a00,0x0028,VIDEO_LINE_26,byte
+0x3a28,0x0028,VIDEO_LINE_66,byte
+0x3a50,0x0028,VIDEO_LINE_A6,byte
+0x3a80,0x0028,VIDEO_LINE_2E,byte
+0x3aa8,0x0028,VIDEO_LINE_6E,byte
+0x3ad0,0x0028,VIDEO_LINE_AE,byte
+0x3b00,0x0028,VIDEO_LINE_36,byte
+0x3b28,0x0028,VIDEO_LINE_76,byte
+0x3b50,0x0028,VIDEO_LINE_B6,byte
+0x3b80,0x0028,VIDEO_LINE_3E,byte
+0x3ba8,0x0028,VIDEO_LINE_7E,byte
+0x3bd0,0x0028,VIDEO_LINE_BE,byte
+0x3c00,0x0028,VIDEO_LINE_07,byte
+0x3c28,0x0028,VIDEO_LINE_47,byte
+0x3c50,0x0028,VIDEO_LINE_87,byte
+0x3c80,0x0028,VIDEO_LINE_0F,byte
+0x3ca8,0x0028,VIDEO_LINE_4F,byte
+0x3cd0,0x0028,VIDEO_LINE_8F,byte
+0x3d00,0x0028,VIDEO_LINE_17,byte
+0x3d28,0x0028,VIDEO_LINE_57,byte
+0x3d50,0x0028,VIDEO_LINE_97,byte
+0x3d80,0x0028,VIDEO_LINE_1F,byte
+0x3da8,0x0028,VIDEO_LINE_5F,byte
+0x3dd0,0x0028,VIDEO_LINE_9F,byte
+0x3e00,0x0028,VIDEO_LINE_27,byte
+0x3e28,0x0028,VIDEO_LINE_67,byte
+0x3e50,0x0028,VIDEO_LINE_A7,byte
+0x3e80,0x0028,VIDEO_LINE_2F,byte
+0x3ea8,0x0028,VIDEO_LINE_6F,byte
+0x3ed0,0x0028,VIDEO_LINE_AF,byte
+0x3f00,0x0028,VIDEO_LINE_37,byte
+0x3f28,0x0028,VIDEO_LINE_77,byte
+0x3f50,0x0028,VIDEO_LINE_B7,byte
+0x3f80,0x0028,VIDEO_LINE_3F,byte
+0x3fa8,0x0028,VIDEO_LINE_7F,byte
+0x3fd0,0x0028,VIDEO_LINE_BF,byte
+# is it really?
+0x7280,0x00d2,shape_ptr_lo_7280,byte
+0x7480,0x00d2,shape_ptr_lo_7480,byte
+# is it really?
+0x7600,0x00d2,shape_ptr_hi_7600,byte
+0x7800,0x00d2,shape_ptr_hi_7800,byte
+# is it really?
+0x7980,0x00d2,shape_width_bytes_7980,byte
+0x7b80,0x00d2,shape_width_bytes_7b80,byte
+0x7d80,0x0053,shape_height_bytes_7d80,byte
+# initialize clip_rect, clear screen, set hires
+0x93a8,0x0001,video_init,code
+0x93be,0x0001,,code_ign # self-modifying code assembled with garbage word
+0x93bf,0x0002,,word
+# clears rectangle described by clip_rect
+0x93d4,0x0001,video_clear_rect,code
+0x93d6,0x0001,,code_ign # accessing video_line_table before clipping y
+0x93de,0x0001,,code_ign # accessing video_line_table before clipping y
+# returns a = quotient, y = remainder, cf = 0
+0x93f6,0x0001,div_a_by_7,code
+# the value from shape_ptr_lo/hi is relative to this value
+0x9414,0x0002,shape_ptr_base,word,byte
+0x9416,0x0007,x2_mod7_table,byte
+0x941d,0x0007,x2_div7_table,byte
+# these contain the pointer for shift count 0, shape 0
+# the byte accessed will be base + shift count * 0x80 + shape
+0x9424,0x0002,shape_ptr_lo_base,word,byte
+0x9426,0x0002,shape_ptr_hi_base,word,byte
+0x9428,0x0002,shape_width_bytes_base,word,byte
+# takes x = 0 draw, x = 1 erase
+# reads draw_erase_(x0|y0|shape)
+# sets up draw_(x0|x1|y0|y1)
+# returns y:a = pointer to shape data
+0x942a,0x0001,draw_erase_setup,code
+#0x9466,0x0001,,code_ign # self-modifying code assembled with garbage word
+#0x9467,0x0002,,word
+#0x946e,0x0001,,code_ign # self-modifying code assembled with garbage word
+#0x946f,0x0002,,word
+#0x9476,0x0001,,code_ign # self-modifying code assembled with garbage word
+#0x9477,0x0002,,word
+# erases and then draws shape
+0x947f,0x0001,move_shape,code
+0x9482,0x0001,draw_shape,code
0x9491,0x0001,,code_ign # causes merging of code items
-0x9499,0x0001,,code_ign # bug? overruns harr_9637
+0x9499,0x0001,,code_ign # accessing video_line_table before clipping y
+0x94b2,0x0001,,code_ign # self-modifying code assembled with garbage word
+0x94b3,0x0002,,word
+0x94ce,0x0001,erase_shape,code
0x94dd,0x0001,,code_ign # causes merging of code items
-0x94e5,0x0001,,code_ign # bug? overruns harr_9637
+0x94e5,0x0001,,code_ign # accessing video_line_table before clipping y
+0x94fe,0x0001,,code_ign # self-modifying code assembled with garbage word
+0x94ff,0x0002,,word
+# draws over previous video contents
+0x951e,0x0001,draw_misc,code
+0x955d,0x0001,,code_ign # self-modifying code assembled with garbage word
+0x955e,0x0002,,word
+0x9577,0x00c0,video_line_table_lo,byte,byte,10000
+0x9637,0x00c0,video_line_table_hi,byte,byte,10000
0x9707,0x0001,start,code
-0x98e0,0x0001,,code_ign # bug? overruns larr_9577
-0x98e5,0x0001,,code_ign # bug? overruns harr_9637
-0x990a,0x0001,,code_ign # bug? overruns larr_9577
-0x990f,0x0001,,code_ign # bug? overruns harr_9637
+0x98e0,0x0001,,code_ign # accessing video_line_table before clipping y
+0x98e5,0x0001,,code_ign # accessing video_line_table before clipping y
+0x990a,0x0001,,code_ign # accessing video_line_table before clipping y
+0x990f,0x0001,,code_ign # accessing video_line_table before clipping y
+0xc000,0x0001,HW_KBD,byte
+0xc010,0x0001,HW_KBDSTRB,byte
+0xc030,0x0001,HW_SPKR,byte
+0xc050,0x0001,HW_TXTCLR,byte
+0xc052,0x0001,HW_MIXCLR,byte
+0xc054,0x0001,HW_PAGE1,byte
+0xc057,0x0001,HW_HIRES,byte
+0xc061,0x0001,HW_PB0,byte
+0xc062,0x0001,HW_PB1,byte
+0xc065,0x0001,HW_PADDL1,byte
+0xc070,0x0001,HW_PTRIG,byte