* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Help with ASM Christmas Tree project  (Read 835 times)

0 Members and 1 Guest are viewing this topic.

Offline caleb1997

  • Full User
  • Safe-haven access
  • Join Date: Dec 2015
  • Location: In a calculator.
  • Posts: 60
  • Post Rating Ratio: +1/-1
  • Gender: Male
Help with ASM Christmas Tree project
« on: December 31, 2015, 07:35:39 pm »
Hello! Because I am still learning ASM, I'll need a little bit of help here on a Christmas Tree project. It's on Cemetech, but I'd figured that it would be better to ask on other forums, and not just Cemetech.
Code: [Select]
HL is the sprite data
Somehow get A to be the sprite height and BC to be the sprite width
DE must point to the top-left pixel of where the sprite will go.
(Put the loop label here)
    push bc ; Save the sprite width for later on
    push de ; Save the current pixel for later on
    ldir ; Does "ld (de),(hl) \  inc hl \ inc de \ dec bc" until BC=0 (so effectively it copies BC bytes from (HL) to (DE)
    pop de ; Grab the far left pixel of the current row
    ld bc,320
    ex de,hl ; Swap HL and DE temporarily so we can add a number into DE
    add hl,bc ; Add 320 to the screen pixel pointer (normally DE, but we swapped it with HL) to advance to the next row on the screen
    ex de,hl ; Swap them back to normal
    pop bc ; Retrieve the sprite width again
    dec a
    jr nz,LoopLabel
    ; "dec a \ jr nz" is basically DJNZ but using the A register instead of B
.nolist
#include "includes\ti84pce.inc"
.list

 .org userMem-2
ProgramStart:
 .db tExtTok,tAsm84CeCmp
;...
;---> 8bpp picture
 ld a,lcdBpp8
 ld (mpLcdCtrl),a
 ld hl,christmastree_paletteStart    ; palette mem
 ld de,mpLcdPalette
 ld bc,christmastree_paletteEnd-christmastree_paletteStart
 ldir
 ld hl,christmastree_sprite
 call drawSprite8bpp
;...
 ld a,lcdBpp16
 ld (mpLcdCtrl),a
 ret

#include "christmastree.bin"
And for reference, I would like it to look something like this, but minus the curves.

Am I right? Or am I doing something wrong in the above code?
« Last Edit: January 14, 2016, 06:17:29 pm by DJ Omnimaga »


  • Calculators owned: CSE, CE

Offline Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2812
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: Christmas Tree project
« Reply #1 on: January 02, 2016, 06:52:36 am »
Sounds like a good start to ASM! Will the lights be blinking?
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
  • Gender: Male
Re: Christmas Tree project
« Reply #2 on: January 02, 2016, 11:33:13 pm »
Good luck but I can't really help :/ I have no experience with ASM, sorry ._.
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Offline caleb1997

  • Full User
  • Safe-haven access
  • Join Date: Dec 2015
  • Location: In a calculator.
  • Posts: 60
  • Post Rating Ratio: +1/-1
  • Gender: Male
Re: Christmas Tree project
« Reply #3 on: January 04, 2016, 06:28:14 pm »
Yes, the lights will be blinking.

Good luck but I can't really help :/ I have no experience with ASM, sorry ._.

Thanks. But please... Next time, if you don't know anything, please don't post. Just trying to point something out.
  • Calculators owned: CSE, CE

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18522
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Christmas Tree project
« Reply #4 on: January 04, 2016, 08:01:40 pm »
Note, @caleb1997 , that CodeWalrus etiquette is different from Cemetech.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline Streetwalrus

  • Professional slacker
  • Super User
  • Original 5
  • Join Date: Nov 2014
  • Location: Israel
  • Posts: 2903
  • Post Rating Ratio: +20/-0
  • ƎW∀⅁ ƎH⊥
  • Gender: Male
Re: Christmas Tree project
« Reply #5 on: January 04, 2016, 08:22:46 pm »
Yeah, encouragement is welcome here. There is nothing wrong with his post, it's not counter productive so it's a valid comment.
  • Calculators owned: TI-80, HP 40G, TI-84 Plus rev G (yay 128k RAM), TI-83 Plus Silver Edition (broken LCD), TI-82 Stats.fr (black), TI-Nspire CX rev C (yay Nlaunchy), TI-83+ SE ViewScreen



Offline caleb1997

  • Full User
  • Safe-haven access
  • Join Date: Dec 2015
  • Location: In a calculator.
  • Posts: 60
  • Post Rating Ratio: +1/-1
  • Gender: Male
Re: Christmas Tree project
« Reply #6 on: January 04, 2016, 08:58:15 pm »
My bad.

I apologize.


In light of that, I ask a question: Can somebody please help me develop a sprite routine? Because it looks like it'll be a while until I can get to a generator (I know of a few, though) that can make one for me, and rather than waiting for access to a generator, I've decided to write my own sprite routine. Plus it'll give me something to do.

So... How would I get started?
« Last Edit: January 14, 2016, 03:41:29 pm by caleb1997 »
  • Calculators owned: CSE, CE

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18522
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Christmas Tree project
« Reply #7 on: January 14, 2016, 06:16:58 pm »
Hm you might need to ask on Cemetech, since CodeWalrus doesn't have any Z80 ASM programmer currently active. But in case one passes by I will rename your topic so that it looks like an actual help topic.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games