This is a project i have slowly been working on. There is yet very little progress, i haven't even started the tilemapper. One reason why i have not yet started the tilemapper is because i need a third 79KB buffer for partial redraw. My current plan is too use free ram (the location were programs are stored) as the third graphics buffer.

The main menu works and is 100% complete, key detection, drawing functions, and other stuff like that are working fine.

Really REALLY bad pic: (will try to get a better one this afternoon):

I also have a custom font renderer done Wink
This is for the CE?

I was wondering if you could explain your proposed buffer setup?

Minecraft on calc would be very nice!
Ok, i got every thing buffer related sorted out. Vram is ofc vRam. Vram+320*240 is the second buffer, this is used to double buffer the screen so that there are no sync errors and stuff; and lastly there is a third buffer in user ram (between (FPS) and (OPS)). The third buffer stores a rendition of part of the tilemap. It is used in partial redraw so i sont have to redraw the whole screen each fram.


Side note: progress on the tilemapper Smile
Why do you need another copy of the tilemap, rather than just storing a pointer to the tilemap's original data in your program or in an Archived appvar, wherever it happens to be?
Partial redraw Wink I dont redraw the whole tilemap each frame, only the left/right/upper/lower border. This makes the tilemapper a lot faster.
c4ooo wrote:
Partial redraw Wink I dont redraw the whole tilemap each frame, the left/right/upper/lower border. This makes it alot faster.
Wouldn't you just be shifting an existing half of the buffer and then drawing new tiles in, though? It's still not clear to me what that third buffer is for.
Well, the Vram+320*240 (graphBuff) buffer contains more than just the tilemap. It contains also the GUI, entities and more. Every time graphBuff is finished rendering, it is copied to vRam. This is to prevent the LCD from rendering an unfinished frame. TileMapBuffer only contains the tilemap. Every frame i copy TileMapBuffer to graphBuff, render the GUI and other things to graphBuff, and then copy graphBuff to vRam. Hope this explains stuff o/

Also, source code shall be uplouded here: https://github.com/c4ooo/Minecraft-Ti-84-Plus-CE/tree/master
I need some help with the tilemap engine. It sort of renders but there are visual bugs and stuff.
This code should load (tempVar4) with tileMap+(playerTileY)*1024+(playerTileX), right?

Code:

ld a,(playerTileY)
   ld hl,0
   ld h,a
   add hl,hl
   add hl,hl
   ld de,(playerTileX)
   add hl,de
   ld de,tilemap ;-10-(mapWidth*7)
   add hl,de
   ;ld hl,tilemap
   ld (tempVar4),hl

Next, this code should load (tempVar5) with (tileMapBuffer) + (playerOfsetY)*320 + (playerOfsetX)

Code:

   ld a,(playerOfsetY)
   ld hl,$00A000
   ld l,a
   mlt hl
   add hl,hl
   ex de,hl
   ld hl,(tileMapBuffer)
   or a
   sbc hl,de
   ld a,(playerOfsetX)
   ld de,0
   ld e,a
   or a
   sbc hl,de ;hl=(tileMapBuffer)-(playerOfsetX)-((playerOfsetY)*320)
   ld (tempVar5),hl

And this is the loop to render everything:

Code:

   ld b,15
drawWholeMapYLoop:
   push bc
   ld b,20
drawWholeMapXLoop:
      push bc
      ld hl,(tempVar4)
      ld de,0
      ld d,(hl)
      ld hl,tileset
      add hl,de
      ld de,(tempVar5)
      call render16x16 ;hl=sprite de=ptr to buffer
      
      ld de,(tempVar5)
      ld hl,16
      add hl,de
      ld (tempVar5),hl
      
      ld hl,(tempVar4)
      inc hl
      ld (tempVar4),hl
      pop bc
   djnz drawWholeMapXLoop
skipWholeMapXLoop:
   
   ld de,(tempVar5)
   ld hl,320*16-320
   add hl,de
   ld (tempVar5),hl
   
   ld hl,(tempVar4)
   ld de,mapWidth-20
   add hl,de
   ld (tempVar4),hl
   pop bc
   djnz drawWholeMapYLoop
   ret

Can someone see what is wrong? My tilemapper should rnder '0' tiles every were except the first row, which should be '1' tiles. It is doing that, but sometimes a '1' tile shows up on the left and right side of the screen in the second row. Next, when the (playerofsetX) is not 0 then the last column is rendered 1 pixel higher, but everything else is ok.
BTW, the above problem has been solved...

In my y-sprite cliping code, i need to jump to tooSmall if de<(tilemapbuffer) and goto tooBig if de>(tilemapbuffer)+320*(240-16)


Code:

    push hl
    ld a,16
    ld hl,(tileMapBuffer)
    ex de,hl
    or a
    sbc hl,de
    bit 7,h
    push hl ;yea this is bad
    add hl,hl
    pop hl
    jp nz,tooSmall
   
    ld de,320*(240-16)
    or a
    sbc hl,de
    push hl
    add hl,hl
    pop hl ;this too
    jp z,tooBig
    pop hl
You should change your indenting to match your stack depth!


Code:
    push hl
        ld a,16
        ld hl,(tileMapBuffer)
        ex de,hl
        or a
        sbc hl,de
        jr c,tooSmall ; de was greater than hl; that is, (tilemapbuffer) > de
   
        ld de,320*(240-16)
        or a
        sbc hl,de
        jr nc,tooBig
      pop hl
So first of all, there's no point in testing bit 7 of hl (also, you want to know about bit 7 of HLU, anyway, or even the carry bit. The code above first subtracts (tilemapbuffer) from de; if it (under)overflows, then it rolled through 0. Otherwise, the difference is still greater than zero, and it subtracts 320*(240-16) . If it doesn't roll through 0 now, then it was too large; otherwise, it was okay. Also, be aware that your brokenish code and my correct (hopefully) code both destroy de.
Thanks Kerm! Thanks to everyone's contributions I have finnaly put together a tilemapper: Very Happy
http://imgur.com/0EME5RW.gif (big file size)
Now i must work on speeding up the tilemapper, and creating a 2D world generator. I am interested in any advice you guys can give on world generation Smile
Nice, nice. Vaugely reminiscent of Minecrft but nicer looking; keep up the good work!
I dont know if i will keep working on it, but i restructured the entire project and rewrote the tilemapper. The source code is still here: https://github.com/c4ooo/Minecraft-Ti-84-Plus-CE/
I have two questions for c4ooo.
1.) Can you put the appvars for the 2D minecraft in the original respository. I have to view the history of edits to get the appvars. I put them on my ti 84 ce, with A.8xp. But load world doesn't work after i make one, [2nd] replaces a block with air, and [alpha] replaces a block with a white block. I cannot change block types either, so all I have is air and a white, empty block. I will try again but that's all I keep getting.
2.) Can you list any or all controls for the game so far? I have looked in the code and found a few keys, like arrows, [2nd] and [alpha], but can you list the controls?
The project was never completed, it was always something I have been doing as a test/something to strave off boredom. That's why loading and saving doesn't really work. As for the appvars, I don't have access the code/appvars on my Pc right now, but unless I am wrong the reprository should have a bat file to build the appvars. As for the controls, arrow keys are to move, alpha/2nd is to build/delete, and [xton]/[math]/[prgm]/[apps] (iirc) are to move the cursor around in a circle. There's currently no way to change the block to be placed.
Oh ok.
TimmyTurner62 wrote:
Oh ok.



2
word posts are weird and give me bad thoughts
Hah! But I would really like to see a 2d minecraft on my ti 84 ce, but I just gotta be patient. I'm trying to figure out how exactly I could use a tilemap so I can make a 2d minecraft in ice. I plan to have 16*16 blocks, a 172 long by 142 tall world, but so far I cannot figure it out. I will post this in an ice forum.
I think you can use the tilemapper found in mateo's C libs through ICE. Last time I was working on this project, I ran into the problem that minecraft is just too color full for an 8bit palette.
Too colourful? Surely you can get away with 256 colours when making Minecraft?

You can even define your own 256 colours instead of the default palette if that helps?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement