cpu 8048 missilefired equ 026h thingtoget equ 027h score_l equ 028h score_h equ 029h gamespeed equ 02bh titlescreenblinktimer equ 02dh rocketfirey equ 02eh highscore_l equ 038h highscore_h equ 039h quad3 equ 040h quad0 equ 050h quad1 equ 060h quad2 equ 070h org 400h include "g7000.h" jmp myinit ; RESET jmp irq ; interrupt jmp timer ; timer jmp vsyncirq ; VSYNC-interrupt jmp start ; after selectgame jmp soundirq ; sound-interrupt timer ;retr myinit mov r0,#03fh mov @r0,#000h sel rb1 clr a call 00feh start call 011ch strt t call check_highscore call check_score call init_score call erase_sprites mov r0,#0a0h movx a,@r0 orl a,#080h movx @r0,a mov r0,#vdc_color mov a,#col_grd_green movx @r0,a titlescreen call ds mov r1,#001h ; joystick 0 call getjoystick ; get offsets jf0 intro_setup2 mov r0,#titlescreenblinktimer movx a,@r0 add a,#001h ; adjust x pos movx @r0,a mov r1,#titlescreenblinktimer movx a,@r1 add a,#0f0h ; adjust x pos jnc boobseyesareclosed boobseyesareopen mov r4,#050h call boobsblueeyes mov r0,#0e2h mov a,#0f2h movx @r0,a mov r0,#0e6h mov a,#0f2h movx @r0,a jmp titlescreen boobseyesareclosed mov r4,#0f8h call boobsblueeyes mov r0,#0e2h mov a,#0feh movx @r0,a mov r0,#0e6h mov a,#0feh movx @r0,a mov r1,#titlescreenblinktimer mov a,@r1 xrl a,#020h jz resetblinktimer jmp titlescreen intro_setup2 jmp intro_setup ds call show_score call gfxon call waitvsync ; wait for begin of frame call gfxoff ret resetblinktimer mov r0,#titlescreenblinktimer mov @r0,#000h jmp titlescreen setshape ; r0=spritepointer, r1=pointer to image in rom mov r7,#8 ; 8 bytes copyspriteloop: mov a,r1 movp a,@a ; get byte movx @r0,a inc r0 inc r1 djnz r7,copyspriteloop ret spaceship: db 01111110b db 01111110b db 11111111b db 11111111b db 11111111b db 11111111b db 01111110b db 01111110b boobswalk1: db 00001000b db 00011000b db 00011000b db 01001000b db 00111100b db 00011010b db 00101100b db 01100100b boobswalk2: db 00001000b db 00011000b db 00011000b db 00001010b db 00111100b db 01011000b db 00001000b db 00011000b boobswalk3: db 00001000b db 00011000b db 00011000b db 00001001b db 01111110b db 10011000b db 00100100b db 01101100b rocket: db 00011000b db 00111100b db 00111100b db 00111100b db 00111100b db 01111110b db 11111111b db 10000001b missile2: db 00010000b db 00001000b db 00010000b db 00001000b db 00010000b db 00001000b db 00010000b db 00001000b get_grass mov a,#080h movx @r0,a ret intro_setup mov r0,#0e0h call get_grass mov r0,#0e1h call get_grass mov r0,#0e2h call get_grass mov r0,#0e3h call get_grass mov r0,#0e4h call get_grass mov r0,#0e5h call get_grass mov r0,#0e6h call get_grass mov r0,#0e7h call get_grass mov r0,#0e8h call get_grass mov r0,#000h ; set sprite 0 Y pos mov a,#0b0h movx @r0,a ;inc r0 ; set sprite 0 X pos mov r0,#001h mov a,#007h movx @r0,a inc r0 mov a,#col_spr_green movx @r0,a mov r0,#004h ; set sprite 1 Y pos mov a,#0a0h movx @r0,a ;inc r0 ; set sprite 1 X pos mov r0,#005h mov a,#077h movx @r0,a inc r0 mov a,#col_spr_black | spr_double movx @r0,a mov r0,#vdc_spr1_shape mov r1,#spaceship & 0ffh call setshape call get_missile_shape call clearchar jmp reset_timer intro call ds mov r1,#001h movx a,@r1 xrl a,#071h ; adjust x pos jz spaceship_up mov r0,#001h movx a,@r0 add a,#001h ; adjust x pos movx @r0,a mov r1,#titlescreenblinktimer inc @r1 mov r1,#titlescreenblinktimer mov a,@r1 xrl a,#000h ; adjust x pos jz sprite_2 mov r1,#titlescreenblinktimer mov a,@r1 xrl a,#008h ; adjust x pos jz sprite_1 mov r1,#titlescreenblinktimer mov a,@r1 xrl a,#010h ; adjust x pos jz sprite_2 mov r1,#titlescreenblinktimer mov a,@r1 xrl a,#018h ; adjust x pos jz sprite_3 mov r1,#titlescreenblinktimer mov a,@r1 xrl a,#020h ; adjust x pos jz reset_timer jmp intro sprite_1 mov r0,#vdc_spr0_shape mov r1,#boobswalk1 & 0ffh call setshape jmp intro sprite_2 mov r0,#vdc_spr0_shape mov r1,#boobswalk2 & 0ffh call setshape jmp intro sprite_3 mov r0,#vdc_spr0_shape mov r1,#boobswalk3 & 0ffh call setshape jmp intro reset_timer mov r0,#titlescreenblinktimer mov @r0,#000h jmp sprite_2 spaceship_up mov r0,#000h ; set sprite 0 Y pos mov a,#0f8h movx @r0,a mov r0,#004h movx a,@r0 add a,#0feh ; adjust x pos movx @r0,a mov r1,#004h movx a,@r1 xrl a,#000h ; adjust x pos jz game_begin jmp intro get_zero_grid mov a,#000h movx @r0,a ret game_begin call game_begin2 mov r0,#00ch mov a,#0f8h movx @r0,a mov r0,#0e0h mov a,#0ffh movx @r0,a mov r0,#0e1h call get_zero_grid mov r0,#0e2h call get_zero_grid mov r0,#0e3h call get_zero_grid mov r0,#0e4h call get_zero_grid mov r0,#0e5h call get_zero_grid mov r0,#0e6h call get_zero_grid mov r0,#0e7h call get_zero_grid mov r0,#0e8h mov a,#0ffh movx @r0,a mov r0,#004h ; set sprite 1 Y pos mov a,#0b0h movx @r0,a ;inc r0 ; set sprite 1 X pos mov r0,#005h mov a,#047h movx @r0,a inc r0 mov a,#col_spr_black movx @r0,a jmp get_a_thing move_fire_with_rocket mov r0,#thingtoget mov @r0,#0 jmp game_loop align 256 fire_the_missile_11 jmp fire_the_missile fire_the_missile_22 jmp fire_the_missile_2 game_loop call ds mov r0,#vdc_collision mov a,#vdc_coll_spr1 movx @r0,a ; activate collision checks mov r0,#03dh ; check collisions mov a,@r0 anl a,#000h ; check for s0 mov a,@r0 xrl a,#000h jnz game_over mov r1,#missilefired mov a,@r1 xrl a,#1 jz fire_the_missile_22 mov r1,#missilefired mov a,@r1 xrl a,#2 jz move_ufo_up game_loop_negative_1 call get_a_joystick_value jf0 fire_the_missile_11 game_loop_0 mov r1,#thingtoget mov a,@r1 xrl a,#0 jz game_loop_1 jmp move_ufo_up game_over call 00e7h mov a,#0ffh mov r0,#0a9h movx @r0,a mov a,#tune_explode call playsound mov r7,#140 waitvcdead call ds djnz r7,waitvcdead jmp start get_new_rocket_missile mov r0,#00ch movx a,@r0 mov a,#0f8h movx @r0,a game_loop_2aa jmp game_loop_2a game_loop_1 call get_a_joystick_value mov a,r1 ; get joystick value back anl a,#008h ; test left bit jz move_ufo_left ; jump to left routine call get_a_joystick_value mov a,r1 ; get joystick value back anl a,#002h ; test right jz move_ufo_right ; jump to right routine game_loop_2 jmp drop_missile game_loop_2b mov r1,#thingtoget mov a,@r1 xrl a,#1 jz game_loop8 game_loop_2a mov r1,#005h movx a,@r1 ;add a,#220 cpl a mov r7,a mov a,r7 mov r1,#001h movx a,@r1 add a,r7 jc rocketmoveleft mov r1,#001h movx a,@r1 add a,r7 jnc rocketmoveright game_loop8 jmp game_loop drop_missile mov r0,#00ch movx a,@r0 xrl a,#0f8h jz drop_missile_2 mov r0,#00ch movx a,@r0 add a,#047h jc ihatelife ;mov r0,#thingtoget ;mov a,@r0 ;xrl a,#0 ;jnz drop_missile_2 mov r0,#00ch movx a,@r0 add a,#001h ; adjust x pos movx @r0,a drop_missile_3 jmp game_loop_2b ihatelife mov r0,#00ch movx a,@r0 mov a,#0f8h ; adjust x pos movx @r0,a jmp rocket_missile drop_missile_2 mov r0,#thingtoget movx a,@r0 xrl a,#000h jz ihatelife jmp game_loop_2b rocketmoveright mov r0,#001h movx a,@r0 add a,#001h ; adjust x pos movx @r0,a jmp movethefire rocketmoveleft mov r0,#001h movx a,@r0 add a,#0ffh ; adjust x pos movx @r0,a movethefire mov r0,#thingtoget mov a,@r0 xrl a,#000h ; adjust x pos jz move_fire_with_rocket2 jmp game_loop move_fire_with_rocket2 jmp move_fire_with_rocket game_loop_4 mov r1,#thingtoget mov a,@r1 xrl a,#001h jz game_loop_5 call reset_missile game_loop_5 mov r0,#000h mov a,#018h movx @r0,a jmp get_a_thing move_ufo_up mov r1,#000h movx a,@r1 add a,#041h jc game_loop_4 mov r1,#gamespeed mov a,@r1 ; get blue car speed mov r7,a ; store in R7 mov r0,#000h movx a,@r0 add a,r7 ; adjust x pos movx @r0,a mov r1,#missilefired mov a,@r1 xrl a,#002h jnz move_ufo_up_2 mov r0,#00ch movx a,@r0 add a,#047h jnc move_ufo_up_2 mov r0,#00ch movx a,@r0 mov a,#0f8h ; adjust x pos movx @r0,a move_ufo_up_2 jmp game_loop_1 move_ufo_left mov r1,#005h movx a,@r1 add a,#0feh movx @r1,a jmp game_loop_2 move_ufo_right mov r1,#005h movx a,@r1 add a,#002h movx @r1,a jmp game_loop_2 fire_the_missile mov r0,#004h movx a,@r0 mov r1,#008h add a,#0f0h movx @r1,a mov r0,#005h movx a,@r0 mov r1,#009h add a,#0 movx @r1,a mov r0,#00ah movx a,@r0 mov a,#col_spr_yellow movx @r0,a mov r0,#missilefired mov @r0,#001h fire_the_missile_2 mov r1,#008h movx a,@r1 add a,#0feh movx @r1,a mov r1,#008h movx a,@r1 add a,#0e0h jnc reset_missile_2 call rocket_coll jmp game_loop_0 reset_missile_2 call reset_missile jmp game_loop_0 reset_missile mov r0,#008h mov a,#0f8h movx @r0,a mov r0,#missilefired mov @r0,#000h ret rocket_coll mov r0,#000h ;octopus mov r1,#008h ;missile movx a,@r0 ; get Y pos of sprite 0 mov r4,a movx a,@r1 ; get Y pos of sprite 2 cpl a ; make negative inc a add a,r4 ; calculate the difference add a,#010h ; add offset (a sprite pixel is two lines) add a,#0f1h ; determine sprite distance jc dont_destroy_rocket inc r0 ; repeat for the X pos inc r1 movx a,@r0 mov r4,a movx a,@r1 cpl a inc a add a,r4 add a,#005h ; add offset add a,#0f5h ; determine sprite distance jc dont_destroy_rocket mov r0,#008h mov a,#0f8h movx @r0,a mov r1,#thingtoget mov a,@r1 xrl a,#000h jnz game_loop_7a mov r0,#missilefired mov @r0,#002h rocket_coll_2 call add_to_score dont_destroy_rocket ret game_loop_7a mov r0,#000h mov a,#0f8h movx @r0,a game_loop_6a mov r0,#missilefired mov @r0,#000h jmp rocket_coll_2 get_0f8 mov a,#0f8h movx @r0,a ret erase_sprites mov r0,#000h call get_0f8 mov r0,#004h call get_0f8 mov r0,#008h call get_0f8 mov r0,#00ch call get_0f8 call prepare_boobs ret game_begin2 mov r0,#vdc_color mov a,#col_grd_red movx @r0,a mov r0,#rocketfirey mov @r0,#07ch mov r0,#titlescreenblinktimer mov @r0,#000h mov r0,#missilefired mov @r0,#000h ret align 256 garbage mov r0,#vdc_color mov a,#col_grd_red movx @r0,a mov r0,#rocketfirey mov @r0,#07ch show_score ;call 011ch ; turn display off mov r4,#0d8h ; quad 0 and 1 yposition mov r6,#col_chr_white ; set the color ; set up quad 0 character 2 (thousands of score) mov r0,#quad0+00ah ; pointer+offset to quad0 space in vdc (used later) ; evaluate score high byte, high nibble mov r1,#score_h ; get high byte mov a,@r1 ; in a swap a ; swap nibbles anl a,#00fh ; use only lower 4 bits ; this conversion is always necessary to put something (quad/character) ; on screen. On entry R5 contains the character code and R6 contains the color mov r5,a ; store A in R5 so it contains the 'thousands' number call calcchar23 ; convert mov a,r5 ; get converted character code back in A movx @r0,a ; save it in the quad0 space in vdc inc r0 ; point to next address in vdc mov a,r6 ; get converted color in A movx @r0,a ; store it in vdc mov r0,#quad1+00ah mov r1,#score_h ; get high byte mov a,@r1 anl a,#00fh ; use only lower nibble mov r5,a ; 'hundreths' number mov r6,#col_chr_white ; set the color call calcchar23 ; convert mov a,r5 ; get code movx @r0,a ; save it inc r0 ; next address in vdc mov a,r6 ; get color movx @r0,a ; save it mov r0,#quad0+00eh mov r1,#score_l ; point to score_l storage mov a,@r1 ; get value in A swap a ; we need the top 4 bits so swap them around anl a,#00fh ; use only the lower 4 bits (now top 4 bits of score_l) mov r5,a ; 'tens' number mov r6,#col_chr_white ; set the color call calcchar23 ; convert mov a,r5 ; get code movx @r0,a ; save it inc r0 mov a,r6 ; get color movx @r0,a ; save it mov r0,#quad1+00eh mov r1,#score_l ; point to score_l storage mov a,@r1 ; get value in A anl a,#00fh ; use only lower 4 bits mov r5,a ; 'units' number mov r6,#col_chr_white ; set the color call calcchar23 ; convert mov a,r5 ; get code movx @r0,a ; save it inc r0 mov a,r6 ; get color movx @r0,a ; save it ;highscore ;call 011ch ; turn display off mov r4,#0d8h ; quad 0 and 1 yposition mov r6,#col_chr_green ; set the color ; set up quad 0 character 2 (thousands of score) mov r0,#quad2+00ah ; pointer+offset to quad0 space in vdc (used later) ; evaluate score high byte, high nibble mov r1,#highscore_h ; get high byte mov a,@r1 ; in a swap a ; swap nibbles anl a,#00fh ; use only lower 4 bits ; this conversion is always necessary to put something (quad/character) ; on screen. On entry R5 contains the character code and R6 contains the color mov r5,a ; store A in R5 so it contains the 'thousands' number mov r0,#quad2+00ah ; pointer+offset to quad0 space in vdc (used later) ; evaluate score high byte, high nibble mov r1,#highscore_h ; get high byte mov a,@r1 ; in a swap a ; swap nibbles anl a,#00fh ; use only lower 4 bits ; this conversion is always necessary to put something (quad/character) ; on screen. On entry R5 contains the character code and R6 contains the color mov r5,a ; store A in R5 so it contains the 'thousands' number call calcchar23 ; convert mov a,r5 ; get converted character code back in A movx @r0,a ; save it in the quad0 space in vdc inc r0 ; point to next address in vdc mov a,r6 ; get converted color in A movx @r0,a ; store it in vdc mov r0,#quad3+00ah mov r1,#highscore_h ; get high byte mov a,@r1 anl a,#00fh ; use only lower nibble mov r5,a ; 'hundreths' number mov r6,#col_chr_green ; set the color call calcchar23 ; convert mov a,r5 ; get code movx @r0,a ; save it inc r0 ; next address in vdc mov a,r6 ; get color movx @r0,a ; save it mov r0,#quad2+00eh mov r1,#highscore_l ; point to score_l storage mov a,@r1 ; get value in A swap a ; we need the top 4 bits so swap them around anl a,#00fh ; use only the lower 4 bits (now top 4 bits of score_l) mov r5,a ; 'tens' number mov r6,#col_chr_green ; set the color call calcchar23 ; convert mov a,r5 ; get code movx @r0,a ; save it inc r0 mov a,r6 ; get color movx @r0,a ; save it mov r0,#quad3+00eh mov r1,#highscore_l ; point to score_l storage mov a,@r1 ; get value in A anl a,#00fh ; use only lower 4 bits mov r5,a ; 'units' number mov r6,#col_chr_green ; set the color call calcchar23 ; convert mov a,r5 ; get code movx @r0,a ; save it inc r0 mov a,r6 ; get color movx @r0,a ; save it ret init_score: ; preset x positions (they are fixed in my program) mov r3,#000h ; quad 0 xposition mov r4,#0d8h ; quad 0 and 1 yposition mov r0,#quad0+002h ; pointer to first character byte of quad0 mov r5,#00ch ; code for character "space" call 0261h ; convert character code and store in VDC mov r0,#quad0+006h ; pointer to second character byte of quad0 mov r5,#00ch call 0261h mov r0,#quad0 ; pointer to quad0 vdc mov a,r4 movx @r0,a ; store it inc r0 mov a,r3 movx @r0,a mov r0,#quad1+002h ; pointer to first character byte of quad0 mov r5,#00ch ; code for character "space" call 0261h ; convert character code and store in VDC mov r0,#quad1+006h ; pointer to second character byte of quad0 mov r5,#00ch call 0261h mov r3,#008h ; quad 1 xposition (8 pixels further to interleave) mov r0,#quad1 ; pointer to quad1 in vdc mov a,r4 movx @r0,a ; store it inc r0 mov a,r3 movx @r0,a ;highscore ; preset x positions (they are fixed in my program) mov r3,#041h ; quad 0 xposition mov r4,#0d6h ; quad 0 and 1 yposition mov r0,#quad2+002h ; pointer to first character byte of quad0 mov r5,#00ch ; code for character "space" call 0261h ; convert character code and store in VDC mov r0,#quad2+006h ; pointer to second character byte of quad0 mov r5,#00ch call 0261h mov r0,#quad2 ; pointer to quad0 vdc mov a,r4 movx @r0,a ; store it inc r0 mov a,r3 movx @r0,a mov r0,#quad3+002h ; pointer to first character byte of quad0 mov r5,#00ch ; code for character "space" call 0261h ; convert character code and store in VDC mov r0,#quad3+006h ; pointer to second character byte of quad0 mov r5,#00ch call 0261h mov r3,#049h ; quad 1 xposition (8 pixels further to interleave) mov r0,#quad3 ; pointer to quad1 in vdc mov a,r4 movx @r0,a ; store it inc r0 mov a,r3 movx @r0,a call bad_score ret check_score mov r1,#score_h mov a,@r1 anl a,#00fh add a,#0f6h jc bad_score mov a,@r1 swap a anl a,#00fh add a,#0f6h jc bad_score mov r1,#score_l mov a,@r1 anl a,#00fh add a,#0f6h jc bad_score mov a,@r1 swap a anl a,#00fh add a,#0f6h jnc good_score bad_score mov r1,#score_h mov @r1,#0 mov r1,#score_l mov @r1,#0 mov r1,#gamespeed mov @r1,#2 good_score call check_for_bad_highscore ret align 256 star: db 00011000b db 00011000b db 11111111b db 01111110b db 00111100b db 01100110b db 11000011b db 00000000b missile: db 00001000b db 00001000b db 00001000b db 00001000b db 00001000b db 00001000b db 00001000b db 00001000b alien: db 01000010b db 00100101b db 01111100b db 11010110b db 01111110b db 01111110b db 01000010b db 11100111b alien2: db 00011000b db 00111100b db 01111110b db 11101011b db 11111111b db 00100100b db 01011010b db 10100101b get_missile_shape call bad_score mov r0,#vdc_spr2_shape mov r1,#missile & 0ffh call setshape2 sel mb0 ret get_game_speed ret get_star_3 jmp get_star get_a_thing mov r0,#thingtoget mov a,t anl a,#003h ; you will only get values from 00 to 7F add a,#000h ; ant's y position mov @r0,a mov r0,#thingtoget mov a,@r0 xrl a,#001h jz get_star_3 mov r0,#thingtoget mov a,@r0 xrl a,#003h jz get_alien_2 mov r0,#thingtoget mov a,@r0 xrl a,#002h jz get_alien mov r0,#vdc_spr0_shape mov r1,#rocket & 0ffh call setshape mov r0,#000h ; set sprite 1 Y pos mov a,#018h movx @r0,a inc r0 ; set sprite 1 X pos mov a,t anl a,#03fh ; you will only get values from 00 to 7F add a,#040h ; ant's y position movx @r0,a inc r0 mov a,#col_spr_blue | spr_double movx @r0,a call ds rocket_missile mov r0,#00ch movx a,@r0 add a,#047h jnc skip_rocket_missile mov r0,#thingtoget mov a,@r0 xrl a,#000h jnz skip_rocket_missile rocket_missile_3 mov r0,#vdc_spr3_shape mov r1,#missile2 & 0ffh call setshape mov r0,#000h movx a,@r0 mov r1,#00ch add a,#004h movx @r1,a mov r0,#001h movx a,@r0 mov r1,#00dh add a,#004h movx @r1,a mov r1,#00eh mov a,#col_spr_violet movx @r1,a jmp game_loop_2b skip_rocket_missile jmp game_loop_2b get_a_thing_2 mov r0,#vdc_spr0_ctrl inc r0 mov a,t anl a,#03fh ; you will only get values from 00 to 7F add a,#040h ; ant's y position movx @r0,a jmp game_loop get_alien_2 mov r0,#vdc_spr0_shape mov r1,#alien2 & 0ffh call setshape2 jmp get_alien_3 get_alien mov r0,#vdc_spr0_shape mov r1,#alien & 0ffh call setshape2 get_alien_3 mov r0,#002h mov a,#col_spr_green movx @r0,a jmp get_a_thing_2 setshape2 ; r0=spritepointer, r1=pointer to image in rom mov r7,#8 ; 8 bytes copyspriteloop2: mov a,r1 movp a,@a ; get byte movx @r0,a inc r0 inc r1 djnz r7,copyspriteloop2 ret boobsblueeyes mov r0,#vdc_char0 mov r3,#02ch mov r5,#031h ; ship1 mov r6,#col_chr_blue call printchar mov r0,#vdc_char1 mov r3,#06ch mov r5,#031h ; ship1 mov r6,#col_chr_blue call printchar ret add_to_score mov r5,#003h ; add 25 to score when something happens. mov r1,#score_l ; point to score low byte mov a,@r1 ; get current value add a,r5 ; add r2 da a ; decimal adjust mov @r1,a ; store back inc r1 ; point to high byte mov a,@r1 ; get current value addc a,#0 ; add zero (and a possible carry) da a ; decimal adjust a mov @r1,a ; store back mov a,#tune_select2 call playsound mov r0,#score_l mov a,@r0 xrl a,#030h jz add_speed sel mb0 ret add_speed mov r1,#gamespeed mov @r1,#3 sel mb0 ret get_star mov r1,#thingtoget mov @r1,#1 mov r0,#vdc_spr0_shape mov r1,#star & 0ffh call setshape2 mov r0,#002h mov a,#col_spr_yellow movx @r0,a jmp get_a_thing_2 check_highscore mov r1,#highscore_l mov a,@r1 ; get highscore cpl a ; make highscore negative mov r0,#score_l add a,@r0 ; subtract highscore from score jnc replace_highscore2 mov r1,#highscore_h mov a,@r1 ; get red car speed mov r2,a ; store in R2 mov r0,#score_h mov a,@r0 xrl a,r2 jz replace_highscore replace_highscore2 mov r1,#highscore_h mov a,@r1 ; get highscore cpl a ; make highscore negative mov r0,#score_h add a,@r0 ; subtract highscore from score jnc no_highscore replace_highscore mov r0,#score_h mov a,@r0 ; get score mov r1,#highscore_h ; point to highscore low byte mov @r1,a ; store new highscore mov r0,#score_l mov a,@r0 ; get score mov r1,#highscore_l ; point to highscore low byte mov @r1,a ; store new highscore no_highscore ret celerystr db 025h, 017h, 017h, 025h, 019h prepare_boobs mov r0,#vdc_char2 ; start char mov r3,#03dh ; x-position mov r4,#010h ; y-position mov r2,#05h ; length mov r1,#celerystr & 0FFh ; the string to print, must be in the same page write_boobs: mov a,r1 ; get pointer movp a,@a ; get char mov r5,a ; into to right register inc r1 ; advance pointer mov r6,#col_chr_yellow ; colour call printchar ; print it djnz r2,write_boobs ; do it again mov r0,#0e0h mov a,#00fh movx @r0,a mov r0,#0e1h mov a,#07eh movx @r0,a mov r0,#0e3h mov a,#09eh movx @r0,a mov r0,#0e4h mov a,#0beh movx @r0,a mov r0,#0e5h mov a,#09eh movx @r0,a mov r0,#0e7h mov a,#07eh movx @r0,a mov r0,#0e8h mov a,#00fh movx @r0,a ret check_for_bad_highscore mov r1,#highscore_h mov a,@r1 anl a,#00fh add a,#0f6h jc bad_highscore mov a,@r1 swap a anl a,#00fh add a,#0f6h jc bad_highscore mov r1,#highscore_l mov a,@r1 anl a,#00fh add a,#0f6h jc bad_highscore mov a,@r1 swap a anl a,#00fh add a,#0f6h jnc good_highscore bad_highscore mov r1,#highscore_h mov @r1,#0 mov r1,#highscore_l mov @r1,#0 good_highscore ret get_a_joystick_value mov r1,#001h ; select joystick 0 call getjoystick ; call bios mov a,r1 ; get bit values cpl a ; invert all bits ret