Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MGOS

Pages: 1 ... 5 6 [7] 8 9 ... 23
91
Axe / Re: raycasting texture
« on: October 04, 2012, 05:14:30 pm »
Ok then maybe do something like this:

Code: [Select]
H/8->S   .H is the wall height in pixels
For(8)
If pixel is set
Rect(X,Y,S,1)
End
Y+S->Y
End

92
Axe / Re: raycasting texture
« on: October 04, 2012, 05:05:48 pm »
But this clears the whole screen, right?

93
Axe / Re: raycasting texture
« on: October 04, 2012, 04:55:11 pm »
Which routine?

94
Axe / Re: raycasting texture
« on: October 04, 2012, 04:52:19 pm »
Are you doing clrdraw every frame? That would make the pxl-Off redundant.

95
Axe / Re: raycasting texture
« on: October 04, 2012, 04:41:44 pm »
Why do you have to multiply with W at the end? I don't get the point of that. Can you post that part of your code?

96
Axe / Re: raycasting texture
« on: October 04, 2012, 04:33:04 pm »
I don't know, can you post the solution you came up with so maybe we can optimize that.

97
Axe / Re: raycasting texture
« on: October 04, 2012, 04:28:14 pm »
can you answer at my second question please ? ^^ if you know :)

What do you mean with a "a line with a different size"? One that is wider than one pixel?
When you only need vertical or horizontal lines, you should use the Rect( command. It is a lot faster than Line( and you can adjust the width.

98
Axe / Re: raycasting texture
« on: October 04, 2012, 04:19:42 pm »
Yeah, it is probably the fastest way to do it. If you don't need the sprites anywhere else, just store them rotated. That is faster and takes less memory. ;)

Btw, your raycaster looks awesome so far. I built one myself last week. Does yours run at 6 mHz or at 15 mHz?

99
Axe / Re: raycasting texture
« on: October 04, 2012, 04:10:53 pm »
To get the vertical line, just rotate the sprite 90 degrees right and then you add the line you want. The result is the vertical line from bottom to top.

Code: [Select]
[whatever your sprite is]->Pic0
.L is the line number (0=leftmost, 7=rightmost)
{RotC(Pic0)+L}->V
.V is the bit mask of the vertical line. MSB = bottom pixel, LSB = top pixel

EDIT: When you only use that sprite you said it doesn't need to be turned because it is the same then.

And L (without *8 ) should be correct.

100
TI Z80 / Re: ORG: online Z80 IDE and assembler
« on: October 04, 2012, 03:56:04 pm »
Some suggestions/bugs:
  • With default zoom, the line numbers, the code and the cursor aren't aligned properly (In Chrome and Opera). Changing the zoom will fix it, but has to be set back on other sites, so please fix this:
  • The undocumented instructions are in the drop down menus, but give errors when compiling. (Make them usable)
  • What about making the highlight color a bit darker, you can barely see it when viewing the screen from a slight different angle. Or a setup like most IDEs have with all the font properties and color settings ^-^
  • How about adding the number of cycles each line takes and a calculator to multiply blocks of code with how often the part runs and giving a total sum. That would be awesome to improve and optimize stuff.

101
TI Z80 / Re: Bounce
« on: September 30, 2012, 02:44:02 pm »
Simply add a counter variable, and do stuff only when the variable is dividable by 2,3 or 4 or what ever.

example

Code: [Select]
While 1   ; The main loop
C++

If C^2
This stuff is executed only every other time
End

This is always executed

EndIf getkey(15)

102
TI Z80 / Re: Bounce
« on: September 30, 2012, 09:54:24 am »
So Rect is 112 bytes larger than pt-on? Wow, that's huge. That means that I can save 112 bytes by using Pt-On for my paddle!
No, it isn't. Rect is 112 bytes large in total. The routines are only added to your program if they occur at least once in the source. So basically using two times Pt-Off will only add one Pt-Off to the program, and every times you need it, the function is called (like a subroutine).
You can save bytes by using only one type of routines (e.g. all Pt-Off or all Rect) instead of having different.

103
ASM / Custom vertical line routine crashes
« on: September 30, 2012, 06:45:32 am »
Writing some program in axe, I needed a fast vertical line routine to substitute this:
Code: [Select]
Rect(X,22-E,1,E*2+1)
The routine should draw a vertical, at y=22 centered line expanding E pixels up and down to a total length of E*2+1 in column X.
This is my idea:
Code: [Select]
Axe
:X:asm(E5) ;push hl
:^8:asm(23E5) ;inc hl, push hl   (gets the number of rotating cycles needed)
:E
:asm(The routine)

Code: [Select]
Stack: #Rotation cycles,  X
HL : E

 pop bc     ; #Rotation cycles  , Stack: 1
 pop de     ; X       Stack: 0
 srl e      ; Div 8
 srl e
 srl e      ; DE: X/8
 ld a,l     ; A: E
 add hl,hl  ; 2E
 inc hl     ; 2E+1
 ld b,l     ; B: 2E+1, #Lines
 push bc    ; #Lines, #Rotation cycles ,  Stack: 1
 ld b,a     ; B: E
 ld a, 22   ; A: 22
 sub b      ; A: 22-E
 ld l,a     ; HL: 22-E
 ld c,l
 ld b,h     ; BC: 22-E   MUL 12
 add hl,hl  ; *2
 add hl,bc  ; *3
 add hl,hl  ; *6
 add hl,hl  ; *12
 add hl,de  ; HL:  (22-E)*12+(X/8)
 ld de, $9340 ; plotsscreen
 add hl,de  ; HL: Start byte
 pop bc     ; #Lines, #Rotation cycles   , Stack: 0
Lineloop:
 ld d,b     ; backup b
 ld b,c     ; #Rotation cycles
 ld a,(hl)  ; A: Byte to modify
Sloop1:
 rla        ; rotate
 djnz Sloop1
 scf        ; Pixel on
 ld b,c     ; #Rotation cycles
Sloop2:
 rra        ; rotate back
 djnz Sloop2
 ld (hl),a  ; restore modified byte
 ld b,d     ; Restore b
 ld de,12   ; DE: 12
 add hl,de  ; Next line
 djnz Lineloop  ; until #Lines-- = 0

I hope somebody can help me finding the error, I'm stuck :/

Edit: It doesn't crash immediately, it does it when the program returns. The error is before lineloop I think

104
TI Z80 / Re: Nemesis- a new axe 3d rpg
« on: September 24, 2012, 12:26:51 pm »
what is more fast : an ion assembly prog or a noshell assembly prog ?

They are the same, just a different header I think. Both is z80 asm, but Ion gives compatibility to other shells.

105
TI Z80 / Re: [Axe] Bullet Proof
« on: September 21, 2012, 11:17:32 am »
Oh, it's looking pretty cool :D

It's fun to play against your neighbors in our math course :)

Things planned atm:
  • Landmines as another powerup

Pages: 1 ... 5 6 [7] 8 9 ... 23