Commit Graph

34 Commits

Author SHA1 Message Date
Jason Turner 165c63701a Stub in support for commander x16 2021-09-09 22:35:04 -06:00
Jason Turner 95f50f59af Minor updates to petscii generator 2021-09-05 17:35:12 -06:00
Jason Turner f410dfd38e Presentation code working 2021-08-31 17:57:08 -06:00
Jason Turner bda3c6a9fc "die" from exhaustion and full map movement 2021-07-18 18:57:17 -06:00
Jason Turner f3a37140ba Reorganize game code 2021-06-10 21:08:27 -06:00
Jason Turner 2536c4e2c7 Minor optimizer fixes 2021-06-02 21:12:28 -06:00
Jason Turner f52296a00f Add color support for drawing of text 2021-05-28 22:40:54 -06:00
Jason Turner 8b159faa59 Better label handling 2021-05-27 08:31:02 -06:00
Jason Turner 949e118ef7 Game map actions starting to work 2021-05-25 22:30:03 -06:00
Jason Turner cc08629435 Fix parsing of literal expressions for adiw/subw 2021-05-25 18:42:57 -06:00
Jason Turner 1f03d18d5e Fix processing of labels to get std::variant working 2021-05-25 13:49:33 -06:00
Jason Turner 5b6bfd138d Get some simple petscii graphics example 2021-05-23 13:53:34 -06:00
Jason Turner af0a07b913 Completely revamp optimization algorithms for safety and ability 2021-05-21 11:26:49 -06:00
Jason Turner e7a3db9dda Fix up some optimizer passes 2021-05-13 23:35:57 -06:00
Jason Turner 9fe26641b7 Add additional example 2021-05-09 08:39:55 -06:00
Jason Turner ab9dd4e1b7 Updated 16bit counter example with higher level functions 2021-05-05 16:44:30 -06:00
Jason Turner 77c25389aa 16 bit counter example working 2021-05-05 15:56:08 -06:00
Jason Turner 24012c1ff7 Fix use of address 1 to literal 1 for skip instructions
Thank you to the viewers who pointed out the issue at the
end of the stream.

At this point, simple code works, but the conditional
from the joystick input does not seem to work yet.

 * also add location header for linker
 * also filter errors and directives better
2021-04-22 18:54:00 -06:00
Jason Turner 5591249f2a Almost working programs with AVR conversion
* need to add a decent header address
 * probably need to fix sbrc and sbrs
2021-04-22 15:52:35 -06:00
Jason Turner 13af1e8cca Get AVR code starting to work, make debuggable 2021-04-22 10:42:21 -06:00
Jason Turner da8dcfe213 Merge branch 'master' of github.com:lefticus/x86-to-6502 2016-10-26 15:35:08 -06:00
Jason Turner 36ad50fa32 Make copy of original pong template based version 2016-10-26 15:33:57 -06:00
Marko Mäkelä 617e11244e Move the sprite declarations to the main() function.
This change does not affect the generated code, other than the
assembler labels for the data. The data will still be initialized
at compilation time.
2016-10-09 21:05:01 +03:00
Marko Mäkelä ee36c4c08f Define a constexpr VIC_II::Sprite constructor.
write_multi_color_line(), write_line(): Remove.

VIC_II::SpriteLine<bool multicolor>: A line of sprite bitmap data.
The constructor converts one line of data at a time.

VIC_II::Sprite<bool multicolor>: An array of SpriteLine.

This change does not affect the generated binary code.
In the assembler code generated by clang++-4.0, the binary data
will be formatted in groups of 3 bytes instead of 3*21 bytes.
2016-10-09 21:03:28 +03:00
Marko Mäkelä 24df091a6f Introduce VIC_II::HighResSprite and VIC_II::MultiColorSprite.
write_multi_color_line(): Replaces write_multi_color_pixel().

write_line(): Replaces write_pixel().

The generated code is not affected by this change.
2016-10-09 18:35:40 +03:00
Marko Mäkelä 504d13a527 Initialize the sprite data at compilation time, not at runtime.
VIC_II::SPRITE_ALIGNMENT: The MOS 6566/6567/6569 VIC-II expects
sprite data to be aligned at 64 bytes.

VIC_II::SPRITE_STARTING_BANK: Remove.

VIC_II::write_multi_color_pixel(), VIC_II::write_pixel(): Make static.
Write to the specified memory address.

VIC_II::Sprite::Sprite(): Refactored from VIC_II::make_sprite().

VIC_II::enable_sprite(): Take a Sprite reference.

sBall, sBat: Sprite images, declared at global scope.

FIXME: How to ensure that the VIC_II::Sprite addresses do not end up in
the range 0x1000..0x1fff or 0x9000..0x9fff (where the character generator
ROM is overriding RAM)? Any portable alternative to using GCC-style
__attribute__((section("sprites"))) and a linker script?

Note: Declaring the sprite images as static const objects in main()
would cause clang++4.0-svn279916-1 to generate code for initializing them.
So, we will declare the objects in the global scope.

This has been tested on a Commodore 64 with the following steps:

clang++-4.0 -m32 -O3 -std=c++1z -S pong.cpp
x86-to-6502 < pong.s > pong.asm
edit pong.asm to define code start at 0x900 and to adapt the output
invoke some 6502 assembler
SYS2304 to run the output on a Commodore 64
2016-10-06 18:00:58 +03:00
Jason Turner 88d197e0d7 Docs and cleanups of pong example 2016-09-20 15:14:10 -06:00
Jason Turner 9b204a4af0 Pong rework-working 2016-09-08 19:16:52 -06:00
Jason Turner 03d360ac56 Cleanups for Conf 2016-08-24 16:56:07 -06:00
Jason Turner e3ebc954fa Reorganize file structure 2016-08-24 16:55:08 -06:00
Jason Turner 87f1962f2b Add some docs and test and cmake support 2016-07-07 15:48:27 -06:00
Jason Turner 8a0b8a107d Put readme.md in correct place 2016-07-07 15:26:12 -06:00
Jason Turner b5dd153cd4 Add readme.md with basic usage 2016-07-07 15:21:40 -06:00
Jason Turner f69150b386 Add support for D register, more opcodes 2016-07-07 10:51:54 -06:00