Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ld hl, 39
- push hl
- call _gfx_Begin
- pop hl
- call _gfx_ZeroScreen
- call _initEnv
- ld hl, 224
- push hl
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- call _run
- jp _gfx_End
- .global _drawRob
- _drawRob:
- push ix
- ld ix, 0
- add ix, sp
- ld e, (ix + 6)
- push de
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld sp, ix
- pop ix
- ret
- .global _run
- _run:
- push ix
- ld ix, 0
- add ix, sp
- lea hl, ix + -22
- ld sp, hl
- ld a, 1
- BB2_1:
- ld (ix + -3), a
- ld hl, 6
- push hl
- call _kb_ScanGroup
- pop hl
- cp a, 64
- ld a, 0
- jp z, BB2_3
- ld a, (ix + -3)
- BB2_3:
- ld (ix + -22), a
- call _initEnv
- ld hl, 7
- push hl
- call _kb_ScanGroup
- pop hl
- ld l, a
- add a, -128
- cp a, -124
- jp nc, BB2_7
- ld a, l
- add a, -128
- cp a, -126
- jp nc, BB2_10
- ld a, l
- cp a, 1
- jp nz, BB2_17
- or a, a
- sbc hl, hl
- push hl
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, (_roby)
- inc hl
- jp BB2_15
- BB2_7:
- ld a, l
- add a, -128
- cp a, -120
- jp nc, BB2_13
- ld a, l
- cp a, 4
- jp nz, BB2_17
- or a, a
- sbc hl, hl
- push hl
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, (_robx)
- inc hl
- jp BB2_12
- BB2_10:
- ld a, l
- cp a, 2
- jp nz, BB2_17
- or a, a
- sbc hl, hl
- push hl
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, (_robx)
- dec hl
- BB2_12:
- ld (_robx), hl
- jp BB2_16
- BB2_13:
- ld a, l
- cp a, 8
- jp nz, BB2_17
- or a, a
- sbc hl, hl
- push hl
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, (_roby)
- dec hl
- BB2_15:
- ld (_roby), hl
- BB2_16:
- ld hl, 224
- push hl
- call _gfx_SetColor
- pop hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- push de
- push iy
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld hl, (_roby)
- push hl
- push de
- pop iy
- pea iy + 2
- push hl
- push iy
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, (_robx)
- ld iy, (_roby)
- pea iy + 2
- lea hl, iy + 0
- push de
- pop iy
- pea iy + 3
- push hl
- pea iy + 3
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- BB2_17:
- ld hl, 6
- push hl
- call _kb_ScanGroup
- pop hl
- cp a, 1
- jp nz, BB2_19
- ld hl, (_waterindex)
- ld (ix + -9), hl
- add hl, hl
- ld (ix + -15), hl
- push hl
- pop iy
- ld de, _coords
- add iy, de
- ld (ix + -12), iy
- ld de, (_robx)
- ld (ix + -3), de
- ld iy, (ix + -3)
- lea bc, iy + 1
- ld (ix + -21), bc
- ld de, (_roby)
- ld (ix + -6), de
- ld hl, (ix + -12)
- ld (hl), c
- inc hl
- ld (hl), b
- ld bc, (ix + -15)
- push bc
- pop iy
- ld de, _coords+2
- add iy, de
- ld (ix + -18), iy
- ld iy, (ix + -6)
- lea de, iy + 1
- ld (ix + -12), de
- ld hl, (ix + -18)
- ld (hl), e
- inc hl
- ld (hl), d
- push bc
- pop iy
- ld de, _coords+4
- add iy, de
- ld de, (ix + -21)
- ld (iy), e
- inc iy
- ld (iy), d
- push bc
- pop iy
- ld de, _coords+6
- add iy, de
- lea hl, iy + 0
- ld iy, (ix + -6)
- lea de, iy + 2
- ld (ix + -6), de
- ld (hl), e
- inc hl
- ld (hl), d
- push bc
- pop iy
- ld de, _coords+8
- add iy, de
- lea hl, iy + 0
- ld iy, (ix + -3)
- lea de, iy + 2
- ld (hl), e
- inc hl
- ld (hl), d
- push bc
- pop hl
- push hl
- pop iy
- ld bc, _coords+10
- add iy, bc
- ld bc, (ix + -12)
- ld (iy), c
- inc iy
- ld (iy), b
- push hl
- pop iy
- ld bc, _coords+12
- add iy, bc
- ld (iy), e
- inc iy
- ld (iy), d
- ld de, _coords+14
- add hl, de
- ld de, (ix + -6)
- ld (hl), e
- inc hl
- ld (hl), d
- ld iy, (ix + -9)
- lea hl, iy + 8
- ld (_waterindex), hl
- jp BB2_20
- BB2_19:
- ld hl, (_waterindex)
- BB2_20:
- ld de, -8388608
- add hl, de
- ld de, 8388607
- add hl, de
- jp nc, BB2_32
- ld hl, _coords+2
- push hl
- pop iy
- ld de, 0
- BB2_22:
- ld (ix + -9), iy
- ld (ix + -12), de
- ld hl, (iy + -2)
- ld bc, 65535
- call __iand
- ld (ix + -6), hl
- ld hl, (ix + -9)
- ld hl, (hl)
- call __iand
- ld (ix + -3), hl
- or a, a
- sbc hl, hl
- push hl
- call _gfx_SetColor
- pop hl
- ld hl, (ix + -3)
- push hl
- ld hl, (ix + -6)
- push hl
- call _gfx_SetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- ld iy, (ix + -3)
- pea iy + 1
- ld hl, (ix + -6)
- push hl
- ld iy, (ix + -9)
- lea hl, iy + -2
- ld (ix + -15), hl
- call _gfx_GetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- cp a, 0
- jp z, BB2_28
- call _rand
- ld bc, 1
- call __iand
- inc hl
- ld de, 2
- or a, a
- sbc hl, de
- add hl, de
- ld de, -1
- jp z, BB2_25
- ex de, hl
- BB2_25:
- ld hl, (ix + -3)
- push hl
- ld (ix + -18), de
- ex de, hl
- ld de, (ix + -6)
- add hl, de
- ld (ix + -21), hl
- push hl
- call _gfx_GetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- cp a, 0
- jp z, BB2_29
- ld hl, (ix + -3)
- push hl
- ld hl, (ix + -6)
- ld de, (ix + -18)
- or a, a
- sbc hl, de
- ld (ix + -18), hl
- push hl
- call _gfx_GetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- cp a, 0
- jp nz, BB2_31
- ld hl, (ix + -18)
- jp BB2_30
- BB2_28:
- ld iy, (ix + -3)
- lea iy, iy + 1
- ld (ix + -3), iy
- jp BB2_31
- BB2_29:
- ld hl, (ix + -21)
- BB2_30:
- ld (ix + -6), hl
- BB2_31:
- ld hl, 57
- push hl
- call _gfx_SetColor
- pop hl
- ld hl, (ix + -3)
- push hl
- ld hl, (ix + -6)
- push hl
- call _gfx_SetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- ld hl, (ix + -15)
- ld de, (ix + -6)
- ld (hl), e
- inc hl
- ld (hl), d
- ld iy, (ix + -9)
- ld hl, (ix + -3)
- push af
- ld (iy), l
- ld a, h
- inc iy
- ld (iy), a
- dec iy
- pop af
- ld hl, (_waterindex)
- ld de, -8388608
- add hl, de
- ld (ix + -3), hl
- lea iy, iy + 4
- ld (ix + -9), iy
- ld iy, (ix + -12)
- lea de, iy + 2
- ld bc, -8388606
- add iy, bc
- lea hl, iy + 0
- ld bc, (ix + -3)
- ld iy, (ix + -9)
- or a, a
- sbc hl, bc
- add hl, bc
- jp c, BB2_22
- BB2_32:
- ld hl, 1
- push hl
- call _kb_ScanGroup
- pop hl
- cp a, -128
- ld de, 0
- jp nz, BB2_39
- push de
- call _gfx_SetColor
- pop hl
- ld hl, (_waterindex)
- ld de, -8388608
- add hl, de
- ld de, 8388607
- add hl, de
- ld de, 0
- jp nc, BB2_38
- ld hl, _coords+2
- ld (ix + -3), hl
- ld (ix + -6), de
- BB2_35:
- ld iy, (ix + -3)
- ld hl, (iy + -2)
- ld bc, 65535
- call __iand
- ld iy, (ix + -3)
- ld e, (iy)
- push de
- push hl
- ld hl, (ix + -6)
- ld de, -8388606
- add hl, de
- ld (ix + -9), hl
- call _gfx_SetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- ld bc, (_waterindex)
- push bc
- pop hl
- ld de, -8388608
- add hl, de
- ld iy, (ix + -3)
- lea iy, iy + 4
- ld (ix + -3), iy
- ex de, hl
- ld iy, (ix + -6)
- lea iy, iy + 2
- ld (ix + -6), iy
- ld hl, (ix + -9)
- push de
- pop iy
- or a, a
- sbc hl, de
- add hl, de
- jp c, BB2_35
- ld de, 8388607
- add iy, de
- ld hl, 0
- ex de, hl
- jp nc, BB2_38
- push bc
- pop hl
- add hl, hl
- push hl
- push de
- ld hl, _coords
- push hl
- call _memset
- ld de, 0
- ld hl, 9
- add hl, sp
- ld sp, hl
- BB2_38:
- ld (_waterindex), de
- BB2_39:
- ld a, (ix + -22)
- cp a, 0
- jp nz, BB2_1
- ld sp, ix
- pop ix
- ret
- .global _initWater
- _initWater:
- push ix
- ld ix, 0
- add ix, sp
- lea hl, ix + -18
- ld sp, hl
- ld hl, (_waterindex)
- ld (ix + -9), hl
- add hl, hl
- ld (ix + -15), hl
- ld de, _coords
- add hl, de
- ld de, (_robx)
- ld (ix + -3), de
- ld iy, (ix + -3)
- lea bc, iy + 1
- ld (ix + -18), bc
- ld de, (_roby)
- ld (ix + -6), de
- ld (hl), c
- inc hl
- ld (hl), b
- ld de, _coords+2
- ld bc, (ix + -15)
- push bc
- pop hl
- add hl, de
- ld iy, (ix + -6)
- lea de, iy + 1
- ld (ix + -12), de
- ld (hl), e
- inc hl
- ld (hl), d
- ld de, _coords+4
- push bc
- pop iy
- add iy, de
- ld de, (ix + -18)
- ld (iy), e
- inc iy
- ld (iy), d
- ld de, _coords+6
- push bc
- pop hl
- add hl, de
- ld iy, (ix + -6)
- lea de, iy + 2
- ld (ix + -6), de
- ld (hl), e
- inc hl
- ld (hl), d
- ld de, _coords+8
- push bc
- pop hl
- add hl, de
- ld iy, (ix + -3)
- lea de, iy + 2
- ld (hl), e
- inc hl
- ld (hl), d
- push bc
- pop hl
- push hl
- pop iy
- ld bc, _coords+10
- add iy, bc
- ld bc, (ix + -12)
- ld (iy), c
- inc iy
- ld (iy), b
- ld bc, _coords+12
- push hl
- pop iy
- add iy, bc
- ld (iy), e
- inc iy
- ld (iy), d
- ld de, _coords+14
- add hl, de
- ld de, (ix + -6)
- ld (hl), e
- inc hl
- ld (hl), d
- ld iy, (ix + -9)
- lea hl, iy + 8
- ld (_waterindex), hl
- ld sp, ix
- pop ix
- ret
- .global _drawPixels
- _drawPixels:
- push ix
- ld ix, 0
- add ix, sp
- lea hl, ix + -9
- ld sp, hl
- ld e, (ix + 6)
- push de
- call _gfx_SetColor
- pop hl
- ld de, -8388608
- ld hl, (_waterindex)
- add hl, de
- ld de, 8388607
- add hl, de
- jp nc, BB4_3
- or a, a
- sbc hl, hl
- ld (ix + -3), hl
- ld bc, _coords+2
- BB4_2:
- push bc
- pop iy
- ld (ix + -6), iy
- ld hl, (iy + -2)
- ld bc, 65535
- call __iand
- ld iy, (ix + -6)
- ld e, (iy)
- push de
- push hl
- ld hl, (ix + -3)
- ld de, -8388606
- add hl, de
- ld (ix + -9), hl
- call _gfx_SetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- ld hl, (_waterindex)
- ld de, -8388608
- add hl, de
- ex de, hl
- ld iy, (ix + -6)
- lea iy, iy + 4
- lea bc, iy + 0
- ld iy, (ix + -3)
- lea iy, iy + 2
- ld (ix + -3), iy
- ld hl, (ix + -9)
- or a, a
- sbc hl, de
- add hl, de
- jp c, BB4_2
- BB4_3:
- ld sp, ix
- pop ix
- ret
- .global _initEnv
- _initEnv:
- ld hl, 255
- push hl
- call _gfx_SetColor
- pop hl
- ld hl, 239
- push hl
- or a, a
- sbc hl, hl
- push hl
- push hl
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 239
- push hl
- ld de, 319
- push de
- or a, a
- sbc hl, hl
- push hl
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 239
- push hl
- ld de, 319
- push de
- push hl
- or a, a
- sbc hl, hl
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 90
- push hl
- ld hl, 60
- push hl
- ld hl, 40
- push hl
- ld hl, 10
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 91
- push hl
- ld hl, 60
- push hl
- ld hl, 41
- push hl
- ld hl, 10
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 135
- push hl
- ld hl, 70
- push hl
- ld hl, 120
- push hl
- ld hl, 55
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 136
- push hl
- ld hl, 70
- push hl
- ld hl, 121
- push hl
- ld hl, 55
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 120
- push hl
- ld hl, 100
- push hl
- ld hl, 135
- push hl
- ld hl, 85
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 121
- push hl
- ld hl, 100
- push hl
- ld hl, 136
- push hl
- ld hl, 85
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 160
- push hl
- ld hl, 70
- push hl
- ld de, 135
- push de
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 160
- push hl
- ld de, 69
- push de
- ld hl, 135
- push hl
- push de
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 160
- push hl
- ld hl, 85
- push hl
- ld de, 135
- push de
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 160
- push hl
- ld hl, 86
- push hl
- ld de, 135
- push de
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 175
- push hl
- ld hl, 84
- push hl
- ld hl, 161
- push hl
- ld hl, 70
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 176
- push hl
- ld hl, 84
- push hl
- ld hl, 161
- push hl
- ld hl, 69
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, 175
- push de
- ld hl, 100
- push hl
- push de
- ld hl, 85
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld de, 176
- push de
- ld hl, 100
- push hl
- push de
- ld hl, 85
- push hl
- call _gfx_Line
- ld hl, 12
- add hl, sp
- ld sp, hl
- ld hl, 9
- push hl
- ld hl, 210
- push hl
- ld hl, 100
- push hl
- call _gfx_Circle
- ld hl, 9
- add hl, sp
- ld sp, hl
- ld hl, 10
- push hl
- ld hl, 210
- push hl
- ld hl, 100
- push hl
- call _gfx_Circle
- ld hl, 9
- add hl, sp
- ld sp, hl
- ret
- .global _clean
- _clean:
- push ix
- ld ix, 0
- add ix, sp
- lea hl, ix + -12
- ld sp, hl
- or a, a
- sbc hl, hl
- push hl
- call _gfx_SetColor
- pop hl
- ld de, -8388608
- ld hl, (_waterindex)
- add hl, de
- ld de, 8388607
- add hl, de
- jp nc, BB6_5
- ld bc, _coords+2
- or a, a
- sbc hl, hl
- ld (ix + -3), hl
- BB6_2:
- push bc
- pop iy
- ld (ix + -6), iy
- ld hl, (iy + -2)
- ld bc, 65535
- call __iand
- ld iy, (ix + -6)
- ld e, (iy)
- push de
- push hl
- ld hl, (ix + -3)
- ld de, -8388606
- add hl, de
- ld (ix + -9), hl
- call _gfx_SetPixel
- ld hl, 6
- add hl, sp
- ld sp, hl
- ld iy, (_waterindex)
- ld (ix + -12), iy
- ld de, -8388608
- add iy, de
- lea de, iy + 0
- ld iy, (ix + -6)
- lea iy, iy + 4
- lea bc, iy + 0
- ld iy, (ix + -3)
- lea iy, iy + 2
- ld (ix + -3), iy
- ld hl, (ix + -9)
- or a, a
- sbc hl, de
- add hl, de
- jp c, BB6_2
- ld de, -8388608
- ld iy, (ix + -12)
- lea hl, iy + 0
- add hl, de
- ld de, 8388607
- add hl, de
- jp nc, BB6_5
- add iy, iy
- push iy
- or a, a
- sbc hl, hl
- push hl
- ld hl, _coords
- push hl
- call _memset
- ld hl, 9
- add hl, sp
- ld sp, hl
- BB6_5:
- or a, a
- sbc hl, hl
- ld (_waterindex), hl
- ld sp, ix
- pop ix
- ret
- SEGMENT BSS
- .global _coords
- _coords:
- .block 20000
- SEGMENT DATA
- .global _robx
- _robx:
- .word24 25
- .global _roby
- _roby:
- .word24 10
- SEGMENT BSS
- .global _waterindex
- _waterindex:
- .block 3
- .extern _rand
- .extern _memset
- .extern _gfx_Circle
- .extern _gfx_End
- .extern _kb_ScanGroup
- .extern _gfx_ZeroScreen
- .extern _gfx_GetPixel
- .extern _gfx_Begin
- .extern _gfx_Line
- .extern _gfx_SetColor
- .extern __iand
- .extern _gfx_SetPixel
Advertisement
Add Comment
Please, Sign In to add comment