Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hwn i
- :FindDevices
- sub i, 1
- hwq i
- ife b, 0x7349
- ife a, 0xf615
- set [DISPLAY], i
- ife b, 0x12d0
- ife a, 0xb402
- set [CLOCK], i
- ife b, 0x30cf
- ife a, 0x7406
- set [KEYBOARD], i
- ifn i, 0
- set pc, FindDevices
- set i, 0
- :FillMap
- set [i+0xa000],0
- add i, 1
- ifn i, 2048
- set pc, FillMap
- :init_display ; Initialize the LEM1802
- set i, [DISPLAY]
- set a, 0 ; map the screen to 0x8000
- set b, 0x8000
- hwi i
- set a, 4 ; dump the font to 0x9000
- set b, 0x9000
- hwi i
- set a, 1 ; font is now at 0x9000
- hwi i
- set a, FontEnd-FontStart
- set i, 0
- set j, 0
- :CopyFont
- sti [i+ 0x9000], [j+FontStart]
- sub a,1
- ifn a,0
- set pc, CopyFont
- set i, [CLOCK]
- set a, 0 ; clock frequency = 30fps
- set b, 1
- hwi i
- ; draw every font character as a test because my actual stuff isn't written yet
- set i, 0
- :draw_char
- set a, i
- bor a, 0xF000
- set [i + 0x8000], a
- add i, 1
- ifn i, 0x80
- set pc, draw_char
- :forever
- set pc, forever
- :RenderScreen ; not written yet
- set i, 0 ; render index
- set x, [ScrollX]
- set y, [ScrollY]
- :RenderLoop
- set j, y
- shl j, 6 ; *64
- add j, x
- set a, 0
- bor a, 0x0F00
- set [i + 0x8000], a
- add i, 1
- ifn i, 32*12
- set pc, RenderLoop
- set pc, pop
- ; variables section
- :DISPLAY dat 0x0000 ; monitor's index
- :CLOCK dat 0x0000 ; clock's index
- :KEYBOARD dat 0x0000 ; keyboard's index
- :PlayerX dat 0x0005
- :PlayerY dat 0x0005
- :ScrollX dat 0x0000
- :ScrollY dat 0x0000
- :FontStart
- dat 0x3c42, 0x8da1, 0xa18d, 0x423c ; player ( a smiley face)
- dat 0x0000, 0x0000, 0x0000, 0x0000 ; block type 0
- dat 0xff81, 0x8181, 0x8181, 0x81ff ; block type 1
- dat 0xffab, 0xd5ab, 0xd5ab, 0xd5ff ; block type 2
- dat 0xffb3, 0xcdcd, 0xb3b3, 0xcdff ; block type 3
- dat 0xff8f, 0x8f8f, 0xf1f1, 0xf1ff ; block type 4
- dat 0xffc3, 0xa599, 0x99a5, 0xc3ff ; block type 5
- dat 0xffd5, 0xd5d5, 0xd5d5, 0xd5ff ; block type 6
- :FontEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement