Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

tquester

8
Posts
2
Followers
A member registered Jul 30, 2023 · View creator page →

Creator of

Recent community posts

Thanks for all the work in Octo Jam

Though this year have been less entries but we have at least two new compilers, one for c and one for extended octo assembly, some new libraries and a hand full of new emulators. I hope the number of users will rise if we can make Mega Chip8 a replacement for Flash games. The rest ist marketing. We need new programmers, new players but also marketing professionals.

If each memory location contains the number 0..9 than we do not need bcd

: show-score
  v5 := 0 # Coordinates to draw to
  v6 := 0
  i := score
  load v3
  i := hex v0
  sprite v5 v6 5
  v5 += 5
  i := hex v1
  sprite v5 v6 5
  v5 += 5
  i := hex v2
  sprite v5 v6 5
  v5 += 5
  load v3
  i := hex v0
  sprite v5 v6 5
  return

I love the hand writing in the game.

This code implements a 16 bit unsigned int library in octo. It can read and print 16 bit numbers and has the operations add, sub, mult, div and mod

https://github.com/tquester/J-Octo-Chip8-IDE/blob/main/samples/lib/libMath.8o

(4 edits)

Currently I did not talk to John.
There is already a pre-processor that supports :include, I saw it in Timendus test suits.

The compiler is a completly re-written and supports for...next, switch..case, inline math and some commands to enable the sprite and the tile editor to find and modify the data (which is implemented currently for reading from the source code).

I do not have a pre-processor, but with compile to disassembler you can generate a source code that compiles on any octo or chipper compiler. 

Later I will add command line arguments, so that compiler, disassembler, tile and sprite editor and debugger can be used without the ide or in visual studio code.

In order to do this, you need to write a 16 bit math library: addition, subtraction, multiplication, division. The first two are relativly easy, just add the low and the hight byte and add or subtract the carry bit. For multiplication you may use the russian multipication algorythm (see for example https://www.wikihow.com/Multiply-Using-the-Russian-Peasant-Method) which only works by shifting a binary number and addition. Divison works like you divide on paper. You may convert z80 assembly to chip8. For example from here: https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Division or for 6502 (https://llx.com/Neil/a2/mult.html) with good explanation of the algorythm.

Lazy Multiplication by 10 can be done by 
x = x + x ; *2
y = x  
x = x + x ; *4
x = x + x ; * 8
x = x + y;  * 10
You have to use your 16bit addition here and work with two registers. There is no lazy divide by 10

If you have all this, you can start decoding the number to decimal. 
The last digit you get by
1. Divide by 10. 
2. Multiply by 10.
3. Take difference. 
Repeat this until the number is 0

You may also work the other way around.
digit1 = x / 1000
x = x / 10
digit2 = x / 100
x = x / 10
digit3 = x / 10
digit4 = x



I am targeting Super Chip 8 with no more than 100 instructions per frame.

My Emulator on ZX Spectrum runs slower but the game is stll playble.

I wrote my own compiler/ide with some language extensions: https://github.com/tquester/J-Octo-Chip8-IDE

For compatibility there is a version that compiles with https://johnearnest.github.io/Octo/