A java game I'm working at has 9 files, each with an average of 2000 lines. That's a total of around 18000 lines of java code. And I still have a lot to do. My largest basic program is almost 700 lines and over 11Kb large, which is large for a basic program which has almost no text in it. Largest axe program: 40 lines. I haven't coded much in axe... My largest (and only) asm program is now around 2500 lines, and also with this program, I still have a lot to code. I think I'm abouth halfway thereof the coding part, then I still have to make levels..
I don't think I can beat someone with the lenght of my programs, but maybe with the lenght of routines: My longest ams routine is 798 lines of (unoptimised) code.
But it still doesn't work. It draws a line instaed while it should draw the top third of the quad in solid black (the texture is an 8x8 solid rectangle).
But, as to why it's not actually working. Your loop should theoretically work as long as you are giving it valid numbers. (It will actually finish no matter what you give it though) So that leads me to believe that the problem is with your pixel plotting. Most likely, you are trying to plot pixels that are off screen and that is what is causing all of your problems. You end up plotting pixels in your program code, which causes crashes.
If you are really unlucky, you might even be plotting pixels at _ty.
I tried jumping over the plotting part, and it still crashes. By the way, this is done in an app, and ass variables defined inside the app itself won't work, then isn't the program protected against SMC?
I have ported half of the code to asm. This code should draw the top third of a textured quad. My problem is that it doesn't draw anything. It gets stuck in an endless loop, and I don't know why.
Spoiler For The code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;TexQuad ;in: x1, y1, u1, v1, x2, y2, u2, v2, x3, y3, u3, v3, x4, y4, u4, v4 ;out: textured quad is drawn to the buffer TexQuad: ld a, (y1) ld b, a ld a, (y2) sub b ld (temp), a ld a, (x1) ld b, a ld a, (x2) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dx1), hl ld a, (y1) ld b, a ld a, (y3) sub b ld (temp), a ld a, (x1) ld b, a ld a, (x3) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dx2), hl ld a, (y2) ld b, a ld a, (y4) sub b ld (temp), a ld a, (x2) ld b, a ld a, (x4) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dx3), hl ld a, (y3) ld b, a ld a, (y4) sub b ld (temp), a ld a, (x3) ld b, a ld a, (x4) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dx4), hl ld a, (y1) ld b, a ld a, (y2) sub b ld (temp), a ld a, (u1) ld b, a ld a, (u2) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (du1), hl ld a, (y1) ld b, a ld a, (y3) sub b ld (temp), a ld a, (u1) ld b, a ld a, (u3) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (du2), hl ld a, (y2) ld b, a ld a, (y4) sub b ld (temp), a ld a, (u2) ld b, a ld a, (u4) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (du3), hl ld a, (y3) ld b, a ld a, (y4) sub b ld (temp), a ld a, (u3) ld b, a ld a, (u4) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (du4), hl ld a, (y1) ld b, a ld a, (y2) sub b ld (temp), a ld a, (v1) ld b, a ld a, (v2) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dv1), hl ld a, (y1) ld b, a ld a, (y3) sub b ld (temp), a ld a, (v1) ld b, a ld a, (v3) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dv2), hl ld a, (y2) ld b, a ld a, (y4) sub b ld (temp), a ld a, (v2) ld b, a ld a, (v4) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dv3), hl ld a, (y3) ld b, a ld a, (y4) sub b ld (temp), a ld a, (v3) ld b, a ld a, (v4) sub b ld h, a ld l, 0 ld de, (temp) ld e, 0 call DivFP ld (dv4), hl ld hl, (x1) ld l, 0 ld (tx1), hl ld hl, (x2) ld l, 0 ld (tx2), hl ld hl, (u1) ld l, 0 ld (tu1), hl ld hl, (v1) ld l, 0 ld (tv1), hl ld hl, (u2) ld l, 0 ld (tu2), hl ld hl, (v2) ld l, 0 ld (tv2), hl ld hl, (y1) ld l, 0 ld (_ty), hl
QuadDrawLoop1: ld a, (tx1) ld (temp), a ;i=temp
QuadPlotLoop1: ld a, (tx1) ld b, a ld a, (tx2) sub b ld c, a ld a, (tx1) ld d, a ld e, 0 ld a, (temp) sub b ld h, a ld l, 0 call DivFP ld a, h ld (temp+1), a ;tmp=temp+1 ld b, a ld a, 1 sub b ld d, a ld e, 0 ld a, (tu1) ld b, a ld c, 0 call MulFP push hl ld de, (temp+1) ld e, 0 ld bc, (tu2) ld c, 0 call MulFP pop de add hl, de ld a, h ld (temp2), a ;u=temp2 ld a, (temp+1) ld b, a ld a, 1 sub b ld d, a ld e, 0 ld a, (tv1) ld b, a ld c, 0 call MulFP push hl ld de, (temp+1) ld e, 0 ld bc, (tv2) ld c, 0 call MulFP pop de add hl, de ld a, h ld (temp2+1), a ;v=temp2+1 ;Get the pixel at (u,v) from the texture ld a, (temp2+1) ;load the v coordinate in a ld hl, texture ld d, 0 ld e, a add hl, de ld a, (hl) ;and load the byte of the v coordinate in a ld c, a ld a, (temp2) ld b, 1 cp b jr c, BitShiftDone ;no shifting if u=0 ld b, a
BitShiftLoop: sll c djnz BitShiftLoop
BitShiftDone: push bc ;1 ld a, (_ty) ld l, a ld a, (temp)
getPixel: ld h, 0 ld d, h ld e, l
add hl, hl add hl, de add hl, hl add hl, hl
ld e, a srl e srl e srl e add hl, de
ld de, PlotSScreen add hl, de
and 7 ld b, a ld a, $80 ret z
rrca djnz $-1
pop bc ;0 bit 7, c jr z, ResPixel
SetPixel: or (hl) ld (hl), a jr EndPlot
ResPixel: cpl and (hl) ld (hl), a
EndPlot:
ld hl, (tx1) ld de, (dx1) add hl, de ld (tx1), hl ld hl, (tx2) ld de, (dx2) add hl, de ld (tx2), hl ld hl, (tu1) ld de, (du1) add hl, de ld (tu1), hl ld hl, (tu2) ld de, (du2) add hl, de ld (tu2), hl ld hl, (tv1) ld de, (dv1) add hl, de ld (tv1), hl ld hl, (tv2) ld de, (dv2) add hl, de ld (tv2), hl ld a, (_ty) inc a ld (_ty), a ld c, a ld a, (y2) ld h, a ld a, c ld c, h cp c jp nz, QuadDrawLoop1 ret ;voorlopig
All of the math routines are for 8.8 signed floating point math. These are all fully tested so they don't couse the cash.
You can make animated screenshots with wabbitemu. Just press backspece. Just in case that won't work on your computer, I made a screenshot for you.
EDIT: THE GAME over screen would probably look a lot better when you copy what's on the display to the back buffer, and the text to the front buffer. then you can make the background grey and the text black.
And: the jumping would look a lot more realistic with accelleration and decelleration.
I really hate to see you go. Omnimaga is the most active calc programming community, and almost all of the good programs for TI calculators are made by omnimaga users. Withouth you, the calc comunity would be dead for a looooooong time.
Could you please try to still check the site once in a while? And maybe coming back after letting it rest for some time.
cleverbot isn't clever at all. He's stupid. He even says it himself:
After he complained abouth not being a bot for some time:
Quote from: CleverBot
ME: Do you complain abouth not being a bot in every sentence with 'bot' in it? CLEVERBOT:Yes. ME: Wow, you're smarter than i thought. CLEVERBOT:No. ME: So you're stupid? CLEVERBOT:Yes.
Maybe you can first try a hardware emulator (if you find one that is compatible with all of the microships you are going to use). There are some freeware emulators, but I think the best ones aren't free (only the legal versions of them, actually ), but they should cost less than buying all of the hardware anyway, so that might be the best choice. An extra avantage is of cource that an emulator can be reset, while when you break real hardware, you'll have to buy new.
A friend of mine knows a great emulator. I'll ask him if you want. (might take a while. I haven't seen him IRL for almost a year, so I'll have to send an email)
1718: you almost have an heart attack every time you think you have lost your calc 1719: you have calcsys installed on your calc 171A: You have tried to archive a blue screen by quickly turning the contrast all the way up and down. 171B: You haven't even noticed that i started counting in HEX