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 - Iambian

Pages: 1 ... 3 4 [5] 6 7 ... 52
61
TI Z80 / Re: Nyan Cat: Codename NaCaNiS
« on: February 14, 2015, 08:32:32 pm »
I probably should've done this a long time ago, but I recorded the most of the first three stages of Story Mode using Bandicam (as the Wabbitemu screenshot utility doesn't work quite right).

This is also my first Youtube video.

62
TI Z80 / Re: Tornado (working title)
« on: February 13, 2015, 10:47:02 pm »
That's looking pretty awesome.

Had to read the topic on Revsoft to better understand what's going on, but if I understood it right, what you've got there is amazing and I hope it continues growing.

63
ASM / Re: WizardC8
« on: February 04, 2015, 08:58:38 pm »
There are several ways of going about doing this, and very few of them actually use the CP instruction, since that only works between two one byte values, whereas an OP "register" is a memory construct and is not directly supported by the CPU (meaning you have to do this in several steps to simulate support, which is what ASM is really about)

1. Compare the two OP registers directly by first comparing the exponent. If one is greater than the other, you can stop already. If not, then compare each byte afterwards until something happens. What that something is... is up to you.
Code: [Select]
ld DE,ADDRESSOFFIRSTOPREG+
 ld HL,ADDRESSOFSECONDOPREG+
 ld b,8
Loop:
 ld a,(de)
 cp (hl)
 jr nz,SomethingHappened
 djnz Loop
 ret
SomethingHappened:
;carry=(DE)<(HL)
;your code here
 ret

2. If your numbers are integers, use the romcall ConvOP1 to convert to DE, swap out to HL, preserve it, move second value to OP1 and do the call again, then use the or a \ sbc hl,de sequence, since that works best as a two-byte CP instruction.
Code: [Select]
bcall(_convop1)
 push de
   ;move other value to Op1
   bcall(_convop1)
 pop hl
 or a
 sbc hl,de
 ;carry if second value was greater than first convOp1 value
 ;insert your code here
 ret

3. Get the OS to do the comparison for you BASIC-style, except you're directly calling a parser function. Today, it's _BinOPExec (for two-argument functions), where the first argument is in Op1 and the other pushed to the FPS. You then load register A with the function to execute before using the romcall.
Code: [Select]
;arguments are assumed to be in place already
 ld a,FUNCTION
 bcall(_BinOPExec)
; Op1 will contain the result of the operation. If you use something
; like OPEq, OPGt, or OPLt, you'll get 0 for false or 1 for true.
; You can then use ConvOP1 to reduce that to register A then compare it.

As with all unfamiliar romcalls, you must read the documentation for further information.






64
TI Z80 / Nyan Cat: Codename NaCaNiS
« on: January 31, 2015, 01:46:07 pm »
Originally a Cemetech contest entry (no. 13), I expanded upon this entry after the due date to have the project more closely match the vision I had for it on project inception. Since it was a Cemetech thing, they got it first, but here do I release the (most likely) final version. Attached to this post is NaCaNiS version 0.4.

The program is a bit hefty, tho. Weighing in at about 20KB (~13KB of which is story material), you'll need to make sure much of your RAM is cleared before running. You'll need Doors CSE or a shell that can run nostub ASM programs to get prgmNACANIS to run.

If you want a simple cat game with no story mode, send NCNS003.8xp to your calculator instead. That's only 7-8KB and will run on the homescreen as a nostub ASM program.

This is a TI-84 Plus CSE game. It will not run on any other calculator.


More images here

65
ASM / Yet Another Z80 ASM Tutorial
« on: December 18, 2014, 04:06:10 pm »
YAZTA. What a silly name. This is a crosspost:

For a week or two, I've had this thought about making another Z80 assembly tutorial. At the moment, the best tutorial out there is Asm In 28 Days, but I've heard complaints regarding its usability for new people for actual learning material. Sure, it makes a wonderful reference but the one thing I've found is that it doesn't have workable, testable examples and things that one can be done to help reinforce learning. I don't know about most of the other people out there, but I learn best by doing, and the tutorial I want to make will cater to that sort of crowd.

I started writing a sort of road map concerning the topics that should be discussed, and in what order to present them in. I figured that if I want to actually write a tutorial, I'd best have an outline first before announcing anything since an announcement in and of itself isn't all that helpful in getting this idea off the ground.

This is what I have after a bit of thinking. Comments and suggestions appreciated.

Code: [Select]
Z80 Assembly Tutorial For the TI-83 Plus (SE)
Centered around creating a simple game, then making it run faster. Better.
Each section should have DIY tasks to help them understand a concept better.
Subsections explaining actual instructions will be indexed in a different color.

* Introduction
   What ASM is, isn't, what it takes to learn, and tutorial methodology.

* Development Environment
  - Assemblers and getting your first binary (.8xp) assembled.
  - Link software if you have actual hardware
  - Emulators and how to use them.

* Numbers, Variables, and Memory
  - A forward. All these topics will involve the use of the LD instruction and
    its many variations.
  - Numbers
    - Discussion on decimal, hexadecimal, and binary and why to use them.
    - A short note on octal and that it was historically used.
  - Variables
    - Discussion of registers and their short term scope
      - A short note on other special purpose registers and their functions
    - Short discussion about the stack and its longer but still short term scope
    - Discussion of SafeRAM and their scope in-program.
    - Discussion of files and their persistence after a program ends.
  - Memory
    - What memory is, and the different types on the calculator
    - Memory maps and address range
    - A listing of various stretches of safeRAM on the calculator
    - Memory access is just another number. Talk about indirection here.
  - Hardware
    - Very short explanation that additional hardware such as keyboard, memory map
      ports or LCD are accessed via IN/OUT instructions. Each has their method of
      access, and is only briefly mentioned here because memory was discussed.

* System Calls
  - A short section on what a bcall is.
  - Locations and places of references for said system calls.

* Something Useful - Messing Around With Text
( Should showcase all manners of LD instructions and use here )
  - Introducing useful romcalls for messing with the homescreen.
  - A reminder that romcalls can and will mess around with the contents of registers
    and that registers are for SHORT TERM STORAGE.
  - Displaying a string.
  - Introduce the CALL/RET instructions for subroutines
  - Displaying one character at a time
  - Introduce math instructions (ADD/SUB) (INC/DEC)
  - Displaying numbers from registers

* Key input
  - Introduce program control flow via CP/JP
  - Introduce system calls for getting key input, link to reference table
  - Have the user do stuff with keypresses to make the program display different things
  - Implement text "sprite" onscreen and move it around.
  - Introduce and explain z80 FLAGS
    - Tie in this knowledge with math instructions
    - Using that knowledge, implement movement boundary checking

* The Graph Screen and Graph Buffer
  - Introduction to graph buffer and the separation between that and the LCD
  - Displaying text on the graph buffer.
    - Re-implement text sprite on graph buffer
  - Using system calls to draw lines and boxes onscreen
  - Introduction to sprites and the many methods of drawing them to screen
    - Will use ION sprite routine as basis. Its operation will not be explained yet.
    - A note that this topic will be re-visited later on to support clipping

* The Stack
  - Introduction to what the stack is and what it's used for
  - Introduction to PUSH/POP
    - Explanation of push/pop procedures.
      - Upgrade previous program with it.
    - Explanation of CALL/RET and how it messes with the stack
  - Explanation of EX (SP),HL and its use
  - Short explanation of direct stack manipulation
    - Note on how this is generally used to create an exit-from-anywhere point.
    - Caveats about using SP in a manner other than for call/variable stack purposes
      - Link forward to interrupts section if student really wants to abuse SP

* Arrays and Jump Tables
  - Arrays and what they are
    (Now would be a great time to discuss indirection
    - How to read/write to/from them
    - Methods of managing them (if at all)
      - Great place to introduce block copy instructions (LDI[R]/LDD[R])
      - At this point, we can create a graphscreen game
        based on avoiding other moving objects
  - Jump tables
    - What they're for
    - Jump tables filled with 2-byte addresses
    - Jump tables filled with 1-byte offsets

* Bitmasking and Bit Math
  - Introduction to system flags and BIT/SET/RES instructions
    - Messing around with inverting text and those various flags.
      - While we're at it, accelerate text drawing by making vputs routines buffer-only
  - Introduction to the zillions of rotate/shift instructions available on the z80
    - Might as well introduce direct keyboard reading now
      - Shifting and rotating results out to carry seems like a great method to use.
      - Upgrade the game with this.
  - Introduction to AND/OR/XOR instructions
    - Methods of bitpacking so varibles take up less space
    - Setting, resetting, or testing multiple flags at the same time
    - Bitmasking and examining how ION's sprite routine works

* Interrupts
  - Explanation of what interrupts are and how they may be useful
  - Enable, disable, and create and clean up after interrupts
    - Hardware differences that influence this on the SE's and 84's

* LCD and Direct Access
  - Details of the screen itself and manner of access via ports including delays
  - Reference of commands and things you can do
  - Introduction to ION's fastcopy routine
  - Introduction to grayscale. How to abuse interrupts and slowness of LCD to achieve
 
* Accessing Variables Outside Your Program
  - List of what a file is and the various filetypes on the calc
    - Details of each file type and their use
  - Romcalls used to check for, access, create and delete variables
    - With this, perhaps we can create an external high score file?
    - How to resize variables if you weren't sure how large they ought to be on create
  - Explanation of what the VAT is and how to traverse it
  - Explanation of how to access archived variables without unarchiving them first

* Use of TI's Floating Point Structures
  - An overview of what floating point numbers are, and a quick note on fixed-point
    - None of our examples will use them, but this topic is covered for completeness.
      Perhaps you'll get an idea that requires decimal precision and this works.
      That circular version of the worm game comes to mind.
  - Details of TI's floating point format
  - Available romcalls for moving floats and float-sized data.
  - Available romcalls for manipulating the Floating Point Stack (FPS)
  - Available romcalls for mathematical purposes

* Fixed Point Mathematics and Mult/Div routines
  - What fixed point math is and why it may be better to use it
  - Outline of multiplication
    - Naive method
    - Faster multiplication method and why it works
  - Outline of division
    - Naive method
    - How to use fixed point math ideas to multiply by reciprocal instead.
      - Division is slow and awkward. This is a way to avoid it
    - Faster division algorithms and why they work.
      - Oh gawd. I am NOT looking forward to this section.

* Creating Flash Applications
  - What Flash Applications (FlashAPPs) are and why to use them
  - Changes to the dev environment to support FlashAPPs
  - Differences that must be observed (e.x. how to exit flashapps, no SMC, etc.)
  - Multipage FlashAPPs
    - Doing it TI's way, through the use of an in-app bcall table.
    - Doing it our way, through the use of a pagechange stub.
      - Might as well introduce how to mess around with memory mappings here.
      - Also discuss cross-page access

THIS IS WHAT I HAVE SO FAR.
CHERRIES FOR EVERYONE.

66
TI Z80 / Re: So I Was Told About This Thing...
« on: June 15, 2014, 12:08:04 pm »
This program uses three prerendered screen-sized masks, which are combined one at a time on the buffer. Interestingly, the masking process for each buffer is slower than the tilemapper used to render each frame, but the process is straightforward enough to embed in the LCD delay cycles (since this thing is running at 15Mhz).

The Wikipedia entry on fast circle rendering helped me very much, since the C code that is present transcribes almost directly into assembly.

Of course, since I'm the sort of person who "wants results nao", here's a few intermediate screenshots I took while I was working on this program. Note how much faster it is when I'm not masking [much of] anything. (Note that the first [and second] image actually has a frame limiter since it ran too fast)

67
TI Z80 / So I Was Told About This Thing...
« on: June 14, 2014, 06:00:30 pm »
... and I just had to do it.

Geekboy wanted me to whip up some sort of grayscale lighting effect that darkens the further you move away from some point.

The end result isn't particularly efficient or speedy, but I do like the look of it.

Written in z80 assembler. Flood fill subroutine (to fill in the circle) provided by Xeda. Everything else written from scratch. Time: 2 days.

68
z80 Asm / Re: Bootcode disassembly
« on: March 22, 2004, 09:46:44 am »
I have it ready, for the TI-83 Plus Silver Edition.

Should I post the bootcode?

69
z80 Asm / Re: Bootcode disassembly
« on: March 09, 2004, 10:39:44 pm »
Project progression on FF1 is going quite slowly. I intend on keeping it TI-83 Plus Silver Edition, and I intend on keeping the tilemap. The tilemap routine and the parts of the program governing mov't had to get a MAJOR overhaul, since it was too cluttered for me to even begin to work on. You should see the source code (found at my site, available for dl) and you'll understand what I mean...

But, making it work between TASM and ZDS coudn't be easier. It's just too easy to alter the tasm80.tab file to make the bcalls work. Making the assembler think that "bcall" is part of the z80 instruction set... hah! Couldn't be easier!

Aaaaanyway. What if I say that the disassembling of the bootcode was for educational purposes. I am being educated by it, and even if I'm not successful with my intent, I would have learned a whole lot of how TI did things in their system. Heck... for SE users, you could simply call the internal _PutS rotuine on the bootpage if you flipped the page in and do a "call $6E06". 'tis MUCH faster than doing a bcall to it, which costs MAJOR clock cycles. And is a good way to keep things calc-specific! :)

70
z80 Asm / Re: Bootcode disassembly
« on: March 08, 2004, 06:51:44 pm »
Alright already. Since they don't allow it, I'll just stop. :D
(heh...)

71
z80 Asm / Re: Bootcode disassembly
« on: March 05, 2004, 06:06:44 pm »
Okay. Very little work done at school.
Up to the 11th page of notes, I am at so far. Hope it goes well...

And for the next three pages (well, two, since one of them isn't a code page), I'll just make a nice little program and dump the disassembled information to my computer, in multiple files. Hey! It's easy enough, if an ONLY if I can get my on-calc disassembler to work on it like that...

And I truly do plan on making my own OS. Maybe one that will have a password system that'll be built into the darn thing. That'll be immune to all battery pulls, but not against that ON-DEL thing. Oh well... can't have everything, can you?

A Lindows environment for the minature computer? "Install" the calculator software individually. And anything else. Mabye a semi-permanemt "MirageOS", or its own version? Hey! Built-in ION. Or a different, optional memory allocation, for the RAMapp? Heh... so many things to choose from, yet so little experience to implement them! :D

72
z80 Asm / Re: Bootcode disassembly
« on: March 03, 2004, 10:50:44 pm »
Gah! That's no help!
I wanted info on if it was done already.
If not, then I'll just continue disassembling by hand (maybe this is the best way? Learning as I'm writing)
Calcsys, I'm placing my full trust in your ability to do this right. :p

I've got five pages nearly done on this, with a call/jp table on another sheet.

And, me? If I get it done right, I'll probably be able to make my own OS, once I know how the bootcode will accept the operating system.

73
z80 Asm / Bootcode disassembly
« on: March 03, 2004, 05:20:44 pm »
Has anyone been able to disassemble the bootcode and make some text document on it? For the Silver Edition, most specifically? Or both?

I'm just wondering, because I'm ending up writing it all down on a piece of paper. (That's time consuming, but I guess I need some way to pass the time at school)

74
General discussion / Re: First Post?
« on: March 05, 2004, 06:08:44 pm »
Yeah. One and the same. I wrote the FlashCrash program, and I'm not afraid to use it.

Maybe I should start researching more on the TI Link protocol, and make a second version of FlashCrash that'll destroy the victim's TI-OS by the simple act of linking with the victim? What should it be called? FlashCrashII? FlashBash? ROMJob? What?

75
General discussion / Re: First Post?
« on: March 03, 2004, 10:52:44 pm »
Thanks for the welcome!
Ya know... I'm starting to get used to the new interface. Has a lot more stuff easily accessible.

I LIKE this!

Pages: 1 ... 3 4 [5] 6 7 ... 52